From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113454 invoked by alias); 10 Sep 2015 15:02:45 -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 113385 invoked by uid 89); 10 Sep 2015 15:02:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: cvs.linux-mips.org Received: from eddie.linux-mips.org (HELO cvs.linux-mips.org) (148.251.95.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Sep 2015 15:02:43 +0000 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S27007139AbbIJPCkvCWNw (ORCPT ); Thu, 10 Sep 2015 17:02:40 +0200 Date: Thu, 10 Sep 2015 15:02:00 -0000 From: "Maciej W. Rozycki" To: Mark Kettenis cc: Pedro Alves , ppluzhnikov@gmail.com, gdb-patches@sourceware.org, ppluzhnikov@google.com Subject: Re: [patch] Fix BZ15121 -- x/a broken for addresses in shared libraries In-Reply-To: <201509101433.t8AEX5Cw008716@glazunov.sibelius.xs4all.nl> Message-ID: References: <55F19100.30600@redhat.com> <201509101433.t8AEX5Cw008716@glazunov.sibelius.xs4all.nl> User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00172.txt.bz2 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