Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine.
FMT is a repeat count followed by a format letter and a size letter.
Format letters are o(octal), x(hex),
d(decimal), u(unsigned decimal), t(binary),
f(float), a(address), i(instruction),
c(char) and s(string).
Size letters are b(byte), h(halfword),
w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed according to the format.
Defaults for format and size letters are those previously used.
Defaults count is 1. Default address is following last thing printed with this command or 'print'.
代码示例:
L = (link_node *)malloc(sizeof(link_node));
L->next = NULL;
L->next = L;
gdb指令示例:
假设这里要检查L指针变量的值及下面4个地址的值,命令如下:
x/4aw L. 即从内存地址L读取内容,w表示以字为一个单位,4表示4个单位,a表示按地址的格式显示.
再假设这里要检查从L指针变量开始的4个指令,则命令如下:
x/4i L. 即从内存地址L读取内容, i表示按指令的格式显示, 4表示显示4条指令
- [assumechen] 呵呵,我把程序搞复杂了。谢谢! 07/12 23:58
- [fpamc] MOV BX,AX MOV AX,DX MOV DX,0 07/11 23:26
- [assumechen] 这个公式原来一直想不明白,总是觉得会溢出,直到看到这个贴子才转过来。 http://www.asm 07/11 21:19
- [assumechen] 谢谢! 07/11 21:16
- [fpamc] 对的。 07/09 23:04
- [assumechen] 谢谢 06/30 22:34
- [assumechen] 谢谢 06/30 22:33
- [fpamc] 对的。 06/30 10:26
- [fpamc] 恩对的, 06/30 10:24
- [assumechen] 是程序错了,把这一句: mov word ptr es:[0dH],ax ; 雇员的平 06/29 14:45