summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/maint.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/maint.exp')
-rw-r--r--gdb/testsuite/gdb.base/maint.exp43
1 files changed, 42 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index b1f7c53f28d..4c64b973563 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -31,6 +31,7 @@
#maintenance dump-me -- Get fatal error; make debugger dump its core
#maintenance print -- Maintenance command for printing GDB internal state
#maintenance info -- Commands for showing internal info about the program being debugged
+#maintenance internal-error -- Give GDB an internal error.
#
#maintenance print statistics -- Print statistics about internal gdb state
#maintenance print objfiles -- Print dump of current object file definitions
@@ -442,7 +443,7 @@ set timeout $oldtimeout
send_gdb "help maint\n"
gdb_expect {
- -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*maintenance dump-me.*maintenance info.*maintenance internal-error.*maintenance print.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
{ pass "help maint" }
-re ".*$gdb_prompt $" { fail "help maint" }
timeout { fail "(timeout) help maint" }
@@ -489,6 +490,14 @@ gdb_expect {
timeout { fail "(timeout) help maint dump-me" }
}
+send_gdb "help maint internal-error\n"
+gdb_expect {
+ -re "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*$gdb_prompt $"\
+ { pass "help maint internal-error" }
+ -re ".*$gdb_prompt $" { fail "help maint internal-error" }
+ timeout { fail "(timeout) help maint internal-error" }
+ }
+
send_gdb "help maint print statistics\n"
gdb_expect {
-re "Print statistics about internal gdb state\\..*$gdb_prompt $"\
@@ -612,6 +621,38 @@ gdb_expect {
timeout { fail "(timeout) maint dump-me" }
}
+send_gdb "maint internal-error\n"
+gdb_expect {
+ -re "Continue this debugging session.*\\(y or n\\) $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Create a core file.*\\(y or n\\) $" {
+ send_gdb "n\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ pass "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+}
+
#set timeout $oldtimeout