如何让 gdb 发出它正在以批处理模式执行的命令

How to make gdb emit the commands it is executing in batch mode

有没有办法调用 gdb --batch --commands some_gdb_script some_executable 并让它发出 它执行的命令以及命令结果?我不想安装 gdb 以外的任何东西,例如 xdotool 等。它应该只在没有扩展名的普通 gdb 中工作。

have it emit both the commands it executes, along with the command results?

查看 this 错误。

使用set trace-commands on几乎达到预期的结果。