150Chapter5 • Working with GNU Debugger
14 total = sum(num1, num2);
(gdb) info frame
Stack level 1, frame at 0xbffffa38:
eip = 0x80484ec in main (sumf.c:14); saved eip 0x40048177
called by frame at 0xbffffa78, caller of frame at 0xbffffa08
source language c.
Arglist at 0xbffffa38, args:
Locals at 0xbffffa38, Previous frame's sp is 0x0
Saved registers:
ebp at 0xbffffa38, eip at 0xbffffa3c
(gdb) down
#0 sum (num1=30, num2=40) at sumf.c:22
22 printf("\nCalculation complete. Returning ...\n");
(gdb) info frame
Stack level 0, frame at 0xbffffa08:
eip = 0x804851b in sum (sumf.c:22); saved eip 0x80484ec
called by frame at 0xbffffa38
source language c.
Arglist at 0xbffffa08, args: num1=30, num2=40
Locals at 0xbffffa08, Previous frame's sp is 0x0
Saved registers:
ebp at 0xbffffa08, eip at 0xbffffa0c
(gdb) down
Bottom (i.e., innermost) frame selected; you cannot go down.
(gdb) n
Calculation complete. Returning ...
23 return (result);
(gdb) n
24}
(gdb) n
main () at sumf.c:15
15 printf("\nThe sum is : %d\n", total);
(gdb) n
The sum is : 70
16}
(gdb) n
Program exited with code 021.
(gdb) quit
[rr@conformix 5]$
•The
frame
command shows the current frame of execution for the program. In simple
terms, you can consider a frame as a block of commands. For example, commands in
one function are a frame. When you use the
frame
command, it displays the current
frame starting point, the file name and current execution pointer.
Next Page >>
<< Previous Page
Back to the Table of Contents