GDB的x memory-dump命令中的十六进制大小 [英] Size of a hex in GDB's x memory-dump command

查看:581
本文介绍了GDB的x memory-dump命令中的十六进制大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在汇编中尝试x命令的所有变体.我输入了

I'm trying to try all the variants of the x command in assembly. I typed

(gdb) x /x $rsp
0x7fffffffdf90: 0x01

根据我的书,x/x命令从rsp中选择前8个字节,并将它们写为十六进制.但是,在寻找汇编文档(gdb帮助)时,我找不到/x的大小显式为8字节的任何地方.那么我怎么知道它是否真的是8个字节?

According to my book the x/x command select the first 8 bytes from rsp and write them as an hex. However, looking for the assembly documentation (gdb help) i have not found anywhere that the size of /x is explicitly 8 byte. So how do I know if it is really 8 bytes ?

推荐答案

那么我怎么知道它是否真的是8个字节?

So how do I know if it is really 8 bytes ?

不是.这是您上次使用的大小". 文档.

It's not. It's "whatever size you used last". Documentation.

例如:

(gdb) x/bx $rsp
0x7fffffffcbc8: 0x1c

后续的x/x命令将使用大小1(单个字符):

Subsequent x/x commands will use size 1 (a single char):

(gdb) x/x $rsp
0x7fffffffcbc8: 0x1c

您可以显式覆盖大小:

(gdb) x/gx $rsp
0x7fffffffcbc8: 0x00007ffff7ddc61c

随后的x/x命令现在默认为8号:

Subsequent x/x commands now default to size 8:

(gdb) x/x $rsp
0x7fffffffcbc8: 0x00007ffff7ddc61c

这篇关于GDB的x memory-dump命令中的十六进制大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆