old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker 8e355c5d24 Ada: Fix missing call to pretty-printer for fields of records.
Consider the following types:

   type Time_T is record
      Secs : Integer;
   end record;
   Before : Time_T := (Secs => 1384395743);

In this example, we assume that type Time_T is the number of seconds
since Epoch, and so added a Python pretty-printer, to print this
type in a more human-friendly way. For instance:

    (gdb) print before
    $1 = Thu Nov 14 02:22:23 2013 (1384395743)

However, we've noticed that things stop working when this type is
embedded inside another record, and we try to print that record.
For instance, with the following declarations:

   type Composite is record
      Id : Integer;
      T : Time_T;
   end record;
   Afternoon : Composite := (Id => 1, T => (Secs => 1384395865));

    (gdb) print afternoon
    $2 = (id => 1, t => (secs => 1384395865))

We expected instead:

    (gdb) print afternoon
    $2 = (id => 1, t => Thu Nov 14 02:24:25 2013 (1384395865))

This patch fixes the problem by making sure that we try to print
each field via a call to val_print, rather than calling ada_val_print
directly. We need to go through val_print, as the val_print
handles all language-independent features such as calling the
pretty-printer, knowing that ada_val_print will get called eventually
if actual Ada-specific printing is required (which should be the
most common scenario).

And because val_print takes the language as parameter, we enhanced
the print_field_values and print_variant_part to also take a language.
As a bonus, this allows us to remove a couple of references to
current_language.

gdb/ChangeLog:

        * ada-valprint.c (print_field_values): Add "language" parameter.
        Update calls to print_field_values and print_variant_part.
        Pass new parameter "language" in call to val_print instead
        of "current_language".  Replace call to ada_val_print by call
        to val_print.
        (print_variant_part): Add "language" parameter.
        (ada_val_print_struct_union): Update call to print_field_values.

gdb/testsuite/ChangeLog:

        * gdb.ada/pp-rec-component.exp, gdb.ada/pp-rec-component.py,
        gdb.ada/pp-rec-component/foo.adb, gdb.ada/pp-rec-component/pck.adb,
        gdb.ada/pp-rec-component/pck.ads: New files.
2014-01-07 08:17:40 +04:00
..
aliased_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_bounds Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_return Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_subscript_addr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arraydim Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayidx Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayparam Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayptr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
atomic_enum Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bad-task-bp-keyword Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_enum_homonym Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_on_var Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_range_type Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_reset Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
call_pn Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
catch_ex Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_enum Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
complete Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cond_lang Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dot_all Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dyn_loc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
enum_idx_packed Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exec_changed Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
expr_delims Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exprs Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_cmp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_points Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
float_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
formatted_ref Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
frame_args Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fullname_bp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_addr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_in_declare Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
funcall_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
homonym Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_exc Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_locals_renaming Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
int_deref Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
interface Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
iwide Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
lang_switch Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_catch_ex Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_ex_cond Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_exc_info Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_task_arg Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_task_info Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mod_from_name Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nested Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_record Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
O2_float_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
operator_bp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
optim_drec Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_tagged Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pp-rec-component Ada: Fix missing call to pretty-printer for fields of records. 2014-01-07 08:17:40 +04:00
print_chars Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptr_typedef Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_field Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_tagged_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py_range Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rdv_wait Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rec_return Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_tick_size Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
same_enum Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_pckd_arr_elt Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_wstr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
small_reg_param Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
start Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
str_ref_cmp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sym_print_name Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
taft_type Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged_not_init Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
task_bp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tasks Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tick_last_segv Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
type_coercion Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
unc_arr_ptr_in_var_rec Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
uninitialized_vars Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
variant_record_packed_array Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watch_arg Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
whatis_array_val Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
widewide Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
win_fu_syms Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
aliased_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_bounds.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_return.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
array_subscript_addr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arraydim.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayidx.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayparam.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
arrayptr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
assign_1.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
atomic_enum.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bad-task-bp-keyword.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
boolean_expr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_enum_homonym.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_on_var.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_range_type.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
bp_reset.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
call_pn.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
catch_ex.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_enum.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
char_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
complete.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cond_lang.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dot_all.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
dyn_loc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
enum_idx_packed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exec_changed.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
expr_delims.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
exprs.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_cmp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fixed_points.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
float_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
formatted_ref.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
frame_args.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fullname_bp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_addr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
fun_in_declare.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
funcall_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
gnat_ada.gpr Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
homonym.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_exc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_locals_renaming.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_types.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
info_types.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
int_deref.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
interface.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
iwide.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
lang_switch.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
Makefile.in * Makefile.in (clean): Remove Fission .dwo and .dwp files. 2012-05-17 19:03:59 +00:00
mi_catch_ex.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_ex_cond.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_exc_info.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_task_arg.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi_task_info.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mod_from_name.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
nested.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
null_record.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
O2_float_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
operator_bp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
optim_drec.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
packed_tagged.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
pp-rec-component.exp Ada: Fix missing call to pretty-printer for fields of records. 2014-01-07 08:17:40 +04:00
pp-rec-component.py Ada: Fix missing call to pretty-printer for fields of records. 2014-01-07 08:17:40 +04:00
print_chars.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
print_pc.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptr_typedef.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_arith_binop.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_field.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ptype_tagged_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
py_range.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rdv_wait.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
rec_return.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
ref_tick_size.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
same_enum.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_pckd_arr_elt.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
set_wstr.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
small_reg_param.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
start.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
str_ref_cmp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sym_print_name.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
taft_type.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tagged_not_init.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
task_bp.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tasks.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
tick_last_segv.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
type_coercion.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
unc_arr_ptr_in_var_rec.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
uninitialized_vars.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
variant_record_packed_array.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
watch_arg.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
whatis_array_val.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
widewide.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
win_fu_syms.exp Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00