From: Yao Qi <qiyaoltc@gmail.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 3/3] Move logic out of symbol_find_demangled_name
Date: Mon, 06 Jun 2016 14:15:00 -0000 [thread overview]
Message-ID: <86mvmywgj1.fsf@gmail.com> (raw)
In-Reply-To: <1465051760-25840-4-git-send-email-tom@tromey.com> (Tom Tromey's message of "Sat, 4 Jun 2016 08:49:20 -0600")
Tom Tromey <tom@tromey.com> writes:
> I'm not especially fond of the new name, "la_demangle_for_symbol".
>
How about "la_sniff_by_symbol"? IMO, symbol_find_demangled_name does
two things, set the language of symbol, and get the demangled name.
It is quite similar to frame unwinder sniffer and frame unwinding.
> --- a/gdb/language.h
> +++ b/gdb/language.h
> @@ -292,6 +292,19 @@ struct language_defn
> /* Return demangled language symbol, or NULL. */
> char *(*la_demangle) (const char *mangled, int options);
>
> + /* Demangle a symbol according to this language's rules. Unlike
> + la_demangle, this does not take any options. The return value
> + should either be NULL if the name cannot be demangled, or an
> + xmalloc'd string, to be owned by the caller.
> +
> + If this function returns non-NULL, then it can be assumed that
> + MANGLED represents a mangled symbol for this language. If this
> + function returns NULL, then normally the converse is true, but
> + RECOGNIZED can be set to 1 to override this.
> +
> + RECOGNIZED must be initialized to 0 by the caller. */
> + char *(*la_demangle_for_symbol) (const char *mangled, int *recognized);
Why don't we return int to indicate the name can be demangled or not and
put the demangled name in the second parameter if it can be?
--
Yao (齐尧)
next prev parent reply other threads:[~2016-06-06 14:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-04 14:49 [RFA 0/3] minor language cleanups Tom Tromey
2016-06-04 14:49 ` [RFA 3/3] Move logic out of symbol_find_demangled_name Tom Tromey
2016-06-06 14:15 ` Yao Qi [this message]
2016-06-07 11:41 ` Tom Tromey
2016-06-07 14:27 ` Pedro Alves
2016-06-07 15:12 ` Tom Tromey
2016-06-13 13:35 ` Pedro Alves
2016-06-17 8:28 ` Tom Tromey
2016-06-17 12:25 ` Pedro Alves
2016-06-17 12:36 ` Tom Tromey
2016-06-17 13:50 ` Pedro Alves
2016-06-24 3:15 ` Tom Tromey
2016-06-07 14:03 ` Pedro Alves
2016-06-08 2:14 ` Tom Tromey
2016-06-08 4:03 ` Tom Tromey
2016-06-13 13:35 ` Pedro Alves
2016-06-17 8:41 ` Tom Tromey
2016-06-17 12:28 ` Pedro Alves
2016-06-04 14:49 ` [RFA 2/3] Move filename extensions into language_defn Tom Tromey
2016-06-06 13:23 ` Yao Qi
2016-06-06 21:04 ` Tom Tromey
2016-06-07 15:51 ` Yao Qi
2016-06-04 14:49 ` [RFA 1/3] Use VEC for filename_language_table Tom Tromey
2016-06-06 13:06 ` Yao Qi
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=86mvmywgj1.fsf@gmail.com \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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