public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/csky return type int32 for float and vector pseudo regs
@ 2022-11-09 11:46 Jiangshuai Li
  0 siblings, 0 replies; only message in thread
From: Jiangshuai Li @ 2022-11-09 11:46 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jiangshuai Li

When reg_nr is one of the float and vector pseudo registers,
return builtin_type (gdbarch)->builtin_int32 for it.
---
 gdb/csky-tdep.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c
index e377e37b26e..ced1b032a7b 100644
--- a/gdb/csky-tdep.c
+++ b/gdb/csky-tdep.c
@@ -700,6 +700,17 @@ csky_vector_type (struct gdbarch *gdbarch)
 static struct type *
 csky_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
+  int num_regs = gdbarch_num_regs (gdbarch);
+  csky_gdbarch_tdep *tdep
+    = gdbarch_tdep<csky_gdbarch_tdep> (gdbarch);
+
+  if (tdep->fv_pseudo_registers_count)
+    {
+      if ((reg_nr >= num_regs)
+	  && (reg_nr < (num_regs + tdep->fv_pseudo_registers_count)))
+	return builtin_type (gdbarch)->builtin_int32;
+    }
+
   /* If type has been described in tdesc-xml, use it.  */
   if (tdesc_has_registers (gdbarch_target_desc (gdbarch)))
     {
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-09 11:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 11:46 [PATCH] gdb/csky return type int32 for float and vector pseudo regs Jiangshuai Li

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