在gdb中保存核心文件 [英] Saving core file in gdb

查看:138
本文介绍了在gdb中保存核心文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用gdb来保存/转储核心文件?有时我想保存文件以便稍后进行分析。

Is it possible to save/dump core file using gdb? Sometimes I want to save file to analyze it later.

推荐答案

在gdb中发出'generate-core-file'命令

Issue the 'generate-core-file' command in gdb.

(gdb) help generate-core-file
Save a core file with the current state of the debugged process.
Argument is optional filename.  Default filename is 'core.<process_id>'.
(gdb) break main
Breakpoint 1 at 0x400e0b: file utils/udec.c, line 36.
(gdb) r
Starting program: /home/nos/build/utils/udec

Breakpoint 1, main (argc=1, argv=0x7fffffffe9a8) at utils/udec.c:36
36              int fileargc = 1;
(gdb) generate-core-file
Saved corefile core.7336

这篇关于在gdb中保存核心文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆