[0/2,version,2] PowerPC, fix support for printing the function return value for non-trivial values.

Message ID e86f260f48bb598bd61c42ee5ca312b4fd791bea.camel@us.ibm.com
Headers
Series PowerPC, fix support for printing the function return value for non-trivial values. |

Message

Carl Love Oct. 18, 2022, 6:55 p.m. UTC
  GDB maintainers:

Version 2:  The patch set has been updated per the review comments from
Kevin Buettner and Bruno Larsen.  Thank you to both for your help with
the pathes.

This patch set addresses the five test failures in gdb.cp/non-trivial-
retval.exp on PowerPC.  

The failures started with

   commit b1718fcdd1d2a5c514f8ee504ba07fb3f42b8608  
   Author: Andrew Burgess <aburgess@redhat.com>
   Date:   Mon Dec 13 16:56:16 2021 +0000

         gdb: on x86-64 non-trivial C++ objects are returned in memory

         Fixes PR gdb/28681.  It was observed that after using the `finish`
         command an incorrect value was displayed in some cases.  Specifically,
         this behaviour was observed on an x86-64 target.

The return value from the function is not correct due to multiple
problems.  

The PowerPC specific code does not return the correct return value
convention.  This is fixed by the first patach.  However due to the
PowerPC ABI, GDB is still not able to reliably determine the function
return value.

The second patch addresses the issue of not being able to reliably
determine the return buffer address on PowerPC.  The patch adds a new
GDB ABI to use the DW_OP_entryvalue for the DWARF entries to reliably
obtain the return buffer address stored in register r3 on entry to the
function.

These two patches fix the five testsuite failures in gdb.cp/non-
trivial-retval.exp on PowerPC.

                      Carl Love