Search code examples
gdbbatch-processing

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


Is there a way to call gdb --batch --commands some_gdb_script some_executable and have it emit both the commands it executes, along with the command results? I do not want to install anything other than gdb, such as xdotool etc. It should just work within stock gdb with no extensions.


Solution

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

    See this bug.

    Using set trace-commands on almost achieves the desired result.