From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id JCcoOSPYdGJNnQQAWB0awg (envelope-from ) for ; Fri, 06 May 2022 04:11:15 -0400 Received: by simark.ca (Postfix, from userid 112) id BD9B81E058; Fri, 6 May 2022 04:11:15 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=gdCMwnyq; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 13D071E00D for ; Fri, 6 May 2022 04:11:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F1820385625A for ; Fri, 6 May 2022 08:11:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1820385625A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651824674; bh=JQuECSGOn5uj5TyPjIUkxXB6I5aJ+qv9X/3+4iDRb+4=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=gdCMwnyqYXoJwYkJi7o0BtxHhun/gr5V/LTY1fgQpQHWATbzkbsNyIiagT3aN7Hh2 RdYIdiwqp5JG1lk43D63h8SdzxD0qYmc0GNcF1mQ3l/8yb73XIuh3k7pMnbgZEJpuY gxyOKL9BJSTPoPAu2YV2J0KQo2wQY0VFryxkXqcY= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id DFB2A3856DE7 for ; Fri, 6 May 2022 08:10:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFB2A3856DE7 Received: from octopus (unknown [IPv6:2a01:e34:ef9a:d0b0:63db:3df:b586:6c02]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id CBFBF80D60; Fri, 6 May 2022 08:10:51 +0000 (UTC) Date: Fri, 6 May 2022 09:10:42 +0100 To: Pedro Alves Subject: Re: [PATCH 1/3] Fix "b f(std::string)", always use DMGL_VERBOSE Message-ID: <20220506081029.x5ztruwtnhvir33n@octopus> References: <20220505185020.3648774-1-pedro@palves.net> <20220505185020.3648774-2-pedro@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505185020.3648774-2-pedro@palves.net> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Fri, 06 May 2022 08:10:52 +0000 (UTC) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, I have minor comments inlined below. > [...] > > When the libiberty demangler encounters such a abbreviation, by > default, it expands it to the user-friendly typedef "std::string", > "std::iostream", etc.. If OTOH DMGL_VERBOSE is specified, the > abbreviation is expanded to the underlying, non-typeded fullname s/non-typeded/non-typedefed/ ? > [...] > > Now, if DMGL_VERBOSE is _not_ used, then the demangler demangles the > mangled name of a function such as "void f(std::string)" thas was s/thas/that/ > diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y > index 6410363c87f..ceb4c968935 100644 > --- a/gdb/cp-name-parser.y > +++ b/gdb/cp-name-parser.y > @@ -1959,8 +1959,7 @@ cp_comp_to_string (struct demangle_component *result, int estimated_len) The comment for this function is: /* Convert RESULT to a string. The return value is allocated using xmalloc. ESTIMATED_LEN is used only as a guide to the length of the result. This functions handles a few cases that cplus_demangle_print does not, specifically the global destructor and constructor labels. */ The last sentence (which references cplus_demangle_print) is not accurate anymore. This was out of sync before your change, but while at it, do you mind updating the comment? > { > size_t err; > > - char *res = cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, > - result, estimated_len, &err); > + char *res = gdb_cplus_demangle_print (result, estimated_len, &err); > return gdb::unique_xmalloc_ptr (res); > } Best, Lancelot.