From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24533 invoked by alias); 5 Jun 2013 15:21:22 -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 24524 invoked by uid 89); 5 Jun 2013 15:21:21 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 05 Jun 2013 15:21:21 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r55FLIoF004866 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Jun 2013 11:21:19 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r55FLHBD022442; Wed, 5 Jun 2013 11:21:17 -0400 Message-ID: <51AF576C.7070302@redhat.com> Date: Wed, 05 Jun 2013 15:21:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Will Newton CC: gdb-patches@sourceware.org, patches@linaro.org Subject: Re: [PATCH 1/3] gdb/printcmd.c: Fix printing of Thumb minimal symbols. References: <51AF1444.5080800@linaro.org> In-Reply-To: <51AF1444.5080800@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00081.txt.bz2 On 06/05/2013 11:34 AM, Will Newton wrote: > > In build_address_symbolic we call gdbarch_addr_bits_remove for > symbols in the symbol table but not for minimal symbols. This > causes a failure in gdb.cp/virtfunc.exp on ARM, as the address > of the virtual thunk is given an offset of 1 when in Thumb mode. > > gdb/ChangeLog: > > 2013-06-05 Will Newton > > * printcmd.c (build_address_symbolic): Call > gdbarch_addr_bits_remove for text minimal symbols. > --- > gdb/printcmd.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gdb/printcmd.c b/gdb/printcmd.c > index 7beb334..619e684 100644 > --- a/gdb/printcmd.c > +++ b/gdb/printcmd.c > @@ -689,6 +689,16 @@ build_address_symbolic (struct gdbarch *gdbarch, > { > if (SYMBOL_VALUE_ADDRESS (msymbol) > name_location || symbol == NULL) > { > + /* If this is a function (i.e. a code address), strip out any > + non-address bits. For instance, display a pointer to the > + first instruction of a Thumb function as ; the > + second instruction will be , even though the > + pointer is . This matches the ISA behavior. */ > + if (MSYMBOL_TYPE (msymbol) == mst_text > + || MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc > + || MSYMBOL_TYPE (msymbol) == mst_file_text) > + addr = gdbarch_addr_bits_remove (gdbarch, addr); Shouldn't we do this for all text symbols, and thus for mst_solib_trampoline too? Not sure whether the if above that seems to be checking for text symbols is missing it too: if (msymbol != NULL && MSYMBOL_HAS_SIZE (msymbol) && MSYMBOL_SIZE (msymbol) == 0 && MSYMBOL_TYPE (msymbol) != mst_text && MSYMBOL_TYPE (msymbol) != mst_text_gnu_ifunc && MSYMBOL_TYPE (msymbol) != mst_file_text) msymbol = NULL; (I wish this bit had a comment mentioning what's it about.) > + > /* The msymbol is closer to the address than the symbol; > use the msymbol instead. */ > symbol = 0; -- Pedro Alves