16.2.6 Assertion control commands

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 commands

Use 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 record-all facility, pipe the output of the gdb command to the tee(1) command.

For example:

gdb a.out tee mylogfile

This solution works with the default line-mode user interface, not with the terminal user interface.

The following table lists the XDB and the equivalent WDB commands for handling macros:

16.2.8 Macro facility commands

Use the show user or help user-defined command to obtain a list of all user-defined commands.

264 XDB to WDB Transition Guide

Page 264
Image 264
HP gnu source-level debugger 5992-4701 Assertion control commands, Record and playback commands, Macro facility commands