How can I log the command I typed in GDB?

坚强是说给别人听的谎言 提交于 2020-08-26 04:40:10

问题


In GDB, I can turn logging on with "set logging on", but this only logs the results of my commands, and not the command itself. It would be useful if I could see the command typed as well. Is there any way to log the command typed?


回答1:


Try man script.

See also this ancient bug. The fact that this hasn't been fixed in 10 years makes me believe that it's unlikely to ever be fixed.

Most GDB developers use emacs, run GDB from inside of emacs, and get the functionality you desire "for free".




回答2:


Something beyond

$ set history save

?

you could set special file for history

set history filename ~/.the_history



来源:https://stackoverflow.com/questions/27334748/how-can-i-log-the-command-i-typed-in-gdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!