From: Joel Brobecker Date: Wed, 27 Dec 2006 06:12:36 +0000 (+0000) Subject: * gdb.ada/array_return/pck.ads (Small_Float_Vector): New type. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba54f3188b5fddbf4d1e534573448f674b8dee90;p=binutils-gdb.git * gdb.ada/array_return/pck.ads (Small_Float_Vector): New type. (Create_Small_Float_Vector): New function. * gdb.ada/array_return/pck.adb (Create_Small_Float_Vector): Add function body. * gdb.ada/array_return/p.adb: Use new type and function from package Pck. * gdb.ada/array_return.exp: Add a test verifying that GDB is able to print the value returned by a function returning an array of float. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 1a8b73cff1a..88ae97722ae 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2006-12-27 Joel Brobecker + + * gdb.ada/array_return/pck.ads (Small_Float_Vector): New type. + (Create_Small_Float_Vector): New function. + * gdb.ada/array_return/pck.adb (Create_Small_Float_Vector): Add + function body. + * gdb.ada/array_return/p.adb: Use new type and function from + package Pck. + * gdb.ada/array_return.exp: Add a test verifying that GDB is + able to print the value returned by a function returning an + array of float. + 2006-12-20 Joel Brobecker * gdb.arch/i386-prologue.exp: Remove calls to setup_kfail. diff --git a/gdb/testsuite/gdb.ada/array_return.exp b/gdb/testsuite/gdb.ada/array_return.exp index c2ede2c9319..1a6ada11176 100644 --- a/gdb/testsuite/gdb.ada/array_return.exp +++ b/gdb/testsuite/gdb.ada/array_return.exp @@ -54,12 +54,16 @@ gdb_test "break create_large" \ "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \ "insert breakpoint in create_large" +gdb_test "break create_small_float_vector" \ + "Breakpoint \[0-9\]+ at.*: file .*pck.adb, line \[0-9\]+." \ + "insert breakpoint in create_small_float_vector" + # Then continue until reaching the first breakpoint inside Create_Small, # and then do a "finish". gdb_test "cont" \ "Breakpoint \[0-9\]+, pck.create_small \\(\\).*" \ - "Continuing to Create.Small" + "Continuing to Create_Small" gdb_test "finish" \ "Value returned is \\\$\[0-9\]+ = \\(1, 1\\)" \ @@ -70,7 +74,7 @@ gdb_test "finish" \ gdb_test "cont" \ "Breakpoint \[0-9\]+, pck.create_large \\(\\).*" \ - "Continuing to Create.Large" + "Continuing to Create_Large" # On hppa32, the value returned is too large to be returned via a register. # Instead, it is returned using the struct convention, and the debugger @@ -84,3 +88,14 @@ gdb_test "finish" \ "Value returned is \\\$\[0-9\]+ = \\(2, 2, 2, 2\\)" \ "value printed by finish of Create_Large" +# Now continue until reaching the third breakpoint, and then do another +# "finish" again. + +gdb_test "cont" \ + "Breakpoint \[0-9\]+, pck.create_small_float_vector \\(\\).*" \ + "Continuing to Create_Small_Float_Vector" + +gdb_test "finish" \ + "Value returned is \\\$\[0-9\]+ = \\(4.25, 4.25\\)" \ + "value printed by finish of Create_Small_Float_Vector" + diff --git a/gdb/testsuite/gdb.ada/array_return/p.adb b/gdb/testsuite/gdb.ada/array_return/p.adb index bcfd75e9786..ef78bab774a 100644 --- a/gdb/testsuite/gdb.ada/array_return/p.adb +++ b/gdb/testsuite/gdb.ada/array_return/p.adb @@ -20,8 +20,11 @@ with Pck; use Pck; procedure P is Small : Data_Small; Large : Data_Large; + Vector : Small_Float_Vector; begin Small := Create_Small; Large := Create_Large; + Vector := Create_Small_Float_Vector; Small (1) := Large (1); + Small (2) := Integer (Vector (1)); end P; diff --git a/gdb/testsuite/gdb.ada/array_return/pck.adb b/gdb/testsuite/gdb.ada/array_return/pck.adb index 042af78707b..6a06b39aa76 100644 --- a/gdb/testsuite/gdb.ada/array_return/pck.adb +++ b/gdb/testsuite/gdb.ada/array_return/pck.adb @@ -27,4 +27,9 @@ package body Pck is return (others => 2); end Create_Large; + function Create_Small_Float_Vector return Small_Float_Vector is + begin + return (others => 4.25); + end Create_Small_Float_Vector; + end Pck; diff --git a/gdb/testsuite/gdb.ada/array_return/pck.ads b/gdb/testsuite/gdb.ada/array_return/pck.ads index 7f8eb239a41..2d646b315e6 100644 --- a/gdb/testsuite/gdb.ada/array_return/pck.ads +++ b/gdb/testsuite/gdb.ada/array_return/pck.ads @@ -20,8 +20,11 @@ package Pck is type Data_Small is array (1 .. 2) of Integer; type Data_Large is array (1 .. 4) of Integer; + type Small_Float_Vector is array (1 .. 2) of Float; + function Create_Small return Data_Small; function Create_Large return Data_Large; + function Create_Small_Float_Vector return Small_Float_Vector; end Pck;