[PATCH] Fix passing/returning of complex data for PowerPC 32-bit

Luis Machado lgustavo@codesourcery.com
Thu Jun 26 05:55:00 GMT 2014


The PowerPC 32-bit unified ABI states that there are two ways of passing 
and returning complex type data:

- Pointer, in a register, to a memory area.
- Data in registers.

The problem is that it is not clear how to detect which variation a 
program is using. GDB currently does a bit of both. It uses the first 
mechanism for passing parameters and uses both to return data, depending 
on the size of the data type. It is a bit messy because GDB is not 
handling complex types explicitly.

Checking the gdb.base/callfuncs.exp testcase for a PowerPC 32-bit 
target, with code built with GCC, showed a few failures related to 
complex types.

This patch steers GDB towards what GCC seems to generate for PowerPC 
32-bit and handles complex type passing/return via general registers 
(the second option). All failures are gone.

The problem here is if some other target/compiler is using the other 
variation. So, for those that have a PowerPC 32-bit handy, can you 
confirm it works reliably? I'm thinking AIX, Darwin or some other eabi 
target.

Otherwise, does this look reasonable?

Regards,
Luis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc32_complex.diff
Type: text/x-patch
Size: 3776 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20140626/5490d599/attachment.bin>


More information about the Gdb-patches mailing list