Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/1] aarch64: fix a crash during maintenance print cooked-registers
@ 2025-02-03 13:52 Klaus Gerlicher
  2025-02-03 14:27 ` Luis Machado
  0 siblings, 1 reply; 5+ messages in thread
From: Klaus Gerlicher @ 2025-02-03 13:52 UTC (permalink / raw)
  To: gdb-patches, luis.machado

Hi all, Luis,

I found this accidently while looking at Thiago's GDBserver improvements. Luis
I think added the pseudo register in question, so maybe he can comment
on this issue. I used a aarch64 qemu 9.2.

Thanks
Klaus

On aarch64 with pauth enabled I can see a crash when
using "maintenance print cooked-registers".

This happens because the register dump code tries to read
a pseudo reg that is not handled here because it is supposedly
only used in unwinding.

Fix this by returning a zero value typed as a built-in uint64.
---
 gdb/aarch64-tdep.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 840f9877361..6e712b12b86 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -3290,6 +3290,9 @@ aarch64_pseudo_read_value (gdbarch *gdbarch, const frame_info_ptr &next_frame,
     return aarch64_pseudo_read_value_1 (next_frame, pseudo_reg_num,
 					pseudo_offset - AARCH64_SVE_V0_REGNUM);
 
+  if (tdep->has_pauth () && pseudo_reg_num == tdep->ra_sign_state_regnum)
+    return value::zero (builtin_type (gdbarch)->builtin_uint64, lval_register);
+
   gdb_assert_not_reached ("regnum out of bound");
 }
 
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


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

end of thread, other threads:[~2025-02-13 11:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-03 13:52 [PATCH 1/1] aarch64: fix a crash during maintenance print cooked-registers Klaus Gerlicher
2025-02-03 14:27 ` Luis Machado
2025-02-03 14:38   ` Gerlicher, Klaus
2025-02-03 14:40     ` Luis Machado
2025-02-13 11:09       ` [PUSHED][PATCH " Gerlicher, Klaus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox