gdbstub: Change syscall callback argument to CPUState
Callback implementations were specific to arm and m68k, so can easily cast to ARMCPU and M68kCPU respectively. Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
6227881415
commit
9e0c5422cf
@ -2205,7 +2205,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
|
|||||||
p++;
|
p++;
|
||||||
type = *p;
|
type = *p;
|
||||||
if (s->current_syscall_cb) {
|
if (s->current_syscall_cb) {
|
||||||
s->current_syscall_cb(s->c_cpu, ret, err);
|
s->current_syscall_cb(ENV_GET_CPU(s->c_cpu), ret, err);
|
||||||
s->current_syscall_cb = NULL;
|
s->current_syscall_cb = NULL;
|
||||||
}
|
}
|
||||||
if (type == 'C') {
|
if (type == 'C') {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#define GDB_WATCHPOINT_ACCESS 4
|
#define GDB_WATCHPOINT_ACCESS 4
|
||||||
|
|
||||||
#ifdef NEED_CPU_H
|
#ifdef NEED_CPU_H
|
||||||
typedef void (*gdb_syscall_complete_cb)(CPUArchState *env,
|
typedef void (*gdb_syscall_complete_cb)(CPUState *cpu,
|
||||||
target_ulong ret, target_ulong err);
|
target_ulong ret, target_ulong err);
|
||||||
|
|
||||||
void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
|
void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...);
|
||||||
|
@ -122,8 +122,10 @@ static target_ulong arm_semi_syscall_len;
|
|||||||
static target_ulong syscall_err;
|
static target_ulong syscall_err;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void arm_semi_cb(CPUARMState *env, target_ulong ret, target_ulong err)
|
static void arm_semi_cb(CPUState *cs, target_ulong ret, target_ulong err)
|
||||||
{
|
{
|
||||||
|
ARMCPU *cpu = ARM_CPU(cs);
|
||||||
|
CPUARMState *env = &cpu->env;
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifdef CONFIG_USER_ONLY
|
||||||
TaskState *ts = env->opaque;
|
TaskState *ts = env->opaque;
|
||||||
#endif
|
#endif
|
||||||
@ -152,8 +154,10 @@ static void arm_semi_cb(CPUARMState *env, target_ulong ret, target_ulong err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void arm_semi_flen_cb(CPUARMState *env, target_ulong ret, target_ulong err)
|
static void arm_semi_flen_cb(CPUState *cs, target_ulong ret, target_ulong err)
|
||||||
{
|
{
|
||||||
|
ARMCPU *cpu = ARM_CPU(cs);
|
||||||
|
CPUARMState *env = &cpu->env;
|
||||||
/* The size is always stored in big-endian order, extract
|
/* The size is always stored in big-endian order, extract
|
||||||
the value. We assume the size always fit in 32 bits. */
|
the value. We assume the size always fit in 32 bits. */
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
|
@ -161,8 +161,11 @@ static void m68k_semi_return_u64(CPUM68KState *env, uint64_t ret, uint32_t err)
|
|||||||
|
|
||||||
static int m68k_semi_is_fseek;
|
static int m68k_semi_is_fseek;
|
||||||
|
|
||||||
static void m68k_semi_cb(CPUM68KState *env, target_ulong ret, target_ulong err)
|
static void m68k_semi_cb(CPUState *cs, target_ulong ret, target_ulong err)
|
||||||
{
|
{
|
||||||
|
M68kCPU *cpu = M68K_CPU(cs);
|
||||||
|
CPUM68KState *env = &cpu->env;
|
||||||
|
|
||||||
if (m68k_semi_is_fseek) {
|
if (m68k_semi_is_fseek) {
|
||||||
/* FIXME: We've already lost the high bits of the fseek
|
/* FIXME: We've already lost the high bits of the fseek
|
||||||
return value. */
|
return value. */
|
||||||
|
Loading…
Reference in New Issue
Block a user