diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59db3402186..3cf2cf10bf9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2020-07-10 Pedro Alves + + * frame-tailcall.c (dwarf2_tailcall_sniffer_first): Only swallow + NO_ENTRY_VALUE_ERROR / MEMORY_ERROR / OPTIMIZED_OUT_ERROR / + NOT_AVAILABLE_ERROR. + * value.c (value_optimized_out): Only swallow MEMORY_ERROR / + OPTIMIZED_OUT_ERROR / NOT_AVAILABLE_ERROR. + 2020-07-10 Simon Marchi Pedro Alves diff --git a/gdb/dwarf2/frame-tailcall.c b/gdb/dwarf2/frame-tailcall.c index 2d219f13f9d..7ea6daca25b 100644 --- a/gdb/dwarf2/frame-tailcall.c +++ b/gdb/dwarf2/frame-tailcall.c @@ -377,7 +377,6 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame, get_frame_address_in_block will decrease it by 1 in such case. */ this_pc = get_frame_address_in_block (this_frame); - /* Catch any unwinding errors. */ try { int sp_regnum; @@ -404,7 +403,22 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame, { if (entry_values_debug) exception_print (gdb_stdout, except); - return; + + switch (except.error) + { + case NO_ENTRY_VALUE_ERROR: + /* Thrown by call_site_find_chain. */ + case MEMORY_ERROR: + case OPTIMIZED_OUT_ERROR: + case NOT_AVAILABLE_ERROR: + /* These can normally happen when we try to access an + optimized out or unavailable register, either in a + physical register or spilled to memory. */ + return; + } + + /* Let unexpected errors propagate. */ + throw; } /* Ambiguous unwind or unambiguous unwind verified as matching. */ diff --git a/gdb/value.c b/gdb/value.c index 97a099ddbd3..00d8ded2ae0 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1412,7 +1412,18 @@ value_optimized_out (struct value *value) } catch (const gdb_exception_error &ex) { - /* Fall back to checking value->optimized_out. */ + switch (ex.error) + { + case MEMORY_ERROR: + case OPTIMIZED_OUT_ERROR: + case NOT_AVAILABLE_ERROR: + /* These can normally happen when we try to access an + optimized out or unavailable register, either in a + physical register or spilled to memory. */ + break; + default: + throw; + } } }