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

查看:67
本文介绍了如何使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'

非常感谢任何想法!

推荐答案

这应该有效:

(gdb) x/gx &var_h

您的其他命令以及"...中的所有内容"都是没有意义的.

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

详细信息内容,并且应始终显示使用的 actual 命令并输出收到的信息,而不是模糊的近似值.

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

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

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