public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [AArch64] Fix PR gdb/28681
@ 2022-01-04 17:22 Luis Machado
  2022-01-04 18:09 ` Simon Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Luis Machado @ 2022-01-04 17:22 UTC (permalink / raw)
  To: gdb-patches

This is the same as commit b1718fcdd1d2a5c514f8ee504ba07fb3f42b8608, but
fixing things for AArch64.

With the patch, gdb.cp/non-trivial-retval.exp has full passes on
AArch64-Linux Ubuntu 20.04/18.04.
---
 gdb/aarch64-tdep.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 70fb66954a4..802762f303c 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2323,6 +2323,15 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
 	  valbuf += X_REGISTER_SIZE;
 	}
     }
+  else if (!language_pass_by_reference (type).trivially_copyable)
+    {
+      /* If the object is a non-trivial C++ object, the result is passed as a
+	 pointer stored in X0.  */
+      CORE_ADDR addr;
+
+      regs->cooked_read (AARCH64_X0_REGNUM, &addr);
+      read_memory (addr, valbuf, TYPE_LENGTH (type));
+    }
   else
     {
       /* For a structure or union the behaviour is as if the value had
-- 
2.25.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-01-13 15:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 17:22 [PATCH] [AArch64] Fix PR gdb/28681 Luis Machado
2022-01-04 18:09 ` Simon Marchi
2022-01-04 18:44   ` Luis Machado
2022-01-04 18:47     ` Simon Marchi
2022-01-04 18:49       ` Luis Machado
2022-01-04 18:56         ` Simon Marchi
2022-01-04 19:04           ` Luis Machado
2022-01-05 12:54 ` Andrew Burgess
2022-01-11 21:17   ` Luis Machado
2022-01-11 21:22 ` [PATCH] [AArch64] Properly extract the reference to a return value from x8 Luis Machado
2022-01-12 11:14   ` Andrew Burgess
2022-01-13 14:19     ` Luis Machado
2022-01-13 15:18       ` Andrew Burgess
2022-01-13 15:22         ` Luis Machado

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).