From patchwork Sun Sep 20 21:20:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 8810 Received: (qmail 97605 invoked by alias); 20 Sep 2015 21:21:51 -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 97596 invoked by uid 89); 20 Sep 2015 21:21:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 20 Sep 2015 21:21:49 +0000 Received: by padhk3 with SMTP id hk3so97384662pad.3 for ; Sun, 20 Sep 2015 14:21:48 -0700 (PDT) X-Received: by 10.68.237.161 with SMTP id vd1mr20167264pbc.168.1442784108035; Sun, 20 Sep 2015 14:21:48 -0700 (PDT) Received: from sspiff.org (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by smtp.gmail.com with ESMTPSA id qr5sm20487151pbb.26.2015.09.20.14.21.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Sep 2015 14:21:47 -0700 (PDT) Received: by sspiff.org (sSMTP sendmail emulation); Sun, 20 Sep 2015 14:20:37 -0700 From: Doug Evans To: gdb-patches@sourceware.org Subject: [COMMITTED PATCH] dwarf2_compute_name: add fixme, don't use same name as parameter for local Date: Sun, 20 Sep 2015 14:20:37 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. I've committed this. Later I intend to remove the FIXME but right now it helps keep my mind straight since I can only get to this sporadically. Regression tested on amd64-linux. 2015-09-20 Doug Evans * dwarf2read.c (dwarf2_compute_name): Add FIXME. Don't use a local variable name that collides with a parameter. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 6ec8595..b8c0872 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8431,8 +8431,13 @@ dwarf2_compute_name (const char *name, if (name == NULL) name = dwarf2_name (die, cu); - /* For Fortran GDB prefers DW_AT_*linkage_name if present but otherwise - compute it by typename_concat inside GDB. */ + /* For Fortran GDB prefers DW_AT_*linkage_name for the physname if present + but otherwise compute it by typename_concat inside GDB. + FIXME: Actually this is not really true, or at least not always true. + It's all very confusing. SYMBOL_SET_NAMES doesn't try to demangle + Fortran names because there is no mangling standard. So new_symbol_full + will set the demangled name to the result of dwarf2_full_name, and it is + the demangled name that GDB uses if it exists. */ if (cu->language == language_ada || (cu->language == language_fortran && physname)) { @@ -8441,13 +8446,13 @@ dwarf2_compute_name (const char *name, to be able to reference. Ideally, we want the user to be able to reference this entity using either natural or linkage name, but we haven't started looking at this enhancement yet. */ - const char *name; + const char *linkage_name; - name = dwarf2_string_attr (die, DW_AT_linkage_name, cu); - if (name == NULL) - name = dwarf2_string_attr (die, DW_AT_MIPS_linkage_name, cu); - if (name != NULL) - return name; + linkage_name = dwarf2_string_attr (die, DW_AT_linkage_name, cu); + if (linkage_name == NULL) + linkage_name = dwarf2_string_attr (die, DW_AT_MIPS_linkage_name, cu); + if (linkage_name != NULL) + return linkage_name; } /* These are the only languages we know how to qualify names in. */