Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make gdb logging command like what windbg does?

Tags:

gdb

windbg

when you turn on logging in windbg (.logopen), the logging output will include what you have typed on the prompt kd> . but when you turn on logging in gdb (set logging on), only the output of the command will be logged, how to make gdb also echo/log the command in the logging file?

like image 557
Dyno Fu Avatar asked Dec 04 '25 18:12

Dyno Fu


2 Answers

In case you want to log command details in log file, you can set command trace on in gdb along with logging:

    set trace-commands on
    set logging on

This would produce desired logs !

like image 132
Vishal Avatar answered Dec 06 '25 13:12

Vishal


this is just to summarize the result, credit should go to dbrank0.

per this thread, patch to implement similar feature is rejected. and alternative options is to log terminal session, see script, and other options.

like image 33
Dyno Fu Avatar answered Dec 06 '25 14:12

Dyno Fu