How can I make GDB print 64 bit variables?

亡梦爱人 提交于 2021-02-17 07:05:46

问题


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

using

print var_h

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!


回答1:


This should work:

(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.



来源:https://stackoverflow.com/questions/49956000/how-can-i-make-gdb-print-64-bit-variables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!