mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-24 02:24:46 +08:00
a0eda3df5b
Currently, a non-trivial return value from a function cannot currently be reliably determined on PowerPC. This is due to the fact that the PowerPC ABI uses register r3 to store the address of the buffer containing the non-trivial return value when the function is called. The PowerPC ABI does not guarantee the value in register r3 is not modified in the function. Thus the value in r3 cannot be reliably used to obtain the return addreses on exit from the function. This patch adds a new gdbarch method to allow PowerPC to access the value of r3 on entry to a function. On PowerPC, the new gdbarch method attempts to use the DW_OP_entry_value for the DWARF entries, when exiting the function, to determine the value of r3 on entry to the function. This requires the use of the -fvar-tracking compiler option to compile the user application thus generating the DW_OP_entry_value in the binary. The DW_OP_entry_value entries in the binary file allows GDB to resolve the DW_TAG_call_site entries. This new gdbarch method is used to get the return buffer address, in the case of a function returning a nontrivial data type, on exit from the function. The GDB function should_stop checks to see if RETURN_BUF is non-zero. By default, RETURN_BUF will be set to zero by the new gdbarch method call for all architectures except PowerPC. The get_return_value function will be used to obtain the return value on all other architectures as is currently being done if RETURN_BUF is zero. On PowerPC, the new gdbarch method will return a nonzero address in RETURN_BUF if the value can be determined. The value_at function uses the return buffer address to get the return value. This patch fixes five testcase failures in gdb.cp/non-trivial-retval.exp. The correct function return values are now reported. Note this patch is dependent on patch: "PowerPC, function ppc64_sysv_abi_return_value add missing return value convention". This patch has been tested on Power 10 and x86-64 with no regressions. |
||
---|---|---|
.. | ||
abbrev-cache.c | ||
abbrev-cache.h | ||
abbrev.c | ||
abbrev.h | ||
attribute.c | ||
attribute.h | ||
comp-unit-head.c | ||
comp-unit-head.h | ||
cooked-index.c | ||
cooked-index.h | ||
cu.c | ||
cu.h | ||
die.h | ||
dwz.c | ||
dwz.h | ||
expr.c | ||
expr.h | ||
file-and-dir.h | ||
frame-tailcall.c | ||
frame-tailcall.h | ||
frame.c | ||
frame.h | ||
index-cache.c | ||
index-cache.h | ||
index-common.c | ||
index-common.h | ||
index-write.c | ||
index-write.h | ||
leb.c | ||
leb.h | ||
line-header.c | ||
line-header.h | ||
loc.c | ||
loc.h | ||
macro.c | ||
macro.h | ||
mapped-index.h | ||
public.h | ||
read.c | ||
read.h | ||
sect-names.h | ||
section.c | ||
section.h | ||
stringify.c | ||
stringify.h | ||
tag.h |