汇编网首页登录博客注册
assumechen的学习博客
博客首页博客互动【做检测题】论坛求助

我的博客

个人首页 |  我的文章 |  我的相册 |  我的好友 |  最新访客 |  文章收藏 |  论坛提问 |  友情链接 |  给我留言  
图片载入中
学习动态
最新留言
好友圈
文章收藏
友情链接

[2013-11-02 09:56] gdb-examine-x命令

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条指令
评论次数(0)  |  浏览次数(449)  |  类型(gdb) |  收藏此文  | 
 
 请输入验证码  (提示:点击验证码输入框,以获取验证码