diff options
author | Gustavo Romero <gustavo.romero@linaro.org> | 2024-03-09 03:08:59 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-03-13 11:43:52 +0000 |
commit | f84e313e0278222eb88b9ca29311f0df71abd001 (patch) | |
tree | f6f7fca9201712d62bb6615280430f47484a8877 /linux-user/signal.c | |
parent | 4d6d8a05a0a6d102ca94e59a43804d65309921e3 (diff) |
gdbstub: Save target's siginfo
Save target's siginfo into gdbserver_state so it can be used later, for
example, in any stub that requires the target's si_signo and si_code.
This change affects only linux-user mode.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240309030901.1726211-4-gustavo.romero@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/signal.c')
-rw-r--r-- | linux-user/signal.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index 2db4d12ef6..a93148a4cb 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -34,6 +34,9 @@ #include "user/safe-syscall.h" #include "tcg/tcg.h" +/* target_siginfo_t must fit in gdbstub's siginfo save area. */ +QEMU_BUILD_BUG_ON(sizeof(target_siginfo_t) > MAX_SIGINFO_LENGTH); + static struct target_sigaction sigact_table[TARGET_NSIG]; static void host_signal_handler(int host_signum, siginfo_t *info, @@ -1184,7 +1187,7 @@ static void handle_pending_signal(CPUArchState *cpu_env, int sig, */ tswap_siginfo(&k->info, &k->info); - sig = gdb_handlesig(cpu, sig, NULL); + sig = gdb_handlesig(cpu, sig, NULL, &k->info, sizeof(k->info)); if (!sig) { sa = NULL; handler = TARGET_SIG_IGN; |