From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28078 invoked by alias); 5 Jun 2013 15:27: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 28069 invoked by uid 89); 5 Jun 2013 15:27:44 -0000 X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.1 Received: from mail-ie0-f180.google.com (HELO mail-ie0-f180.google.com) (209.85.223.180) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 05 Jun 2013 15:27:44 +0000 Received: by mail-ie0-f180.google.com with SMTP id b11so3956667iee.39 for ; Wed, 05 Jun 2013 08:27:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=fXrtbJH8SOjPrYD3R761e06IFDG5LlKpDk+g5nq/l2k=; b=n+8F25qn2ENIw9SZ3s10aH+yLyT/ANKk5V0AuP7Cq2fa2Xvm+6ujp05IiCIVR9YpWQ PjxvCUY4tNyvl5fBS85FwsTKwKaWrj2Nu3l15DIeGV0/HeWLdo686TRqvlaNLdJUMosg Ux/fM5BB+YLCTAV120cIbDgC0mZ56pTBHAHRyuQVYgyegaWCBQIfwW3g5xXWQoZi2S/7 LJrbhcFD/GdgQfJCUatX36T+8+LQ4VVkcWCf0egnY27JM7hgWYz2U0EBzp854AZ+x9Ww Q0jCDspWuf2SQNW/FHBiLf69uk+hzKQ6rdKiLeVGbfC0JKc/aHVy9EQApfaJdwcLcKGY 2eEg== MIME-Version: 1.0 X-Received: by 10.50.120.9 with SMTP id ky9mr3408976igb.41.1370446062749; Wed, 05 Jun 2013 08:27:42 -0700 (PDT) Received: by 10.64.8.111 with HTTP; Wed, 5 Jun 2013 08:27:42 -0700 (PDT) In-Reply-To: <51AF576C.7070302@redhat.com> References: <51AF1444.5080800@linaro.org> <51AF576C.7070302@redhat.com> Date: Wed, 05 Jun 2013 15:27:00 -0000 Message-ID: Subject: Re: [PATCH 1/3] gdb/printcmd.c: Fix printing of Thumb minimal symbols. From: Will Newton To: Pedro Alves Cc: "gdb-patches@sourceware.org" , Patch Tracking Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmH8lTpnvz+jqn4O5ZayptPCh0ZZHV1V8Xkq0dHHtOmZ4dPNXWyNFHLUkSZ209KGd6mtxXo X-SW-Source: 2013-06/txt/msg00082.txt.bz2 On 5 June 2013 16:21, Pedro Alves wrote: > 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? Sounds sensible. I'll respin the patch and retest. -- Will Newton Toolchain Working Group, Linaro