aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/interp.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-12-09 19:23:49 +0000
committerTom Tromey <tromey@redhat.com>2010-12-09 19:23:49 +0000
commit305aeedc41771066e7283a798b108c95b027997e (patch)
treed70f4243ed04ef7a18ff2553a8b93c98ea200c20 /gdb/testsuite/gdb.base/interp.exp
parent90ecf1736cbde5d0ca94914e52a765d3ca01e5f5 (diff)
downloadgdb-305aeedc41771066e7283a798b108c95b027997e.zip
gdb-305aeedc41771066e7283a798b108c95b027997e.tar.gz
gdb-305aeedc41771066e7283a798b108c95b027997e.tar.bz2
gdb
* mi/mi-parse.h (mi_parse): Update. * mi/mi-parse.c (mi_parse_cleanup): New function. (mi_parse): Add 'token' argument. Throw exception on error. * mi/mi-main.c (mi_print_exception): New function. (mi_execute_command): Use mi_print_exception. Catch exceptions from mi_parse. gdb/testsuite * gdb.base/interp.exp: Add regression test.
Diffstat (limited to 'gdb/testsuite/gdb.base/interp.exp')
-rw-r--r--gdb/testsuite/gdb.base/interp.exp11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index ece2552..a923f1a 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -33,4 +33,15 @@ gdb_test_multiple $cmd $cmd {
}
gdb_test "interpreter-exec console \"show version\"" "GNU gdb .*"
+# Regression test for crash when an exception occurs in mi_parse.
+gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
+ "regression test for mi_parse crash" {
+ -re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
+ pass "$cmd"
+ gdb_expect 1 {
+ -re "\r\n$gdb_prompt $" { }
+ }
+ }
+ }
+
gdb_exit