1

I know that I can

  1. ask gdb to save my command history to a file, say gdb.history, by set history filename gdb.history and set history save on, and
  2. ask it to log its output to another file, say gdb.output, by set logging file gdb.output and set logging on.

But how to require gdb to save both my command line inputs and its responding outputs to the same file, in the order of they occur in that GDB session?

I tried using the same file name in both history and logging command, it does not work, contents of that file will be overwrite by GDB command history when I quit from gdb.

1 Answer 1

1

You can try playing with logging plus "set trace-commands on". I don't know whether that will do what you want though. There's a bug open for this functionality: https://sourceware.org/bugzilla/show_bug.cgi?id=7219. I see I commented on it but I don't remember anything about it any more :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.