You can reference to the low byte of those registers using the l
suffix:
r8l
, r9l
, r10l
, r11l
, r12l
, r13l
, r14l
, r15l
.
(gdb) p $r13l
$1 = -15
(gdb) p /x $r13l
$2 = 0xf1
I couldn't find these aliases documented anywhere, except in their definition in the gdb codebase:
/* Register names for byte pseudo-registers. */
static const char * const amd64_byte_names[] =
{
"al", "bl", "cl", "dl", "sil", "dil", "bpl", "spl",
"r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l",
"ah", "bh", "ch", "dh"
};
Furthermore, there was a bug in the gdb codebase that would print 0 instead of void if a format is specified to the print
command, as it happens in the last example. Future versions of gdb should display void
if the value that you are printing is not defined.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…