From: Jim Blandy <jimb@codesourcery.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA][1/5] New port: Cell BE SPU (dwarf2loc.c fix)
Date: Mon, 13 Nov 2006 19:40:00 -0000 [thread overview]
Message-ID: <m3u013qgnt.fsf@codesourcery.com> (raw)
In-Reply-To: <200611111837.kABIbcwQ031159@d12av02.megacenter.de.ibm.com> (Ulrich Weigand's message of "Sat, 11 Nov 2006 19:37:38 +0100 (CET)")
"Ulrich Weigand" <uweigand@de.ibm.com> writes:
> this fixes a problem in dwarf2loc.c that triggers for the SPU port.
>
> The code in dwarf_expr_read_reg currently expects that in order to
> retrieve an address value from a register, it's OK to assume the
> address can always be extracted using extract_unsigned_integer
> on the full size of the register.
>
> This fails on the SPU, because all registers are 16 bytes wide, and
> a pointer is represented by simply using the uppermost 4 bytes and
> ignoring the contents of the remaining 12 bytes. I would assume
> that there's also other architectures where the assumption in
> dwarf_expr_read_reg might fail, e.g. due to sign extension issues
> or other required fiddling.
>
> So, to fix this I thought that we already *know* how to extract
> values of a certain type from a register: value_from_register does
> just that, and provides all sorts of configurability for the back
> end to have it just do the right thing. Since the value retrieved
> by dwarf_expr_read_reg is always a pointer to some data object
> (normally on the stack), it should be OK to get it by using
> value_from_register (builtin_type_void_data_ptr, ...).
>
> This is what the patch below does, and it works fine on SPU.
> Additionally tested without regressions on s390-ibm-linux and
> s390x-ibm-linux.
This seems fine. I tested it on i686 Fedora Core 5 and didn't see any
new failures.
Would it be a good idea to introduce a new function, a companion to
value_from_register, that wraps up the composition of
value_from_register and value_as_address?
next prev parent reply other threads:[~2006-11-13 19:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-11 18:37 Ulrich Weigand
2006-11-13 19:40 ` Jim Blandy [this message]
2006-11-15 21:57 ` Ulrich Weigand
2006-11-22 1:42 ` Jim Blandy
2006-11-22 2:30 ` Daniel Jacobowitz
2006-11-22 14:10 ` Ulrich Weigand
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=m3u013qgnt.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--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