GDB does not provide the ability to trace by instruction. Watchpoints, however, provide similar functionality to xdb assertions.
For example, watchpoints can be:
•Enabled (corresponds to aa)
•Disabled (corresponds to da)
•Listed (corresponds to info watch)
•Added (corresponds to x)
WDB does not have explicit equivalents for the following commands:
a aa da la sa ta x
16.2.7 Record and playback commandsUse the source command to read commands from a file. GDB does not provide a recording capability like XDB's, but you can use the set history save command to record all GDB commands in the file ./.gdb_history (similar to the $HOME/
.xdbhist file). The history file is not saved until the end of your debugging session.
To change the name of the history file, use set history filename.
To stop recording, use set history save off.
To display the current history status, use show history. For an equivalent of the XDB
For example:
gdb a.out tee mylogfile
This solution works with the default
The following table lists the XDB and the equivalent WDB commands for handling macros:
16.2.8 Macro facility commandsUse the show user or help
264 XDB to WDB Transition Guide