From: Richard Earnshaw <rearnsha@arm.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfa] Use better types for ARM registers
Date: Wed, 21 Jun 2006 10:59:00 -0000 [thread overview]
Message-ID: <1150887507.25267.8.camel@pc960.cambridge.arm.com> (raw)
In-Reply-To: <20060620194545.GA32554@nevyn.them.org>
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*)®num.
next prev parent reply other threads:[~2006-06-21 10:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-20 19:45 Daniel Jacobowitz
2006-06-21 10:59 ` Richard Earnshaw [this message]
2006-06-23 13:01 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1150887507.25267.8.camel@pc960.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox