From: Daniel Jacobowitz <drow@false.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: dwarf2-frame.c read_reg problems, again ...
Date: Wed, 31 Oct 2007 04:47:00 -0000 [thread overview]
Message-ID: <20071031021821.GB30157@caradoc.them.org> (raw)
In-Reply-To: <200710310151.l9V1pTLb008147@d12av02.megacenter.de.ibm.com>
On Wed, Oct 31, 2007 at 02:51:29AM +0100, Ulrich Weigand wrote:
> With the patch refered to above, read_reg will respect the
> signedness of the register_type, if it is an integral type.
> This is not a problem if the register type is a pointer type
> (in which case pointer_to_address would be consulted), but
> on ppc the CFA gets computed from regular general purpose
> registers, with an integral register_type.
>
> Those in turn used to be described as "builtin_type_uint32"
> by the original rs6000_register_type. The generic XML-based
> machinery now apparently uses a signed integer type instead,
> exposing the problem.
This was plainly and simply a mistake. While I agree that changing
them back is not a real solution to the problem you've found, I didn't
mean to flip the signedness of all those registers. If uint32 is in
any sense more architecturally appropriate, or even for sheer
tradition, let's flip them back.
> Now I'm wondering: what was the motivation behind using
> unpack_long here? The dwarf2loc.c:dwarf_expr_read_reg
> routine, which saves basically the same purpose, now uses
> address_from_register -- i.e. specifically treats the
> value as pointer, not integer ...
I think we have about five too many ways to take a register and make
it into a number. On the other hand, dwarf_expr_read_reg
uses builtin_type_void_data_ptr. That is probably broken on
whatever target Michael Snyder was trying to fix in the patch
you referenced, where the sizes differ.
If we use address_from_register, we will end up in a call to
unpack_long using the provided type. So I think that is exactly the
same as what we have now.
This is the trouble with using a host integer type to represent target
addresses. If we did all our arithmetic on opaque CORE_ADDR's, this
wouldn't happen. I wonder if there's no getting around the need to
define a sensible calculus for them...
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-10-31 2:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 2:18 Ulrich Weigand
2007-10-31 4:47 ` Daniel Jacobowitz [this message]
2007-10-31 18:56 ` Ulrich Weigand
2007-10-31 19:12 ` 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=20071031021821.GB30157@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/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