This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfa] Use better types for ARM registers


On Tue, 2006-06-20 at 20:45, Daniel Jacobowitz wrote:
> This patch switches pc and sp to pointer types, and other registers
> from int32 to uint32.  The pc switch follows in the footsteps of a
> clever idea that I last remember seeing from Mark Kettenis:
> 
> (gdb) i reg pc
> pc             0x83a4   0x83a4 <handler+20>
> 
> The uint32 change is both cosmetic (I think it's less messy) and
> necessary.  I recently committed this, after a bug report from Michael
> and some discussion:
> 
> 2006-05-17  Daniel Jacobowitz  <dan@codesourcery.com>
> 
>         * dwarf2-frame.c: Include "value.h".
>         (read_reg): Use unpack_long and register_type.
>         * Makefile.in (dwarf2-frame.o): Update.
> 
> An unexpected consequence is that if the CFA comes from a register with
> a signed type, and the host is 64-bit (like my amd64 desktop), the CFA
> will be extended in the dwarf2 frame ID.  This causes "stack
> corruption" messages because we think it's way outside of the previous
> frame.  So, fix and prettify, at the same time.
> 
> OK?

I can't see any problems with this.  Abstractly, registers are just
buckets of bits, it's the use context that determines whether they are
signed or unsigned (or something else entirely).  In some ways it might
be nice if we could enforce all interpretation of the bits to be
explicit, but I can see that might be an unnecessary overhead.  I guess
interpreting the value by default as unsigned is closer to my ideal than
defaulting to signed.

R.

One of the things that has always frustrated me with GDB is to print out
the value of an integer register (or pair of such registers) as a
floating point value -- ie, there's no obvious way to do the equivalent
of *(double*)&regnum.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]