gpt4 book ai didi

C/GDB : display contents of address

转载 作者:太空狗 更新时间:2023-10-29 14:53:32 27 4
gpt4 key购买 nike

我有这个地址,0x8002bf20,我需要看看里面有什么。我知道 GDB 会做一些像“print x”这样的好事,我会看到像 struct ex {x: 1, y: 2}

这样的东西

我需要查看我需要检查的地址的那种打印输出。

谢谢。

最佳答案

如果您知道该地址的结构类型,您可以强制 GDB 打印它:

(gdb) print *(struct mystruct *) 0x8002bf20

如果您不知道结构的类型,那么您能做的最好的就是您已经提到的 x 命令——尽管请注意转换为 '错误的'类型,因此您可以使用 print *(struct mystruct *) 尝试各种结构,直到输出看起来合理为止。

关于C/GDB : display contents of address,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9476398/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com