HP gnu source-level debugger 5992-4701 User Manual Page 205

  • Download
  • Add to my manuals
  • Print
  • Page
    / 369
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 204
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
Page view 204
1 2 ... 200 201 202 203 204 205 206 207 208 209 210 ... 368 369

Comments to this Manuals

No comments