From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68436 invoked by alias); 10 Sep 2015 14:33:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 68422 invoked by uid 89); 10 Sep 2015 14:33:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 10 Sep 2015 14:33:17 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by sibelius.xs4all.nl (8.14.5/8.14.5) with ESMTP id t8AEX6b6014921; Thu, 10 Sep 2015 16:33:06 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id t8AEX5Cw008716; Thu, 10 Sep 2015 16:33:05 +0200 (CEST) Date: Thu, 10 Sep 2015 14:33:00 -0000 Message-Id: <201509101433.t8AEX5Cw008716@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: palves@redhat.com CC: ppluzhnikov@gmail.com, gdb-patches@sourceware.org, ppluzhnikov@google.com, macro@linux-mips.org In-reply-to: <55F19100.30600@redhat.com> (message from Pedro Alves on Thu, 10 Sep 2015 15:17:36 +0100) Subject: Re: [patch] Fix BZ15121 -- x/a broken for addresses in shared libraries References: <55F19100.30600@redhat.com> X-SW-Source: 2015-09/txt/msg00169.txt.bz2 > Date: Thu, 10 Sep 2015 15:17:36 +0100 > From: Pedro Alves > > On 09/06/2015 09:03 PM, Paul Pluzhnikov 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. I'm pretty sure you do.