Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: Pedro Alves <palves@redhat.com>,
	ppluzhnikov@gmail.com,        gdb-patches@sourceware.org,
	ppluzhnikov@google.com
Subject: Re: [patch] Fix BZ15121 -- x/a broken for addresses in shared libraries
Date: Thu, 10 Sep 2015 15:02:00 -0000	[thread overview]
Message-ID: <alpine.LFD.2.20.1509101537530.10647@eddie.linux-mips.org> (raw)
In-Reply-To: <201509101433.t8AEX5Cw008716@glazunov.sibelius.xs4all.nl>

On Thu, 10 Sep 2015, Mark Kettenis wrote:

> > > index 91bf49e..0624b90 100644
> > > --- a/gdb/value.c
> > > +++ b/gdb/value.c
> > > @@ -2927,7 +2927,13 @@ unpack_pointer (struct type *type, const gdb_byte *valaddr)
> > >  {
> > >    /* Assume a CORE_ADDR can fit in a LONGEST (for now).  Not sure
> > >       whether we want this to be true eventually.  */
> > > -  return unpack_long (type, valaddr);
> > > +  LONGEST ret = unpack_long (type, valaddr);
> > > +  int len = TYPE_LENGTH (type);
> > > +  if (sizeof (CORE_ADDR) > len && ret < 0) {
> > > +    /* Don't sign-extend 32-bit pointer.  BZ 15121.  */
> > > +    return ret & ((1UL << (8 * len)) - 1);
> > > +  }
> > > +  return ret;
> > >  }
> > 
> > Do we need to keep sign-extending on MIPS?  Adding Maciej.

 Thanks for the heads-up!

> I'm pretty sure you do.

 Indeed.  Use `bfd_get_sign_extend_vma' to determine.

  Maciej


  parent reply	other threads:[~2015-09-10 15:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-06 20:03 Paul Pluzhnikov
     [not found] ` <55F19100.30600@redhat.com>
2015-09-10 14:33   ` Mark Kettenis
2015-09-10 15:00     ` Paul Pluzhnikov
2015-09-10 15:07       ` Pedro Alves
2015-09-10 15:19         ` Maciej W. Rozycki
2015-09-10 15:02     ` Maciej W. Rozycki [this message]
2015-09-12 21:41       ` Paul Pluzhnikov
2015-09-12 21:56         ` Maciej W. Rozycki

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=alpine.LFD.2.20.1509101537530.10647@eddie.linux-mips.org \
    --to=macro@linux-mips.org \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=palves@redhat.com \
    --cc=ppluzhnikov@gmail.com \
    --cc=ppluzhnikov@google.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