User`s guide
56
Chapter 5: Examining and Changing Data
5 foo(i = 4) [“/usr/var/tmp/dbx_examples/foo.c”:40,
0x100011d4]
6 main(argc = 1, argv = 0xffffffad78) [“/usr/var/tmp/src/
dbx_examples/test4.c”:25, 0x10000fa0]
7 __start() [“/shamu/lib/libc/libc_64/csu/
crt1text.s”:137, 0x10000f34]
To set a conditional breakpoint, for example, type:
(dbx) stop in foo if j == 7
Process 0: [3] stop in foo if j==7
If j is not within the scope of foo, then you will receive an error message if
you attempt to call foo interactively. To prevent this, disable or delete any
such breakpoints, conditional commands, or traces before executing the
interactive function call.
C++ Considerations
Debugging a program written in C++ is somewhat different from debugging
programs written in other languages. This section describes these
differences.
Accessing C++ Member Variables
Typically you use standard C++ syntax to access member variables of
objects. For example, if the string _name is a member variable of the object
myWindow, you can print its value by entering:
(dbx) print myWindow._name
0x1001dc1c = “MenuWindow”
To display a static member variable for a C++ class, you must specify the
variable with the class qualifier. For example, to print the value of the static
member variable costPerShare of the class CoOp, enter:
(dbx) print CoOp::costPerShare
25.0