HP (Hewlett-Packard) 5992-4701 Computer Hardware User Manual


 
For more information on this feature, see the following example.
14.16.2 Example Illustrating Execution Path Recovery
The following example illustrates the use of the execution path recovery feature in HP
WDB:
Sample Program:
$cat execpath.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int a = 3, b = 0, c = 4;
if (a)
printf("Value of a greater than 0\n");
if (b)
printf("Value of b greater than 0\n");
if (c)
printf("Value of c greater than 0\n");
printf("All condition checking done\n");
return 0;
}
Sample Debugging Session:
$cc +pathtrace -g execpath.c
$gdb a.out
HP gdb ...
Type "show warranty" for warranty/support.
...
(gdb) b main
Breakpoint 1 at 0x4000a60:0: file execpath.c, line 7 from a.out.
(gdb) r
Starting program: a.out
Breakpoint 1, main () at execpath.c:7
7 int a = 3, b = 0, c = 4;
(gdb) n
9 if (a)
(gdb) i ep
Local execution path table for main():
empty
(gdb) i gep
Global execution path table:
empty
(gdb) n
10 printf("Value of a greater than 0\n");
(gdb) n
Value of a greater than 0
12 if (b)
14.16 Printing the Execution Path Entries for the Current Frame or Thread 205