Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] Fix "b f(std::string)", always use DMGL_VERBOSE
Date: Fri, 6 May 2022 09:10:42 +0100	[thread overview]
Message-ID: <20220506081029.x5ztruwtnhvir33n@octopus> (raw)
In-Reply-To: <20220505185020.3648774-2-pedro@palves.net>

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<char> (res);
>  }

Best,
Lancelot.

  parent reply	other threads:[~2022-05-06  8:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05 18:50 [PATCH 0/3] Fix "b func(std::string)", DMGL_VERBOSE, gdb.cp/no-dmgl-verbose.exp Pedro Alves
2022-05-05 18:50 ` [PATCH 1/3] Fix "b f(std::string)", always use DMGL_VERBOSE Pedro Alves
2022-05-05 20:31   ` Keith Seitz via Gdb-patches
2022-05-05 21:49   ` Carl Love via Gdb-patches
2022-05-06 13:21     ` Pedro Alves
2022-05-06  8:10   ` Lancelot SIX via Gdb-patches [this message]
2022-05-06 13:09     ` Pedro Alves
2022-05-05 18:50 ` [PATCH 2/3] Always pass an explicit language down to c_type_print Pedro Alves
2022-05-05 20:47   ` Keith Seitz via Gdb-patches
2022-05-06 12:33     ` Pedro Alves
2022-05-05 18:50 ` [PATCH 3/3] Fix "b f(std::string)" when current language is C Pedro Alves
2022-05-05 20:50   ` Keith Seitz via Gdb-patches
2022-05-06  8:34   ` Lancelot SIX via Gdb-patches
2022-05-06 13:09     ` Pedro Alves
2022-05-09 16:54 ` [PATCH 0/3] Fix "b func(std::string)", DMGL_VERBOSE, gdb.cp/no-dmgl-verbose.exp Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220506081029.x5ztruwtnhvir33n@octopus \
    --to=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox