日期:2014-05-16  浏览次数:20503 次

gdb笔记
i reg 看寄存器         info
bt full                backtrace
p $eax                 print
print有各种格式,p/x 16进制,p/o 8进制,p/s 字符
x/格式 地址
x $pc       pc为程序指针也叫eip
x/i $pc  汇编指令 ★★★★★★★★★★
disas $pc              disassemble 反汇编命令
(gdb) i reg
eax            0xfffffdfe       -514
ecx            0x8      8
edx            0xb74c0ff4       -1219751948
ebx            0xbfe34850       -1075623856
esp            0xbfe347e0       0xbfe347e0
ebp            0x85f1968        0x85f1968
esi            0x1      1
edi            0x85f08a8        140445864
eip            0xb7721424       0xb7721424 <__kernel_vsyscall+16>
eflags         0x200246 [ PF ZF IF ID ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
(gdb) p $eax
$1 = -514
(gdb) p/x $eax
$2 = 0xfffffdfe
(gdb) p/d $eax
$3 = -514
(gdb) p/u $eax
$4 = 4294966782
(gdb) p/o $eax
$5 = 037777776776
(gdb) p/t $eax
$6 = 11111111111111111111110111111110
(gdb) p/c $eax
$7 = -2 '\376'
(gdb) p/f $eax
$8 = -nan(0x7ffdfe)
(gdb) p/s $eax
$9 = -514
(gdb) p/i $eax
Format letter "i" is meaningless in "print" command.
(gdb)