public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/committed] sim: ppc: return register error when unhandled
@ 2024-01-11  5:50 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2024-01-11  5:50 UTC (permalink / raw)
  To: gdb-patches

We don't want to fallthru and use cooked_buf when we haven't initialized
it to anything.  Returning 0 indicates the register wasn't recognized.
---
 sim/ppc/psim.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c
index a08d38914eaf..645e29a636d6 100644
--- a/sim/ppc/psim.c
+++ b/sim/ppc/psim.c
@@ -889,8 +889,7 @@ psim_read_register(psim *system,
   default:
     printf_filtered("psim_read_register(processor=%p,buf=%p,reg=%s) %s\n",
 		    processor, buf, reg, "read of this register unimplemented");
-    break;
-
+    return 0;
   }
 
   /* the PSIM internal values are in host order.  To fetch raw data,
@@ -1077,8 +1076,7 @@ psim_write_register(psim *system,
     printf_filtered("psim_write_register(processor=%p,cooked_buf=%p,reg=%s) %s\n",
 		    processor, cooked_buf, reg,
 		    "read of this register unimplemented");
-    break;
-
+    return 0;
   }
 
   return description.size;
-- 
2.43.0


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

only message in thread, other threads:[~2024-01-11  5:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11  5:50 [PATCH/committed] sim: ppc: return register error when unhandled Mike Frysinger

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