diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7b4c5b436b..947bed40a3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-02-14 Pedro Alves + + * frame-unwind.c (frame_unwind_try_unwinder): Always call + frame_cleanup_after_sniffer on exception. + 2018-02-14 Tom Tromey * solist.h (struct target_so_ops) : Make pathname diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index 66a28ae1c9..e6e63539ad 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -110,13 +110,14 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache, /* Catch all exceptions, caused by either interrupt or error. Reset *THIS_CACHE. */ *this_cache = NULL; + frame_cleanup_after_sniffer (this_frame); + if (ex.error == NOT_AVAILABLE_ERROR) { /* This usually means that not even the PC is available, thus most unwinders aren't able to determine if they're the best fit. Keep trying. Fallback prologue unwinders should always accept the frame. */ - frame_cleanup_after_sniffer (this_frame); return 0; } throw_exception (ex); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1a4337cde6..8bcb50ea89 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-14 Pedro Alves + + * gdb.base/bp-cmds-continue-ctrl-c.exp (do_test): Test "bt" after + getting a "Quit". + 2018-02-09 Markus Metzger * lib/gdb.exp (skip_btrace_pt_tests): Update expected error message. diff --git a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp index 8c2fa77d71..43600fcf81 100644 --- a/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp +++ b/gdb/testsuite/gdb.base/bp-cmds-continue-ctrl-c.exp @@ -89,6 +89,19 @@ proc do_test {} { } -re "Quit\r\n$gdb_prompt $" { send_log "$internal_pass (Quit)\n" + + # Check that if we managed to quit somewhere deep in + # the unwinders, we can still unwind again. + set ok 0 + gdb_test_multiple "bt" "$internal_pass (bt)" { + -re "#0.*$gdb_prompt $" { + send_log "$internal_pass (bt)\n" + set ok 1 + } + } + if {!$ok} { + return + } } -re "Quit\r\n\r\nCommand aborted.\r\n$gdb_prompt $" { send_log "$internal_pass (Command aborted)\n"