From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/committed] sim: ppc: return register error when unhandled
Date: Thu, 11 Jan 2024 00:50:55 -0500 [thread overview]
Message-ID: <20240111055055.29046-1-vapier@gentoo.org> (raw)
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
reply other threads:[~2024-01-11 5:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240111055055.29046-1-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).