aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/maint.exp
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2017-02-15 15:08:19 -0500
committerSergio Durigan Junior <sergiodj@redhat.com>2017-02-15 19:54:10 -0500
commit99e8a4f9f8832da0f37c6f35b11629b01897800d (patch)
tree12022285005f70e99ea6f704124ca84388d15262 /gdb/testsuite/gdb.base/maint.exp
parenteb721b5a6b458efe68cb56c75945f0f6e79b1cf6 (diff)
downloadgdb-99e8a4f9f8832da0f37c6f35b11629b01897800d.zip
gdb-99e8a4f9f8832da0f37c6f35b11629b01897800d.tar.gz
gdb-99e8a4f9f8832da0f37c6f35b11629b01897800d.tar.bz2
PR gdb/21164: maint print {symbols,msymbols,psymbols} without args crash
This is a fix for PR gdb/21164. The problem started to happen after: commit 34c41c681f4a0a0dfe0405c7d2aecf458520557a Author: Doug Evans <xdje42@gmail.com> AuthorDate: Mon Dec 19 08:33:46 2016 -0800 New syntax for mt print symbols,msymbols,psymbols. This change introduced new syntax for the mentioned commands, and improved the parsing of arguments by using 'gdb_buildargv'. However, it is necessary to check if the argv being built is not NULL, which can happen if the user doesn't provide any arguments to these commands. gdb/ChangeLog: 2017-02-15 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21164 * psymtab.c (maintenance_print_psymbols): Verify if 'argv' is not NULL before using it. * symmisc.c (maintenance_print_symbols): Likewise. (maintenance_print_msymbols): Likewise. gdb/testsuite/ChangeLog: gdb/ChangeLog: 2017-02-15 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21164 * gdb.base/maint.exp: Add testcases for when the commands do not have arguments.
Diffstat (limited to 'gdb/testsuite/gdb.base/maint.exp')
-rw-r--r--gdb/testsuite/gdb.base/maint.exp7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 2853508..782a21c 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -561,6 +561,13 @@ gdb_expect {
#set timeout $oldtimeout
+# Test that the commands work without an argument. For this test, we
+# don't need an inferior loaded/running. See PR gdb/21164.
+gdb_exit
+gdb_start
+gdb_test_no_output "maint print symbols"
+gdb_test_no_output "maint print msymbols"
+gdb_test_no_output "maint print psymbols"
gdb_exit
return 0