old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker 0c92d8c1c3 DWARF frame unwinder executes one too many rows
The problem is trying to unwind from a function where %ebp is NOT
used as the frame pointer, and the size of the frame changes over
the lifetime of that function.

For instance, trying to unwind past the GNAT runtime function
called system.tasking.rendezvous.timed_selective_wait on x86-linux,
one can get:

    (gdb) bt
    [...]
    #3  0x0805364b in system.tasking.rendezvous.timed_selective_wait ()
    #4  0xb7fe5068 in ?? ()
    Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Looking at the CFI, we find the following initial instructions...

>   DW_CFA_def_cfa: %esp+4 (r4 ofs 4)
>   DW_CFA_offset: %eip at cfa-4  (r8 = %eip)

... and the associated FDE:

> 00001be4 00000054 00001be8 FDE cie=00000000 pc=08053310..08053951
[...]
>   DW_CFA_advance_loc: 8 to 080534ad
>   DW_CFA_def_cfa_offset: 112
>   DW_CFA_advance_loc2: 414 to 0805364b
>   DW_CFA_def_cfa_offset: 108
[...]

The problem is that the DWARF frame unwinder executed the FDE until
the row for PC == 0x0805364b. But in reality, our program hasn't
executed the instruction at that address yet (it is the return address).
So GDB executed a little too much of the FDE, giving us the wrong
offset for the frame base, and thus the wrong address where %eip
got saved.

This patch fixes the problem by using a more correct PC as the bound
for executing the FDE.

gdb/ChangeLog:

        * dwarf2-frame.c (dwarf2_frame_cache): Use
        get_frame_address_in_block instead of get_frame_pc as
        the bound for executing the frame's FDE.

gdb/testsuite/ChangeLog:

        * gdb.ada/rdv_wait: New testcase.
2012-08-16 15:45:46 +00:00
..
aliased_array [Ada] Handle reference to array descriptors 2012-02-29 19:33:02 +00:00
array_bounds Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
array_return Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
array_subscript_addr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
arrayidx Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
arrayparam Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
arrayptr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
atomic_enum Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
bad-task-bp-keyword stop parsing breakpoint command if invalid keyword found 2012-06-05 13:50:13 +00:00
bp_enum_homonym New Ada testcase (bp_enum_homonym). 2012-03-06 17:04:59 +00:00
bp_on_var New Ada testcase (bp_on_var.exp). 2012-03-06 17:33:32 +00:00
bp_range_type testcase for "gdb-ax.c: Add handling of TYPE_CODE_RANGE types" 2012-03-14 01:38:51 +00:00
call_pn Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
catch_ex Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
char_enum Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
char_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
complete Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
cond_lang Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
dyn_loc Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
enum_idx_packed [Ada] print packed arrays indexed by enumerated type 2012-02-29 19:34:40 +00:00
exec_changed Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
exprs Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fixed_cmp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fixed_points Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
formatted_ref Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
frame_args Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fullname_bp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fun_addr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
fun_in_declare Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
funcall_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
homonym Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
info_locals_renaming Testcase: "info locals" with Ada renamings. 2012-03-02 19:31:53 +00:00
int_deref Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
interface Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
lang_switch Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mi_catch_ex Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mi_task_arg GDB/MI: crash printing "_task" (Ada) argument 2012-02-03 07:32:40 +00:00
mi_task_info Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
mod_from_name Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
nested Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
null_array Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
null_record Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
operator_bp New Ada testcase for breakpoints on operators. 2012-03-02 20:36:41 +00:00
packed_array Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
packed_tagged 2012-07-04 Pedro Alves <palves@redhat.com> 2012-07-04 10:48:32 +00:00
print_chars Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptr_typedef Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptype_field Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ptype_tagged_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
rdv_wait DWARF frame unwinder executes one too many rows 2012-08-16 15:45:46 +00:00
rec_return Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ref_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
ref_tick_size Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
same_enum Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
set_pckd_arr_elt [Ada] Crash when trying to set value of packed array element 2012-03-16 17:55:45 +00:00
small_reg_param Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
start Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
str_ref_cmp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
sym_print_name Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
taft_type Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tagged Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tagged_not_init [Ada] avoid error message pollution with uninitialized tagged variable 2012-02-29 19:46:48 +00:00
task_bp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tasks Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
tick_last_segv Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
type_coercion Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
uninitialized_vars Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
variant_record_packed_array Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
watch_arg Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
whatis_array_val [Ada] whatis not printing array type name for value from history 2012-02-29 19:29:12 +00:00
widewide Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
aliased_array.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
array_bounds.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
array_return.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
array_subscript_addr.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
arrayidx.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
arrayparam.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
arrayptr.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
assign_1.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
atomic_enum.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
bad-task-bp-keyword.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
boolean_expr.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
bp_enum_homonym.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
bp_on_var.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
bp_range_type.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
call_pn.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
catch_ex.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
char_enum.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
char_param.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
complete.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
cond_lang.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
dyn_loc.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
enum_idx_packed.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
exec_changed.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
exprs.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
fixed_cmp.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
fixed_points.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
formatted_ref.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
frame_args.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
fullname_bp.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
fun_addr.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
fun_in_declare.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
funcall_param.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
gnat_ada.gpr Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
homonym.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
info_locals_renaming.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
info_types.c Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
info_types.exp Copyright year update in most files of the GDB Project. 2012-01-04 08:17:56 +00:00
int_deref.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
interface.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
lang_switch.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
mi_catch_ex.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
mi_task_arg.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
mi_task_info.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
mod_from_name.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
nested.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
null_array.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
null_record.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
operator_bp.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
packed_array.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
packed_tagged.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
print_chars.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
print_pc.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
ptr_typedef.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
ptype_arith_binop.exp 2012-01-16 Pedro Alves <palves@redhat.com> 2012-01-16 16:21:53 +00:00
ptype_field.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
ptype_tagged_param.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
rdv_wait.exp DWARF frame unwinder executes one too many rows 2012-08-16 15:45:46 +00:00
rec_return.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
ref_param.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
ref_tick_size.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
same_enum.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
set_pckd_arr_elt.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
small_reg_param.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
start.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
str_ref_cmp.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
sym_print_name.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
taft_type.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
tagged.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
tagged_not_init.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
task_bp.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
tasks.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
tick_last_segv.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
type_coercion.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
uninitialized_vars.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
variant_record_packed_array.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
watch_arg.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
whatis_array_val.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00
widewide.exp * lib/ada.exp (standard_ada_testfile): New proc. 2012-07-26 18:43:02 +00:00