gdb修改寄存器的值,以修改执行

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /root/ch/gdb/./a.out 

Breakpoint 2, 0x0000000000400570 in main () at test.cpp:3
3	    printf("%d\n",__LINE__);
(gdb) p $esi=17
$14 = 17
(gdb) c
Continuing.
17
4
[Inferior 1 (process 23702) exited normally]
(gdb)

你可能感兴趣的:(gdb,unix,linux,c++)