qustion@jeff-debian:~/Samsung/hello/printf$ gdb ./hello
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) list
1 #include
2
3 int main(int argc, char *argv[]) {
4 printf("Hello the world!\n");
5 return 0;
6 }
7
(gdb) b 5
Breakpoint 1 at 0x80483c1: file hello.c, line 5.
(gdb) r
Starting program: /home/qustion/Samsung/hello/printf/hello
Hello the world!
Breakpoint 1, main () at hello.c:5
5 return 0;
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x080483c1 in main at hello.c:5
breakpoint already hit 1 time
(gdb) info registers
eax 0x11 17
ecx 0x11 17
edx 0xb7ee40f0 -1209122576
ebx 0xb7ee2ff4 -1209126924
esp 0xbfc228f0 0xbfc228f0
ebp 0xbfc228f8 0xbfc228f8
esi 0x80483e0 134513632
edi 0x80482f0 134513392
eip 0x80483c1 0x80483c1
eflags 0x246 [ PF ZF IF ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
(gdb) print/x $eip
$1 = 0x80483c1
(gdb) c
Continuing.
Program exited normally.
(gdb) clear 5
Deleted breakpoint 1
(gdb) disassemble main
Dump of assembler code for function main:
0x080483a4
0x080483a8
0x080483ab
0x080483ae
0x080483af
0x080483b1
0x080483b2
0x080483b5
0x080483bc
0x080483c1
0x080483c6
0x080483c9
0x080483ca
0x080483cb
0x080483ce
End of assembler dump.
(gdb)
沒有留言:
張貼留言