如何让 GDB 打印 64 位变量? [英] How can I make GDB print 64 bit variables?

查看:36
本文介绍了如何让 GDB 打印 64 位变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 GDB 调试用

I'm using GDB to debug code that was assembled with

nasm -felf64 -Fdwarf

当我想检查标签符号处的值时,说

when I want to examine the value at a label symbol, say

var_h: dq -1

使用

打印 var_h

GDB 假定该值是 32 位并且只给我最低的 4 个字节

GDB assumes that the value is 32-bit and only gives me the lowest 4 bytes

x 1gx $var_h

给出类似无法将值转换为整数"的错误

gives an error along the lines of "cannot convert value to integer'

非常感谢您的任何想法!

Very grateful for any ideas!

推荐答案

这应该有效:

(gdb) x/gx &var_h

您的其他命令以及沿着...的行"毫无意义.

Your other commands, as well as "along the lines of ..." make no sense.

细节很重要,你应该总是显示你使用的实际命令和你收到的输出,而不是模糊的近似值.

Details matter, and you should always show actual commands you used and output you received, not vague approximations thereof.

这篇关于如何让 GDB 打印 64 位变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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