From patchwork Tue Apr 7 13:15:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Galvan X-Patchwork-Id: 6064 Received: (qmail 20708 invoked by alias); 7 Apr 2015 13:15:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20696 invoked by uid 89); 7 Apr 2015 13:15:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-qg0-f43.google.com Received: from mail-qg0-f43.google.com (HELO mail-qg0-f43.google.com) (209.85.192.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 07 Apr 2015 13:15:48 +0000 Received: by qgdy78 with SMTP id y78so19819063qgd.0 for ; Tue, 07 Apr 2015 06:15:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=0WkpzyPG2pgrJSwo8U1czBseObIR4bZi9jpqoDQY2jA=; b=CKKZpOXabBiqfewAnKEqsCVkUYMd2wgCLK7cLBre+cQYqI0YhfaVZZMM34c0rLHCYC RRoPABBpwgKNg3kleXKFcGs5/+dJA+7IhC3JDE5CsZuFp+8GJmmeI21L6vg4sdoB6JUl 7guSE8qb57mrT2lStxRU0InoGpAvGDRosVdau9gQsLnKF3EcUD4z6m+jCT0P0yCcTdI0 gWgsX5aTh6QejmzCIhyu/4ull3V6gl8ULnPHu1EpupDhf8iOOjSWHxfzovXfujvBaV7w nWdpCdpnDZHZ4fKVWoDWKUOHDTo2fnx+XWs2Gy5KddMSRAIeutkzgb6ko/qeNQF/06s9 KKAA== X-Gm-Message-State: ALoCoQlp3XbTPVDnXed8yz+NyV/C+COJdegd98DLAqsrWevEoCP5fEWqifJux8AsP8JjaCXDbf+z X-Received: by 10.229.122.70 with SMTP id k6mr24047152qcr.27.1428412546347; Tue, 07 Apr 2015 06:15:46 -0700 (PDT) Received: from martin-galvan.dominio.tallertechnologies.com ([200.69.202.173]) by mx.google.com with ESMTPSA id i14sm5092882qkh.5.2015.04.07.06.15.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Apr 2015 06:15:45 -0700 (PDT) From: Martin Galvan To: gdb-patches@sourceware.org Subject: [PATCH] Fix PR gdb/17720 (Function names appear without namespace/class prefixes in backtrace for optimized code) Date: Tue, 7 Apr 2015 10:15:38 -0300 Message-Id: <1428412538-8478-1-git-send-email-martin.galvan@tallertechnologies.com> This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. gdb/ 2015-04-07 Martin Galvan * dwarf2read.c (die_needs_namespace): Return 1 for DW_TAG_inlined_subroutine. --- gdb/dwarf2read.c | 1 + 1 file changed, 1 insertion(+) -- 2.3.5 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index f6b0c01..2bf3513 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_enumeration_type: case DW_TAG_enumerator: case DW_TAG_subprogram: + case DW_TAG_inlined_subroutine: case DW_TAG_member: case DW_TAG_imported_declaration: return 1;