summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2023-03-02 18:57:48 -0800
committerAlex Bennée <alex.bennee@linaro.org>2023-03-07 20:44:08 +0000
commitccd4c7c24a722288127eff2a4dc2793e6a3c04f0 (patch)
tree0638d2f1850958bb1b9a4dd1e0e2b3f69ea778c9
parentd96bf49ba842e8e1b73c7884d2be084582f34228 (diff)
downloadfocaccia-qemu-ccd4c7c24a722288127eff2a4dc2793e6a3c04f0.tar.gz
focaccia-qemu-ccd4c7c24a722288127eff2a4dc2793e6a3c04f0.zip
gdbstub: rationalise signal mapping in softmmu
We don't really need a table for mapping two symbols.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230302190846.2593720-13-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-13-richard.henderson@linaro.org>
-rw-r--r--gdbstub/softmmu.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdbstub/softmmu.c b/gdbstub/softmmu.c
index a6c196ade6..6796761fd9 100644
--- a/gdbstub/softmmu.c
+++ b/gdbstub/softmmu.c
@@ -506,20 +506,14 @@ enum {
     TARGET_SIGTRAP = 5
 };
 
-static int gdb_signal_table[] = {
-    -1,
-    -1,
-    TARGET_SIGINT,
-    -1,
-    -1,
-    TARGET_SIGTRAP
-};
-
 int gdb_signal_to_target(int sig)
 {
-    if (sig < ARRAY_SIZE(gdb_signal_table)) {
-        return gdb_signal_table[sig];
-    } else {
+    switch (sig) {
+    case 2:
+        return TARGET_SIGINT;
+    case 5:
+        return TARGET_SIGTRAP;
+    default:
         return -1;
     }
 }