old-cross-binutils/gdb/testsuite
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
..
boards
config
gdb.ada [dwarf] Mark all functions as prototyped except C functions. 2013-05-20 09:45:13 +00:00
gdb.arch Merge gdb.arch/system-gcore.exp into gdb.base/gcore.exp 2013-05-07 17:51:42 +00:00
gdb.asm
gdb.base * NEWS: Mention new maintenance commands check-symtabs, and 2013-05-17 18:09:06 +00:00
gdb.btrace
gdb.cell
gdb.cp PR c++/13588: 2013-04-15 18:13:01 +00:00
gdb.disasm
gdb.dwarf2 * gdb.dwarf2/implptrconst.exp: Create a CU with 4 byte address 2013-05-13 19:32:17 +00:00
gdb.fortran
gdb.gdb * lib/selftest-support.exp: New file. 2013-05-07 18:06:16 +00:00
gdb.go
gdb.hp
gdb.java
gdb.linespec gdb/ 2013-05-07 17:04:29 +00:00
gdb.mi * gdb.mi/mi-var-create-rtti.exp: Create a variable of 2013-04-18 10:08:08 +00:00
gdb.modula2
gdb.multi
gdb.objc
gdb.opencl
gdb.opt
gdb.pascal
gdb.python 2013-05-10 Phil Muldoon <pmuldoon@redhat.com> 2013-05-10 10:26:03 +00:00
gdb.reverse * gdb.reverse/shr.h: New file. 2013-05-06 22:07:13 +00:00
gdb.server gdb/testsuite/ 2013-04-09 15:26:44 +00:00
gdb.stabs
gdb.threads gdb/ 2013-05-07 07:43:33 +00:00
gdb.trace PR remote/15455 - QTro remote packet broken 2013-05-10 13:59:45 +00:00
gdb.xml 2013-05-06 Sandra Loosemore <sandra@codesourcery.com> 2013-05-07 01:12:41 +00:00
lib * lib/selftest-support.exp: New file. 2013-05-07 18:06:16 +00:00
aclocal.m4
ChangeLog [dwarf] Mark all functions as prototyped except C functions. 2013-05-20 09:45:13 +00:00
configure
configure.ac
dg-extract-results.sh
Makefile.in
TODO