Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Jim Blandy <jimb@red-bean.com>
Cc: gdb-patches@sourceware.org, Daniel Jacobowitz <drow@false.org>
Subject: Re: [RFA/RFC] dwarf2-frame read_reg
Date: Wed, 12 Apr 2006 19:20:00 -0000	[thread overview]
Message-ID: <443D5302.3020708@redhat.com> (raw)
In-Reply-To: <8f2776cb0604112142i32dcdf0dic8f44f2989311786@mail.gmail.com>

Jim Blandy wrote:
> On 4/11/06, Michael Snyder <msnyder@redhat.com> wrote:
> 
>>I want you guys to vett this change.  I was getting wrong results
>>on a target where sizeof (SP) != sizeof (void *).  The local func
>>read_reg was calling extract_unsigned_integer with the wrong size.
> 
> 
> Well, extract_typed_address requires the type of the register to be
> some sort of pointer.  read_reg is given as a callback to the Dwarf
> expression evaluator in dwarf2expr.c, so it could be handed any
> register at all.
> 
> How about unpack_long (buf, register_type (gdbarch, regnum))? 
> Definitely regression-test this on several platforms...
> 

Hmmm... extract_typed_address calls POINTER_TO_ADDRESS, which
seems more likely to "do the right thing".

How about this?

   if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_PTR)
     return extract_typed_address (buf, register_type (gdbarch, regnum));
   else
     return extract_typed_address (buf, builtin_type_void_data_ptr);

(I am assuming that a register_type is unlikely to be TYPE_CODE_REF)


  parent reply	other threads:[~2006-04-12 19:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12  3:34 Michael Snyder
2006-04-12  4:42 ` Jim Blandy
2006-04-12 18:18   ` Mark Kettenis
2006-04-12 19:15     ` Michael Snyder
2006-04-20 17:21     ` Daniel Jacobowitz
2006-04-20 19:06       ` Michael Snyder
2006-04-20 19:10       ` Mark Kettenis
2006-04-12 19:20   ` Michael Snyder [this message]
2006-05-05 19:44 ` Daniel Jacobowitz
2006-05-17 15: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=443D5302.3020708@redhat.com \
    --to=msnyder@redhat.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@red-bean.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