To play around with various additions to registers that may be 8,4,2 or 1 bytes (rax
, eax
, ax
, al
) is there a way I can specify the number of bytes of the number I'm using? For example
# works for 4 bytes
>>> p/x -1
$30 = 0xffffffff
>>> p/x 1
$31 = 0x1
>>> p/d 0xffffffff
$34 = -1
# can I get it to work for one byte, signed char?
>>> p/d 0xff
$35 = 255
A simple way is to use casting to tell gdb the type of the value.
(gdb) p /d (char)0xff
$2 = -1
User contributions licensed under CC BY-SA 3.0