HP gnu source-level debugger 5992-4701 Instrukcja Użytkownika Strona 205

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 369
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 204
1 2 ... 200 201 202 203 204 205 206 207 208 209 210 ... 368 369

Komentarze do niniejszej Instrukcji

Brak uwag