PowerPC: Fix test gdb.ada/finish-large.exp
Checks
Commit Message
GDB maintainers:
The following patch fixes a single regression error in test
gdb.ada/finish-large.exp on the PowerPC platform.
The patch compiles the test with the -fvar-tracking command line option
enabled so the DWARF DW_TAG_call_site information will be included in
the binary. This DWARF information is used by PowerPC to obtain the
value of r3 on entry to a function. The address to return a structure
is passed into a function in r3. But r3 is not guaranteed to be the
same at the end of the function when the finish command prints the
function return value. With -fvar-tracking enabled, GDB can now print
the return value of a function returning a large structure on the
PowerPC platform.
The patch has been tested on Power 10 and X86-64 with no regression
errors.
Please let me know if this patch is acceptable for mainline. Thanks.
Thanks to Luis, Tom and Keith for their help.
Carl
------------------------------------
PowerPC: Fix test gdb.ada/finish-large.exp
Function Create_large returns a large data structure. On PowerPC, register
r3 contains the address of where the data structure to be returned is to
be stored. However, on exit the ABI does not guarantee that r3 has not
been changed. The GDB finish command prints the return value of the
function at the end of the function. GDB needs to use the
DW_TAG_call_site information to determine the value of r3 on entry to
the function to correctly print the return value at the end of the
function. The test must be compiled with -fvar-tracking for the
DW_TAG_call_site information to be included in the executable file.
This patch adds the -fvar-tracking option to the compile line if the
option is supported.
The patch fixes the one regression error for the test on PowerPC.
The patch has been tested on Power 10 and X86-64 with no regressions.
---
gdb/testsuite/gdb.ada/finish-large.exp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Comments
>>>>> "Carl" == Carl Love <cel@linux.ibm.com> writes:
Carl> Please let me know if this patch is acceptable for mainline. Thanks.
Thanks, this is ok.
Tom
@@ -19,7 +19,13 @@ require allow_ada_tests
standard_ada_testfile p
-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable debug] != ""} {
+set flags {debug}
+
+if {[have_fvar_tracking]} {
+ lappend flags "additional_flags=-fvar-tracking"
+}
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} {
return -1
}