Debugging with GDB (September 2007)

218 Debugging with GDB
"any string" p "any string" Print any string
if expr {cmds}
[{cmds}]
if expr cmds [else cmds] end Conditionally execute cmds
Q Q (with -xdb), silent (must be
first command in a commands list)
Quiet breakpoints
16.2.2 Breakpoint creation commands
The GDB equivalent of the count and cmds arguments is to use the commandsbnum
command to set an ignore count and/or to specify commands to be executed for that
breakpoint.
For C++ programs, you can use the regular-expression breakpoint command rbreak to
set breakpoints on all the member functions of a class or on overloaded functions outside a
class.
The following table lists the XDB and equivalent WDB commands for creating break-
points:
XDB Command WDB Equivalent Meaning
b loc b loc Set a breakpoint at the specified
location
b b Set a breakpoint at the current
line
ba address ba address (with -xdb), b
*address
Set breakpoint at a code address
bb [depth] No equivalent (use b proc) Set breakpoint at proce dure be-
ginning
bi expr.proc b class::proc cond bnum (this
== expr)
Set an instance breakpoint at the
first executable line of expr.proc
bi -c expr No equivalent Set an instance breakpoint at first
executable line of all non-static
member functions of the instance
of a class (no base classes)