binutils-gdb/gdb/testsuite/gdb.ada
Joel Brobecker 2fa15f237d crash printing optimized out variant type
Assuming the following declarations:

   type Discriminants_Record (A : Integer; B : Boolean) is record
      C : Float;
   end record;
   Z : Discriminants_Record := (A => 1, B => False, C => 2.0);

If variable Z is not used, and the compiler optimizes it out,
GDB would crash as follow:

    (gdb) print Z
    /[...]/gdb/valops.c:1121: internal-error: Unexpected lazy value type.

This is because the ada-lang module forgot to set the optimized_out
flag in the value returned by ada_evaluate_subexp during the value's
"fixing" process.  Later on, when trying to print the resulting value,
GDB finds that the value is still lazily allocated, and thus tries to
fetch it. But this is not allowed for not_lval values, hence the internal
error.

gdb/ChangeLog:

        * ada-lang.c (coerce_unspec_val_to_type): Make sure that
        the optimized_out flag is preserved.

gdb/testsuite/ChangeLog:

        * gdb.ada/optim_drec: New testcase.
2012-09-10 22:18:24 +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
optim_drec crash printing optimized out variant type 2012-09-10 22:18:24 +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
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +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
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
optim_drec.exp crash printing optimized out variant type 2012-09-10 22:18:24 +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 gdb/testsuite/ 2012-08-27 16:34:35 +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