Re: PATCH: Support x86 pseudo registers

Pedro Alves
2010-03-12T04:23:16Z

On Wednesday 03 March 2010 17:33:21, Eli Zaretskii wrote:
> * 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.
>

I just realized that this change means that $sp is now just
a 16-bit word of $esp, instead of a pseudo-register resolving to
either $esp/$rsp (32-bit/64-bit). I can't say it is actually wrong to
have it that way, but, I think this should at least be mentioned in
NEWS, if not in the manual too, because it can catch people
by surprise.

old:

(top-gdb) p $sp
$1 = (void *) 0x7fffffffdff0
(top-gdb) ptype $sp
type = void *

new:

(top-gdb) p $sp
$2 = -8176
(top-gdb) ptype $sp
type = int16_t
(top-gdb)

--
Pedro Alves