From: Keith Seitz <keiths@redhat.com>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] gdb/record: minor clean, remove some unneeded arguments
Date: Tue, 16 Apr 2024 07:12:06 -0700 [thread overview]
Message-ID: <1f14b822-2781-422e-8233-34eb894ea5c6@redhat.com> (raw)
In-Reply-To: <4f18fd17db2a5c6f39fa8b8587e3a5fe8fe75379.1713190701.git.aburgess@redhat.com>
On 4/15/24 07:19, Andrew Burgess wrote:
> I spotted that the two functions:
>
> record_full_open_1
> record_full_core_open_1
>
> both took two arguments, neither of which are used.
Nice catch. I've looked over this series, and I just have one really
trivial -- if not silly -- comment.
> diff --git a/gdb/record-full.c b/gdb/record-full.c
> index 4c3667f48ba..4ef85b0cdb6 100644
> --- a/gdb/record-full.c
> +++ b/gdb/record-full.c
> @@ -957,11 +957,14 @@ static void record_full_init_record_breakpoints (void);
> /* Open the process record target. */
>
> static void
> -record_full_open (const char *name, int from_tty)
> +record_full_open (const char *args, int from_tty)
> {
> if (record_debug)
> gdb_printf (gdb_stdlog, "Process record: record_full_open\n");
>
> + if (args != nullptr)
> + error (_("trailing junk: '%s'"), args);
> +
> record_preopen ();
>
> /* Reset */
While I am no fan of this type of error, I understand the motive
in terms of consistency. Grep'ping for this string in gdb gives
numerous wordings of this type of error:
ada-lang.c: error (_("Junk at end of expression"));
ada-lang.c: error (_("Junk at end of arguments."));
break-catch-exec.c: error (_("Junk at end of arguments."));
break-catch-fork.c: error (_("Junk at end of arguments."));
break-catch-throw.c: error (_("Junk at end of arguments."));
breakpoint.c: error (_("Junk at end of expression"));
breakpoint.c: error (_("Junk at end of expression"));
breakpoint.c: error (_("Junk after thread keyword."));
breakpoint.c: error (_("Junk after inferior keyword."));
breakpoint.c: error (_("Junk after task keyword."));
breakpoint.c: error (_("Junk at end of arguments."));
breakpoint.c: error (_("Junk after thread keyword."));
breakpoint.c: error (_("Junk after task keyword."));
breakpoint.c: error (_("Junk at end of command."));
breakpoint.c: error (_("Junk at end of arguments."));
breakpoint.c: error (_("Junk at end of arguments."));
btrace.c: error (_("Junk after argument: %s."), arg);
linespec.c: error (_("Junk at end of line specification: %s"), string);
linespec.c: error (_("Junk at end of line specification: %s"), string);
parse.c: error (_("Junk after end of expression."));
psymtab.c: error (_("Junk at end of command"));
record-btrace.c: error (_("Trailing junk: '%s'."), args);
record-btrace.c: error (_("Trailing junk: '%s'."), args);
record-btrace.c: error (_("Trailing junk: '%s'."), args + l2);
record-btrace.c: error (_("Trailing junk: '%s'."), args + l1);
record-btrace.c: error (_("Trailing junk: '%s'."), args);
record.c: error (_("Junk after argument: %s."), arg);
record.c: error (_("Junk after argument: %s."), arg);
record.c: error (_("Junk after argument: %s."), arg);
symfile.c: error (_("Junk after %s"), argv[1]);
symfile.c: error (_("Junk after %s"), argv[0]);
symmisc.c: error (_("Junk at end of command"));
symmisc.c: error (_("Junk at end of command"));
So i guess as far as the record feature goes, the error message should
at least be "Trailing junk: %s". [Yeah, that is one heck of a silly nit,
isn't it?]
Otherwise, LGTM.
Keith
next prev parent reply other threads:[~2024-04-16 14:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 14:19 [PATCH 0/3] Small cleanups in gdb/record*.c code Andrew Burgess
2024-04-15 14:19 ` [PATCH 1/3] gdb/record: remove unnecessary use of filename_completer Andrew Burgess
2024-04-15 14:19 ` [PATCH 2/3] gdb/record: add an assert in cmd_record_start Andrew Burgess
2024-04-15 14:19 ` [PATCH 3/3] gdb/record: minor clean, remove some unneeded arguments Andrew Burgess
2024-04-15 14:41 ` Eli Zaretskii
2024-04-16 14:12 ` Keith Seitz [this message]
2024-04-16 17:18 ` [PATCH 0/3] Small cleanups in gdb/record*.c code Tom Tromey
2024-04-17 13:48 ` Andrew Burgess
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=1f14b822-2781-422e-8233-34eb894ea5c6@redhat.com \
--to=keiths@redhat.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/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).