[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 12/26] gdbstub: rationalise signal mapping in softmmu
From: |
Alex Bennée |
Subject: |
[PATCH v4 12/26] gdbstub: rationalise signal mapping in softmmu |
Date: |
Thu, 2 Mar 2023 19:08:32 +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>
---
gdbstub/softmmu.c | 18 ++++++------------
1 file 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;
}
}
--
2.39.2
- [PATCH v4 00/26] gdbstub/next: re-organise and split build, Alex Bennée, 2023/03/02
- [PATCH v4 01/26] gdbstub/internals.h: clean up include guard, Alex Bennée, 2023/03/02
- [PATCH v4 02/26] gdbstub: fix-up copyright and license files, Alex Bennée, 2023/03/02
- [PATCH v4 03/26] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs, Alex Bennée, 2023/03/02
- [PATCH v4 07/26] includes: move tb_flush into its own header, Alex Bennée, 2023/03/02
- [PATCH v4 05/26] gdbstub: define separate user/system structures, Alex Bennée, 2023/03/02
- [PATCH v4 06/26] gdbstub: move GDBState to shared internals header, Alex Bennée, 2023/03/02
- [PATCH v4 08/26] gdbstub: move fromhex/tohex routines to internals, Alex Bennée, 2023/03/02
- [PATCH v4 04/26] gdbstub: clean-up indent on gdb_exit, Alex Bennée, 2023/03/02
- [PATCH v4 12/26] gdbstub: rationalise signal mapping in softmmu,
Alex Bennée <=
- [PATCH v4 10/26] gdbstub: move chunk of softmmu functionality to own file, Alex Bennée, 2023/03/02
- [PATCH v4 09/26] gdbstub: make various helpers visible to the rest of the module, Alex Bennée, 2023/03/02
- [PATCH v4 11/26] gdbstub: move chunks of user code into own files, Alex Bennée, 2023/03/02
- [PATCH v4 26/26] gdbstub: move update guest debug to accel ops, Alex Bennée, 2023/03/02
- [PATCH v4 23/26] testing: probe gdb for supported architectures ahead of time, Alex Bennée, 2023/03/02
- [PATCH v4 24/26] include: split target_long definition from cpu-defs, Alex Bennée, 2023/03/02
- [PATCH v4 13/26] gdbstub: abstract target specific details from gdb_put_packet_binary, Alex Bennée, 2023/03/02
- [PATCH v4 18/26] gdbstub: fix address type of gdb_set_cpu_pc, Alex Bennée, 2023/03/02
- [PATCH v4 22/26] gdbstub: only compile gdbstub twice for whole build, Alex Bennée, 2023/03/02
- [PATCH v4 17/26] gdbstub: specialise stub_can_reverse, Alex Bennée, 2023/03/02