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
array_bounds
array_return
array_subscript_addr
arrayidx
arrayparam
arrayptr
atomic_enum
bad-task-bp-keyword stop parsing breakpoint command if invalid keyword found 2012-06-05 13:50:13 +00:00
bp_enum_homonym
bp_on_var
bp_range_type
call_pn
catch_ex
char_enum
char_param
complete
cond_lang
dyn_loc
enum_idx_packed
exec_changed
exprs
fixed_cmp
fixed_points
formatted_ref
frame_args
fullname_bp
fun_addr
fun_in_declare
funcall_param
homonym
info_locals_renaming
int_deref
interface
lang_switch
mi_catch_ex
mi_task_arg
mi_task_info
mod_from_name
nested
null_array
null_record
operator_bp
optim_drec crash printing optimized out variant type 2012-09-10 22:18:24 +00:00
packed_array
packed_tagged 2012-07-04 Pedro Alves <palves@redhat.com> 2012-07-04 10:48:32 +00:00
print_chars
ptr_typedef
ptype_field
ptype_tagged_param
rdv_wait DWARF frame unwinder executes one too many rows 2012-08-16 15:45:46 +00:00
rec_return
ref_param
ref_tick_size
same_enum
set_pckd_arr_elt
small_reg_param
start
str_ref_cmp
sym_print_name
taft_type
tagged
tagged_not_init
task_bp
tasks
tick_last_segv
type_coercion
uninitialized_vars
variant_record_packed_array
watch_arg
whatis_array_val
widewide
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
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
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
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
info_types.exp
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
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
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