public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Fix an infinite loop on bt when the core dump has an SVE section but the target does not support it.
@ 2023-03-19 20:55 Dmytro Medvied
  2023-03-27  9:42 ` Luis Machado
  0 siblings, 1 reply; 5+ messages in thread
From: Dmytro Medvied @ 2023-03-19 20:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Dmytro Medvied

When read_aarch64_ctx() returns AARCH64_SVE_MAGIC and the target does not support SVE gdb goes in an infinite loop because the section was not incremented by the size of the read context.
To fix this behavior, the section needs to be incremented by the size of the read context after the check for target supporting of SVE has returned false.
---
 gdb/aarch64-linux-tdep.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index b183a3c9a38..439760fffe2 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -337,7 +337,10 @@ aarch64_linux_sigframe_init (const struct tramp_frame *self,
 	    uint16_t vq;
 
 	    if (!tdep->has_sve ())
-	      break;
+	      {
+		section += size;
+		break;
+	      }
 
 	    if (target_read_memory (section + AARCH64_SVE_CONTEXT_VL_OFFSET,
 				    buf, 2) != 0)
-- 
2.40.0


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

end of thread, other threads:[~2023-06-08 13:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-19 20:55 [PATCH] aarch64: Fix an infinite loop on bt when the core dump has an SVE section but the target does not support it Dmytro Medvied
2023-03-27  9:42 ` Luis Machado
2023-03-29 12:42   ` Дмитро Медвєдь
2023-03-29 13:06     ` Luis Machado
     [not found]       ` <CAJ=kipZRP1QaO-Bp=k+gGONXuAOYnqnVqypLDrVFBbBvnfOApw@mail.gmail.com>
2023-06-08 13:47         ` 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).