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

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

Starting program: sc1

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

The macro `USED2' has no definition in the current scope. (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) q

The program is running. Exit anyway? (y or n) y.

14.10 Debugging Memory Problems

You can use WDB to nd leaks, profile heap usage and detect other heap-related errors in HP C, HP aC++, and HP Fortran programs written for HP-UX 11.x systems. (Both 32-bit and 64-bit programs are supported.)

On HP-UX 11.x, the memory debugging features of WDB work with both single-threaded and multi-threaded programs that use POSIX threads.

14.10 Debugging Memory Problems 157