开发者

Store all the debugging done in gdb in a file

if i want to store all the actions that i have done in 开发者_如何学JAVAgdb on unix machine while debugging a c code what should i do. for example:

i have attached a process to gdb and i have run it.later i have done some check in some functions and verified some local variables etc.

If i want to store all the stuff that i have performed using gdb in a text file on unix,what should i do?


You can log all gdb output into a file (see the manual):

(gdb) set logging file <file>
(gdb) set logging on
(gdb) show logging


You can use the script command, which "makes a typescript of everything printed on your terminal." That includes output from gdb, though.


I don't want to start a flame war here, but Emacs has a gdb mode (the Grand Unified Debugger mode) and you can save any Emacs buffer to a file. If you use a different editor, it may also have a debugging plugin that works with gdb.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜