(gdb) b 13

Breakpoint 1 at 0x40007d0:0: file scope.c, line 13 from sc. (gdb) b 23

Breakpoint 2 at 0x40007d0:2: file scope.c, line 23 from sc. (gdb) b 30

Breakpoint 3 at 0x40007e0:0: file scope.c, line 30 from sc. (gdb) r

Starting program: sc

Breakpoint 1, main () at scope.c:13 13 {

(gdb) print USED1 100

(gdb) print USED1+10 110

(gdb) info macro USED1 Defined at scope.c:4 #define USED1 100 (gdb) info macro USED2 Defined at scope.c:5 #define USED2 200 (gdb) c Continuing.

Breakpoint 2, main () at scope.c:23 23 val = USED1 + USED2;

(gdb) info macro USED1 Defined at scope.c:20 #define USED1 101 (gdb) info macro USED2 Defined at scope.c:21 #define USED2 201 (gdb) c Continuing.

Breakpoint 3, main () at scope.c:30 30 val = USED1;

(gdb) info macro USED1 Defined at scope.c:28 #define USED1 102 (gdb) info macro USED2

The macro `USED2' has no definition in the current scope. (gdb)

The following debugging session illustrates macro debugging when the program is com- piled with +macro_debug=referenced option:

$ cc -g +macro_debug=referenced -o sc1 scope.c $ gdb sc1

HP gdb for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc.

...

(gdb) b 13

Breakpoint 1 at 0x40007d0:0: file scope.c, line 13 from sc1. (gdb) b 23

156 HP-UX Configuration-Specific Information

Page 156
Image 156
HP gnu source-level debugger 5992-4701 manual HP-UX Configuration-Specific Information