[Ltrace-devel] [PATCH 5/5] On ppc64le When a function resumed as a struct depending on its registers setting, struct address is either in R3 or in R4.

thierry at linux.vnet.ibm.com thierry at linux.vnet.ibm.com
Thu Mar 24 16:10:19 UTC 2016


From: Thierry Fauck <tfauck at free.fr>

Signed-off-by: Thierry Fauck <tfauck at free.fr>

	modified:   sysdeps/linux-gnu/ppc/fetch.c
---
 sysdeps/linux-gnu/ppc/fetch.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sysdeps/linux-gnu/ppc/fetch.c b/sysdeps/linux-gnu/ppc/fetch.c
index e4045a0..860cb86 100644
--- a/sysdeps/linux-gnu/ppc/fetch.c
+++ b/sysdeps/linux-gnu/ppc/fetch.c
@@ -609,7 +609,11 @@ arch_fetch_retval(struct fetch_context *ctx, enum tof type,
 	if (ctx->ret_struct) {
 		assert(info->type == ARGTYPE_STRUCT);
 
-		uint64_t addr = read_gpr(ctx, proc, 3);
+		uint64_t addr;
+		if ( ctx->regs.r32[1] == 0 )
+                        addr = read_gpr(ctx, proc, 3);
+                else
+                        addr = read_gpr(ctx, proc, 4);
 		value_init(valuep, proc, NULL, info, 0);
 
 		valuep->where = VAL_LOC_INFERIOR;
-- 
2.7.0




More information about the Ltrace-devel mailing list