/* Open the process record target for 'core' files. */
static void
-record_full_core_open_1 (const char *name, int from_tty)
+record_full_core_open_1 ()
{
regcache *regcache = get_thread_regcache (inferior_thread ());
int regnum = gdbarch_num_regs (regcache->arch ());
/* Open the process record target for 'live' processes. */
static void
-record_full_open_1 (const char *name, int from_tty)
+record_full_open_1 ()
{
if (record_debug)
gdb_printf (gdb_stdlog, "Process record: record_full_open_1\n");
/* 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 */
record_full_list->next = NULL;
if (current_program_space->core_bfd ())
- record_full_core_open_1 (name, from_tty);
+ record_full_core_open_1 ();
else
- record_full_open_1 (name, from_tty);
+ record_full_open_1 ();
/* Register extra event sources in the event loop. */
record_full_async_inferior_event_token
cmd_record_full_restore (const char *args, int from_tty)
{
core_file_command (args, from_tty);
- record_full_open (args, from_tty);
+ record_full_open (nullptr, from_tty);
}
/* Save the execution log to a file. We use a modified elf corefile
--- /dev/null
+# This testcase is part of GDB, the GNU debugger.
+#
+# Copyright 2024 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check an error when passing unexpected arguments to 'target
+# record-full'.
+
+gdb_start
+
+gdb_test "target record-full blah" \
+ "Trailing junk: 'blah'"