Red Hat ENTERPRISE LINUX 3 - DEVELOPER TOOLS GUIDE Manual page 19

Developer tools guide
Hide thumbs Also See for ENTERPRISE LINUX 3 - DEVELOPER TOOLS GUIDE:
Table of Contents

Advertisement

Chapter 3. Developing with Red Hat Enterprise Linux Developer Tools
The following output displays:
12
13
14
15
16
17
18
19
20
21
22
23
24
25
7. To list a specific function code, use the
display. For example, type:
list foo
The following output displays:
1
2
3
4
5
6
7
8
9
10
8. To set a breakpoint at line seven, enter the following input (set a breakpoint at any line by
entering
break linenumber
break 8
The following output displays:
Breakpoint 2 at 0xf4: file hello.c, line 8.
9. To resume normal execution of the program until the next breakpoint, type:
continue
The following output displays:
Continuing.
Hello, world!
Breakpoint 2, foo (b=4) at hello.c:8
8 c = a + b;
10. To step to the next instruction and execute it, type:
step
The following output displays:
9 printf ("%d + %d = %d\n", a, b, c);
11. To display the value of c, type:
print c
The following output displays:
$3 = 7
12. To see how you got to where you are, type:
backtrace
The following output displays:
#0 foo (b=4) at hello.c:9
int
main (void)
{
int b;
a = 3;
b = 4;
printf ("Hello, world!\n");
foo (b);
return 0;
}
#include <stdio.h>
int a, c;
static void
foo (int b)
{
c = a + b;
printf ("%d + %d = %d\n", a, b, c);
}
, where
command with the name of the function to be
list
is the specific line number to break):
linenumber
15

Advertisement

Table of Contents
loading

Table of Contents