Lee Duhem
Lee Duhem

Reputation: 15121

How to require gdb to save both user input and its output to the same file?

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.

Upvotes: 1

Views: 598

Answers (1)

Tom Tromey
Tom Tromey

Reputation: 22549

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 :)

Upvotes: 1

Related Questions