问题
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