gdbstub: split out softmmu/user specifics for syscall handling

Most of the syscall code is config agnostic aside from the size of
target_ulong. In preparation for the next patch move the final bits
of specialisation into the appropriate user and softmmu helpers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230302190846.2593720-26-alex.bennee@linaro.org>
Message-Id: <20230303025805.625589-26-richard.henderson@linaro.org>
This commit is contained in:
Alex Bennée 2023-03-02 18:58:01 -08:00
parent 4692a86f1c
commit 131f387d74
4 changed files with 34 additions and 24 deletions

View file

@ -103,6 +103,20 @@ static void gdb_chr_event(void *opaque, QEMUChrEvent event)
}
}
/*
* In softmmu mode we stop the VM and wait to send the syscall packet
* until notification that the CPU has stopped. This must be done
* because if the packet is sent now the reply from the syscall
* request could be received while the CPU is still in the running
* state, which can cause packets to be dropped and state transition
* 'T' packets to be sent while the syscall is still being processed.
*/
void gdb_syscall_handling(const char *syscall_packet)
{
vm_stop(RUN_STATE_DEBUG);
qemu_cpu_kick(gdbserver_state.c_cpu);
}
static void gdb_vm_state_change(void *opaque, bool running, RunState state)
{
CPUState *cpu = gdbserver_state.c_cpu;