old-cross-binutils/gdb/testsuite/gdb.ada
Joel Brobecker 4d804846db [dwarf] Mark all functions as prototyped except C functions.
This makes sure that the types of the arguments are taken into account
when performing an inferior function call to a non-C (or C-like)
function.  In particular, this makes sure that the arguments are
appropriatly converted to the correct type.

For instance, on x86_64-linux, with the following Ada code:

   procedure Set_Float (F : Float) is
   begin
      Global_Float := F;
   end Set_Float;

The following sequence shows that Float arguments are incorrectly
passed (Ada's Float type is the equivalent of type "float" in C):

    (gdb) call set_float (2.0)
    (gdb) print global_float
    $1 = 0.0

Putting a breakpoint inside set_float to inspect the value of
register xmm0 gives the first hint of the problem:

    (gdb) p $xmm0
    $2 = (v4_float => (0 => 0.0, 2.0, 0.0, 0.0),
          v2_double => (0 => 2.0, 0.0),
    [...]

It shows that the argument was passed as a double.

The code responsible for doing appropriate type conversions
for the arguments (value_arg_coerce) found that our function
was not prototyped, and thus could not use typing information
for the arguments. Instead, it defaulted to the value of "set
coerce-float-to-double", which by default is true, to determine
the argument type.

This patch fixes the problem by setting the PROTOTYPE flag
for all functions of any language except C and Objective C.

gdb/ChangeLog:

        * dwarf2read.c (prototyped_function_p): New function.
        (read_subroutine_type): Use it.

gdb/testsuite/ChangeLog:

        * gdb.ada/float_param: New testcase.
2013-05-20 09:45:13 +00:00
..
aliased_array Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
array_bounds Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
array_return Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
array_subscript_addr Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arrayidx Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arrayparam Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arrayptr Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
atomic_enum Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bad-task-bp-keyword Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_enum_homonym Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_on_var Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_range_type Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_reset Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
call_pn Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
catch_ex Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
char_enum Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
char_param Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
complete Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
cond_lang Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dyn_loc Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
enum_idx_packed Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
exec_changed Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
expr_delims Allow 'thread' to be used as a variable name in expressions. 2013-03-12 09:03:11 +00:00
exprs Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fixed_cmp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fixed_points Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
float_param [dwarf] Mark all functions as prototyped except C functions. 2013-05-20 09:45:13 +00:00
formatted_ref Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
frame_args Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fullname_bp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fun_addr Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fun_in_declare Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
funcall_param Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
homonym Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
info_locals_renaming Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
int_deref Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
interface Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
iwide Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
lang_switch Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mi_catch_ex Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mi_task_arg Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mi_task_info Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mod_from_name Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nested Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
null_array Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
null_record Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
operator_bp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
optim_drec Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
packed_array Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
packed_tagged Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
print_chars Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptr_typedef Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype_field Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype_tagged_param Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rdv_wait Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rec_return Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ref_param Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ref_tick_size Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
same_enum Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
set_pckd_arr_elt Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
set_wstr Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
small_reg_param Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
start Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
str_ref_cmp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
sym_print_name Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
taft_type Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tagged Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tagged_not_init Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
task_bp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tasks Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tick_last_segv Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
type_coercion Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
unc_arr_ptr_in_var_rec Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
uninitialized_vars Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
variant_record_packed_array Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
watch_arg Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
whatis_array_val Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
widewide Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
win_fu_syms Ignore __fu<digits>__ symbols from COFF symbol tables 2013-03-29 02:04:15 +00:00
aliased_array.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
array_bounds.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
array_return.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
array_subscript_addr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arrayidx.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
arrayparam.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
arrayptr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
assign_1.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
atomic_enum.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bad-task-bp-keyword.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
boolean_expr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_enum_homonym.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_on_var.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_range_type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
bp_reset.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
call_pn.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
catch_ex.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
char_enum.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
char_param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
complete.exp gdb.ada/complete.exp: Fix FIXME. 2013-05-16 10:13:33 +00:00
cond_lang.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
dyn_loc.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
enum_idx_packed.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
exec_changed.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
expr_delims.exp Allow 'thread' to be used as a variable name in expressions. 2013-03-12 09:03:11 +00:00
exprs.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fixed_cmp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fixed_points.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
float_param.exp [dwarf] Mark all functions as prototyped except C functions. 2013-05-20 09:45:13 +00:00
formatted_ref.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
frame_args.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fullname_bp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fun_addr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
fun_in_declare.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
funcall_param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
gnat_ada.gpr Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
homonym.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
info_locals_renaming.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
info_types.c Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
info_types.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
int_deref.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
interface.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
iwide.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
lang_switch.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +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 Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mi_task_arg.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mi_task_info.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
mod_from_name.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
nested.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
null_array.exp gdb/testsuite/ 2013-03-14 13:34:06 +00:00
null_record.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
operator_bp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
optim_drec.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
packed_array.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
packed_tagged.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
print_chars.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
print_pc.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptr_typedef.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype_arith_binop.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype_field.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ptype_tagged_param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rdv_wait.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
rec_return.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ref_param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
ref_tick_size.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
same_enum.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
set_pckd_arr_elt.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
set_wstr.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
small_reg_param.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
start.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
str_ref_cmp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
sym_print_name.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
taft_type.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tagged.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tagged_not_init.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
task_bp.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tasks.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
tick_last_segv.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
type_coercion.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
unc_arr_ptr_in_var_rec.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
uninitialized_vars.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
variant_record_packed_array.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
watch_arg.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
whatis_array_val.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
widewide.exp Update years in copyright notice for the GDB files. 2013-01-01 06:33:28 +00:00
win_fu_syms.exp Ignore __fu<digits>__ symbols from COFF symbol tables 2013-03-29 02:04:15 +00:00