[PATCH 3/3] gdb/record: minor clean, remove some unneeded arguments
Eli Zaretskii
eliz@gnu.org
Mon Apr 15 14:41:11 GMT 2024
> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Mon, 15 Apr 2024 15:19:28 +0100
>
> I spotted that the two functions:
>
> record_full_open_1
> record_full_core_open_1
>
> both took two arguments, neither of which are used.
>
> I stumbled onto this while reviewing how filename_completer is used.
> The 'record full restore' command uses filename_completer and invokes
> the cmd_record_full_restore function.
>
> The cmd_record_full_restore function calls core_file_command and then
> record_full_open, which then calls one of the above functions.
>
> As 'record full restore' takes a filename, this is passed to
> cmd_record_full_restore, which forwards the filename to both
> core_file_command and record_full_open. However, record_full_open
> never actually uses the filename that is passed in.
>
> The record_full_open function is also used for 'target record-full'.
>
> I propose that record_full_open should no longer expect to see any
> user supplied arguments passed in (it doesn't use any). In fact, I've
> added a check that if we do get any user supplied arguments we'll
> throw an error.
>
> Now that we know record_full_open isn't being passed any user
> arguments we can stop passing the arguments to record_full_open_1 and
> record_full_core_open_1, this will make no user visible difference as
> these arguments were not used.
>
> It is possible that a user was previously doing:
>
> (gdb) target record-full blah blah blah
>
> And this previously would work fine, the 'blah blah blah' was
> ignored. Now this will give an error. Other than this case there
> should be no user visible changes after this commit.
> ---
> gdb/NEWS | 4 ++++
> gdb/record-full.c | 15 +++++++-----
> gdb/testsuite/gdb.base/record-full-error.exp | 24 ++++++++++++++++++++
> 3 files changed, 37 insertions(+), 6 deletions(-)
> create mode 100644 gdb/testsuite/gdb.base/record-full-error.exp
OK for the NEWS part, thanks.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
More information about the Gdb-patches
mailing list