Re: PATCH: Support x86 pseudo registers

Eli Zaretskii
2010-03-03T17:33:31Z

> Date: Tue, 2 Mar 2010 14:07:41 -0800
> From: "H.J. Lu" <hjl.tools@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
>
> >>> I presume it lets us say $ah or $ax in addition to $eax, and lets $eax
> >>> work on 64-bit systems where we really have $rax.
> >>
> >> Mmm hmm, and the context would be expressions or anywhere where a
> >> register name is appropriate (eg. info reg). Â Yes?
> >>
> >
> > Yes.
> >
> > (top-gdb) info reg $edi
> > edi Â  Â  Â  Â  Â  Â 0x1 Â  Â  Â 1
> > (top-gdb) info reg $rdi
> > rdi Â  Â  Â  Â  Â  Â 0x1 Â  Â  Â 1
> > (top-gdb) info reg $dl
> > dl Â  Â  Â  Â  Â  Â  0xd8 Â  Â  -40
> > (top-gdb) info reg $dil
> > dil Â  Â  Â  Â  Â  Â 0x1 Â  Â  Â 1
> > (top-gdb)
> >
> >
>
> Basically, you can access any byte/word/dword registers, as shown
> in assembly code, the same way as word/dword registers.

Then how about this entry:

* X86 general purpose registers

GDB now supports reading/writing byte, word and double-word x86
general purpose registers directly. This means you can use, say,
$ah or $ax to refer, respectively, to the byte register AH and
16-bit word register AX that are actually portions of the 32-bit
register EAX or 64-bit register RAX.