From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31415 invoked by alias); 5 Jun 2013 10:34:50 -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 31308 invoked by uid 89); 5 Jun 2013 10:34:49 -0000 X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.1 Received: from mail-bk0-f48.google.com (HELO mail-bk0-f48.google.com) (209.85.214.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 05 Jun 2013 10:34:49 +0000 Received: by mail-bk0-f48.google.com with SMTP id jf17so764190bkc.7 for ; Wed, 05 Jun 2013 03:34:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=pbuDrvuk5W9ZCJ1AbAKpLRESBdQD5sJ2n0kkFHnyQ2M=; b=cNW3uFJlBlCp/5z2mYKMMBrPMieNHp7CMUs7iziIzj33EmlT4LOd9kR9q9h0C5oEr0 TVMtYjN5CwIg//hB1aylr10CaDNNq0rfAaQGQ/b9bp1uRrpHOmLEkg0mH3frWYZTUCIG XpKmKhas/EuLjULGDchFWAzh+17OCLUSh3zmKspnkWvWHGdpDSJ/SObOZvCAcN9YR2U9 cnsx/Pq84rOfX/NIHEUddC2qbiW9vbBcMReiIS6kAF7BEG++Y6Qx12wqUq4iW5as2Acz /S/PlLaf4lNkJZaFrQhEP/rmeTS7M3g/F389d2Hta3di5SzI9kvuh7Qj/uft4c0yTIVa 9EUw== X-Received: by 10.204.246.194 with SMTP id lz2mr9120913bkb.98.1370428486882; Wed, 05 Jun 2013 03:34:46 -0700 (PDT) Received: from localhost.localdomain (cpc11-seac20-2-0-cust84.7-2.cable.virginmedia.com. [81.108.156.85]) by mx.google.com with ESMTPSA id so13sm25360463bkb.15.2013.06.05.03.34.45 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 03:34:45 -0700 (PDT) Message-ID: <51AF1444.5080800@linaro.org> Date: Wed, 05 Jun 2013 10:34:00 -0000 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH 1/3] gdb/printcmd.c: Fix printing of Thumb minimal symbols. Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkniyR2PUt7/KZ9AalC2sPXwFxL68u2N+tJQQ4xm9wTYFQ3s38Jt4vUmsGHi6vzOfEuUaV7 X-SW-Source: 2013-06/txt/msg00073.txt.bz2 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); + /* The msymbol is closer to the address than the symbol; use the msymbol instead. */ symbol = 0; -- 1.8.1.4