aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/cli/cli-cmds.c3
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/with.exp2
4 files changed, 13 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 01e60fb..966bfb7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2019-08-21 Bogdan Harjoc <harjoc@gmail.com>
+
+ * cli/cli-cmds.c (with_command_1): Error out if no arguments.
+
2019-08-21 Christian Biesinger <cbiesinger@google.com>
* tui/tui-data.h (tui_gen_win_info): Add an =default
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 30e0958..4fc6567 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -217,6 +217,9 @@ void
with_command_1 (const char *set_cmd_prefix,
cmd_list_element *setlist, const char *args, int from_tty)
{
+ if (args == nullptr)
+ error (_("Missing arguments."));
+
const char *delim = strstr (args, "--");
const char *nested_cmd = nullptr;
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7fea9cd..e56cc16 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-08-21 Pedro Alves <palves@redhat.com>
+
+ * gdb.base/with.exp: Test "with" with no arguments.
+
2019-08-21 Tom de Vries <tdevries@suse.de>
* gdb.base/gdb-caching-proc.exp: Sort files.
diff --git a/gdb/testsuite/gdb.base/with.exp b/gdb/testsuite/gdb.base/with.exp
index 9ea7685..a972296 100644
--- a/gdb/testsuite/gdb.base/with.exp
+++ b/gdb/testsuite/gdb.base/with.exp
@@ -220,6 +220,8 @@ with_test_prefix "run control" {
# Check errors.
with_test_prefix "errors" {
+ gdb_test "with" "Missing arguments\\."
+
# Try both an unknown root setting and an unknown prefixed
# setting. The errors come from different locations in the
# sources.