diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdbserver-support.exp | 26 |
2 files changed, 22 insertions, 9 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index fbb8bc8..55aeecc 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-04-13 Yao Qi <yao.qi@linaro.org> + + * lib/gdbserver-support.exp (gdb_exit): Catch exception + and use expect instead of gdb_expect. + 2015-04-13 Sergio Durigan Junior <sergiodj@redhat.com> * gdb.base/coredump-filter.exp: Rename variable "addr" to diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 53843b8..b3140c2 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -353,15 +353,23 @@ proc gdb_exit {} { global gdb_prompt if {[info exists gdb_spawn_id] && [info exists server_spawn_id]} { - send_gdb "monitor exit\n"; - gdb_expect { - -re "$gdb_prompt $" { - exp_continue - } - -i "$server_spawn_id" eof { - wait -i $expect_out(spawn_id) - unset server_spawn_id - unset inferior_spawn_id + # GDB may be terminated in an expected way or an unexpected way, + # but DejaGNU doesn't know that, so gdb_spawn_id isn't unset. + # Catch the exceptions. + catch { + send_gdb "monitor exit\n"; + # We use expect rather than gdb_expect because + # we want to suppress printing exception messages, otherwise, + # remote_expect, invoked by gdb_expect, prints the exceptions. + expect { + -i "$gdb_spawn_id" -re "$gdb_prompt $" { + exp_continue + } + -i "$server_spawn_id" eof { + wait -i $expect_out(spawn_id) + unset server_spawn_id + unset inferior_spawn_id + } } } } |