[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/30] gdbstub: rationalise signal mapping in softmmu
From: |
Alex Bennée |
Subject: |
[PULL 12/30] gdbstub: rationalise signal mapping in softmmu |
Date: |
Tue, 7 Mar 2023 21:21:21 +0000 |
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>
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;
}
}
--
2.39.2
- [PULL 00/30] gdbstub refactor for smaller build, Alex Bennée, 2023/03/07
- [PULL 04/30] gdbstub: clean-up indent on gdb_exit, Alex Bennée, 2023/03/07
- [PULL 01/30] gdbstub/internals.h: clean up include guard, Alex Bennée, 2023/03/07
- [PULL 03/30] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs, Alex Bennée, 2023/03/07
- [PULL 05/30] gdbstub: define separate user/system structures, Alex Bennée, 2023/03/07
- [PULL 08/30] gdbstub: move fromhex/tohex routines to internals, Alex Bennée, 2023/03/07
- [PULL 07/30] includes: move tb_flush into its own header, Alex Bennée, 2023/03/07
- [PULL 10/30] gdbstub: move chunk of softmmu functionality to own file, Alex Bennée, 2023/03/07
- [PULL 14/30] gdbstub: specialise handle_query_attached, Alex Bennée, 2023/03/07
- [PULL 12/30] gdbstub: rationalise signal mapping in softmmu,
Alex Bennée <=
- [PULL 09/30] gdbstub: make various helpers visible to the rest of the module, Alex Bennée, 2023/03/07
- [PULL 11/30] gdbstub: move chunks of user code into own files, Alex Bennée, 2023/03/07
- [PULL 02/30] gdbstub: fix-up copyright and license files, Alex Bennée, 2023/03/07
- [PULL 06/30] gdbstub: move GDBState to shared internals header, Alex Bennée, 2023/03/07
- [PULL 13/30] gdbstub: abstract target specific details from gdb_put_packet_binary, Alex Bennée, 2023/03/07
- [PULL 17/30] gdbstub: specialise stub_can_reverse, Alex Bennée, 2023/03/07
- [PULL 26/30] gdbstub: Remove gdb_do_syscallv, Alex Bennée, 2023/03/07
- [PULL 29/30] gdbstub: Build syscall.c once, Alex Bennée, 2023/03/07
- [PULL 28/30] stubs: split semihosting_get_target from system only stubs, Alex Bennée, 2023/03/07
- [PULL 16/30] gdbstub: introduce gdb_get_max_cpus, Alex Bennée, 2023/03/07