gdbstub: drop CPUEnv from gdb_exit()
gdb_exit() has never needed anything from env and I doubt we are going
to start now.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210108224256.2321-8-alex.bennee@linaro.org>
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index d38ec7a..adc3d21 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -333,7 +333,7 @@
#ifdef CONFIG_GPROF
_mcleanup();
#endif
- gdb_exit(cpu_env, arg1);
+ gdb_exit(arg1);
qemu_plugin_atexit_cb();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
@@ -435,7 +435,7 @@
#ifdef CONFIG_GPROF
_mcleanup();
#endif
- gdb_exit(cpu_env, arg1);
+ gdb_exit(arg1);
qemu_plugin_atexit_cb();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
@@ -514,7 +514,7 @@
#ifdef CONFIG_GPROF
_mcleanup();
#endif
- gdb_exit(cpu_env, arg1);
+ gdb_exit(arg1);
qemu_plugin_atexit_cb();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
diff --git a/gdbstub.c b/gdbstub.c
index aeffdaf..a4718d4 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -3068,7 +3068,7 @@
}
/* Tell the remote gdb that the process has exited. */
-void gdb_exit(CPUArchState *env, int code)
+void gdb_exit(int code)
{
char buf[4];
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 94d8f83..492db0f 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -46,7 +46,7 @@
void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list va);
int use_gdb_syscalls(void);
void gdb_set_stop_cpu(CPUState *cpu);
-void gdb_exit(CPUArchState *, int);
+void gdb_exit(int);
#ifdef CONFIG_USER_ONLY
/**
* gdb_handlesig: yield control to gdb
diff --git a/linux-user/exit.c b/linux-user/exit.c
index 1594015..70b3440 100644
--- a/linux-user/exit.c
+++ b/linux-user/exit.c
@@ -34,6 +34,6 @@
#ifdef CONFIG_GCOV
__gcov_dump();
#endif
- gdb_exit(env, code);
+ gdb_exit(code);
qemu_plugin_atexit_cb();
}
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c
index f7b7bff..93360e2 100644
--- a/target/arm/arm-semi.c
+++ b/target/arm/arm-semi.c
@@ -1101,7 +1101,7 @@
*/
ret = (args == ADP_Stopped_ApplicationExit) ? 0 : 1;
}
- gdb_exit(env, ret);
+ gdb_exit(ret);
exit(ret);
case TARGET_SYS_SYNCCACHE:
/*
diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
index 27600e0..d919245 100644
--- a/target/m68k/m68k-semi.c
+++ b/target/m68k/m68k-semi.c
@@ -195,7 +195,7 @@
args = env->dregs[1];
switch (nr) {
case HOSTED_EXIT:
- gdb_exit(env, env->dregs[0]);
+ gdb_exit(env->dregs[0]);
exit(env->dregs[0]);
case HOSTED_OPEN:
GET_ARG(0);
diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c
index d7a80dd..e508b2f 100644
--- a/target/nios2/nios2-semi.c
+++ b/target/nios2/nios2-semi.c
@@ -215,7 +215,7 @@
args = env->regs[R_ARG1];
switch (nr) {
case HOSTED_EXIT:
- gdb_exit(env, env->regs[R_ARG0]);
+ gdb_exit(env->regs[R_ARG0]);
exit(env->regs[R_ARG0]);
case HOSTED_OPEN:
GET_ARG(0);