From: Keith Seitz <keiths@redhat.com>
To: Pedro Alves <pedro@palves.net>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] Always pass an explicit language down to c_type_print
Date: Thu, 5 May 2022 13:47:48 -0700 [thread overview]
Message-ID: <e63c839c-3f9e-c056-928e-e02a84751114@redhat.com> (raw)
In-Reply-To: <20220505185020.3648774-3-pedro@palves.net>
On 5/5/22 11:50, Pedro Alves wrote:
> In gnuv3_print_method_ptr, I wasn't sure whether we could hardcode C++
> here, and we don't have an enum language handy, so I made it use the
> current language, just like today. Can always be improved later.
I like this philosophy. :-)
I just have one comment for you to double-check. Otherwise, I also
encourage you to approve your patch.
Keith
> Change-Id: Ib54fab4cf0fd307bfd55bf1dd5056830096a653b
> ---
> gdb/ada-typeprint.c | 2 +-
> gdb/c-exp.y | 1 +
> gdb/c-lang.c | 8 ++++----
> gdb/c-lang.h | 17 +++++++++--------
> gdb/c-typeprint.c | 25 +++++--------------------
> gdb/d-lang.c | 2 +-
> gdb/gnu-v3-abi.c | 3 ++-
> gdb/go-typeprint.c | 2 +-
> gdb/objc-lang.c | 2 +-
> gdb/opencl-lang.c | 2 +-
> gdb/rust-lang.c | 5 +++--
> 11 files changed, 29 insertions(+), 40 deletions(-)
>
> diff --git a/gdb/c-lang.h b/gdb/c-lang.h
> index 46e562df055..c81c3bbc3b8 100644
> --- a/gdb/c-lang.h
> +++ b/gdb/c-lang.h
> @@ -65,16 +65,17 @@ extern int c_parse (struct parser_state *);
> extern int c_parse_escape (const char **, struct obstack *);
>
> /* Defined in c-typeprint.c */
> -extern void c_print_type (struct type *, const char *,
> - struct ui_file *, int, int,
> - const struct type_print_options *);
>
> -/* Print a type but allow the precise language to be specified. */
> +/* LEVEL is the depth to indent lines by. Allows the precise language
> + to be specified, because many languages defer to C type
> + printing. */
The actual description of the function (if brief) has been removed. The new
comment explains the LEVEL argument, but the decl only contains types. A
casual reader (like myself) would have to go figure out to which argument this
refers.
I have to ask: Is this what you intended? It seems like a cut-n-paste
error?
> -extern void c_print_type (struct type *, const char *,
> - struct ui_file *, int, int,
> - enum language,
> - const struct type_print_options *);
> +extern void c_print_type (struct type *type,
> + const char *varstring,
> + struct ui_file *stream,
> + int show, int level,
> + enum language language,
> + const struct type_print_options *flags);
>
> extern void c_print_typedef (struct type *,
> struct symbol *,
next prev parent reply other threads:[~2022-05-05 20:47 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
2022-05-05 21:49 ` Carl Love
2022-05-06 13:21 ` Pedro Alves
2022-05-06 8:10 ` Lancelot SIX
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 [this message]
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
2022-05-06 8:34 ` Lancelot SIX
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=e63c839c-3f9e-c056-928e-e02a84751114@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).