public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] PowerPC, fix gdb.base/retval-large-struct.exp
@ 2022-11-17 16:40 Carl Love
  0 siblings, 0 replies; only message in thread
From: Carl Love @ 2022-11-17 16:40 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f68eca29d3b3e551a45a1bb02b05a0b3a4856f59

commit f68eca29d3b3e551a45a1bb02b05a0b3a4856f59
Author: Carl Love <cel@us.ibm.com>
Date:   Wed Nov 16 16:12:02 2022 -0600

    PowerPC, fix gdb.base/retval-large-struct.exp
    
    Support for printining non-trivial return values was recently added in
    commit:
    
      commit a0eda3df5b750ae32576a9be092b361281a41787
      Author: Carl Love <cel@us.ibm.com>
      Date:   Mon Nov 14 16:22:37 2022 -0500
    
        PowerPC, fix support for printing the function return value for non-trivial values.
    
    The functionality can now be used to fix gdb.base/retval-large-struct.exp.
    The test just needs to be compiled with -fvar-tracking to enable GDB to
    determine the address off the return buffer when the function is called.
    
    The current output from the test:
    
    34        return big_struct;
    (gdb) PASS: gdb.base/retval-large-struct.exp: continue to breakpoint: Break in print_large_struct
    finish
    warning: Cannot determine the function return value.
    Try compiling with -fvar-tracking.
    Run till exit from #0  return_large_struct () at binutils-gdb-current/gdb/testsuite/gdb.base/retval-large-struct.c:34
    main (argc=1, argv=0x7fffffffcd58) at binutils-gdb-current/gdb/testsuite/gdb.base/retval-large-struct.c:44
    44        return 0;
    Value returned has type: struct big_struct_t. Cannot determine contents
    (gdb) FAIL: gdb.base/retval-large-struct.exp: finish from return_large_struct
    testcase binutils-gdb-current/gdb/testsuite/gdb.base/retval-large-struct.exp completed in 1 seconds
    
    This patch adds the command line argument -fvar-tracking to enable gdb to
    determine the return vaule and thus fixing the test.
    
    Patch tested on Power 10 with no regressions.

Diff:
---
 gdb/testsuite/gdb.base/retval-large-struct.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/retval-large-struct.exp b/gdb/testsuite/gdb.base/retval-large-struct.exp
index 11bc4d5fbdf..f7aa1df81fa 100644
--- a/gdb/testsuite/gdb.base/retval-large-struct.exp
+++ b/gdb/testsuite/gdb.base/retval-large-struct.exp
@@ -20,7 +20,13 @@
 
 standard_testfile
 
-if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+set additional_flags ""
+
+if {[have_fvar_tracking]} {
+    set additional_flags "additional_flags= -fvar-tracking"
+}
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile [list debug $additional_flags]]} {
     return -1
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-17 16:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 16:40 [binutils-gdb] PowerPC, fix gdb.base/retval-large-struct.exp Carl Love

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).