From: Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/3] sim: callback: add missing cb_target_to_host_signal
Date: Sun, 20 Jun 2021 23:55:05 -0400 [thread overview]
Message-ID: <20210621035505.29431-3-vapier@gentoo.org> (raw)
In-Reply-To: <20210621035505.29431-1-vapier@gentoo.org>
There's been a prototype for this forever, but the implementation was
missing. Probably because there weren't any callers, but we'll start
using it to implement the kill function.
---
sim/common/callback.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/sim/common/callback.c b/sim/common/callback.c
index aca0112853c4..06d76b477245 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -927,6 +927,19 @@ cb_target_to_host_open (host_callback *cb, int target_val)
return host_val;
}
+/* Translate the target's version of a signal number to the host's.
+ This isn't actually the host's version, rather a canonical form.
+ ??? Perhaps this should be renamed to ..._canon_signal. */
+
+int
+cb_target_to_host_signal (host_callback *cb, int target_val)
+{
+ const CB_TARGET_DEFS_MAP *m =
+ cb_target_map_entry (cb->signal_map, target_val);
+
+ return m ? m->host_val : -1;
+}
+
/* Utility for e.g. cb_host_to_target_stat to store values in the target's
stat struct.
--
2.31.1
next prev parent reply other threads:[~2021-06-21 3:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-21 3:55 [PATCH 1/3] sim: callback: add a getpid interface Mike Frysinger via Gdb-patches
2021-06-21 3:55 ` [PATCH 2/3] sim: callback: generate signal map Mike Frysinger via Gdb-patches
2021-06-21 3:55 ` Mike Frysinger via Gdb-patches [this message]
2021-06-21 22:58 ` [PATCH 1/3] sim: callback: add a getpid interface Christian Biesinger via Gdb-patches
2021-06-21 23:50 ` Mike Frysinger via Gdb-patches
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=20210621035505.29431-3-vapier@gentoo.org \
--to=gdb-patches@sourceware.org \
--cc=vapier@gentoo.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