summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/macscp.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-08-14 18:03:22 +0000
committerTom Tromey <tromey@redhat.com>2008-08-14 18:03:22 +0000
commit886a217cf4ad31024cf799bf2803c39c07ad1d15 (patch)
tree2b9e71f2c415f3ba8b8ea95c6acab8064bc6bd7c /gdb/testsuite/gdb.base/macscp.exp
parent4e96a12e094223793435f3b27e99649a3dc26f70 (diff)
downloadbinutils-gdb-886a217cf4ad31024cf799bf2803c39c07ad1d15.tar.gz
gdb:
* macrocmd.c (macro_define_command): Check for NULL argument. (macro_undef_command): Likewise. gdb/testsuite: * gdb.base/macscp.exp: Add regression test for "macro define" or "macro undef" with no arguments.
Diffstat (limited to 'gdb/testsuite/gdb.base/macscp.exp')
-rw-r--r--gdb/testsuite/gdb.base/macscp.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
index 2df0eef3d3c..3424714adde 100644
--- a/gdb/testsuite/gdb.base/macscp.exp
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -470,6 +470,16 @@ gdb_test "print M" \
"No symbol \"M\" in current context\." \
"print expression with macro after user undef."
+# Regression test; this used to crash.
+gdb_test "macro define" \
+ "usage: macro define.*" \
+ "macro define with no arguments"
+
+# Regression test; this used to crash.
+gdb_test "macro undef" \
+ "usage: macro undef.*" \
+ "macro undef with no arguments"
+
# Regression test; this used to emit the wrong error.
gdb_test "macro expand SPLICE(x, y)" \
"Token splicing is not implemented yet." \