]> Git Repo - qemu.git/commitdiff
gdbstub: Change gdbserver_fork() to accept cpu instead of env
authorPeter Crosthwaite <[email protected]>
Wed, 24 Jun 2015 02:31:16 +0000 (19:31 -0700)
committerAndreas Färber <[email protected]>
Thu, 9 Jul 2015 13:20:40 +0000 (15:20 +0200)
All callsites to this function navigate the cpu->env_ptr only for the
function to take the env ptr back to the original cpu ptr. Change the
function to just pass in the CPU pointer instead. Removes a core code
usage of ENV_GET_CPU() (in gdbstub.c).

Cc: Riku Voipio <[email protected]>
Reviewed-by: Andreas Färber <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Signed-off-by: Peter Crosthwaite <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
bsd-user/main.c
gdbstub.c
include/exec/gdbstub.h
linux-user/main.c

index ba0b9981f5f53c3909e1155966cfbbb301c04c82..45a1436dd100524c61ff83324eb86cfeadcb8690 100644 (file)
@@ -92,7 +92,7 @@ void fork_start(void)
 void fork_end(int child)
 {
     if (child) {
-        gdbserver_fork((CPUArchState *)thread_cpu->env_ptr);
+        gdbserver_fork(thread_cpu);
     }
 }
 
index 0fa8dd8352d5d0c363ebae57766b816bf1aefd54..aa5ba5174d41b96cbd87e001ddad586bca1cc1ac 100644 (file)
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1629,9 +1629,8 @@ int gdbserver_start(int port)
 }
 
 /* Disable gdb stub for child processes.  */
-void gdbserver_fork(CPUArchState *env)
+void gdbserver_fork(CPUState *cpu)
 {
-    CPUState *cpu = ENV_GET_CPU(env);
     GDBState *s = gdbserver_state;
 
     if (gdbserver_fd < 0 || s->fd < 0) {
index a608a26c30e29fa57409cfe4bd6856c4f4a5145a..05f57c24328c5c35a758d219b7fab93620493665 100644 (file)
@@ -22,7 +22,7 @@ void gdb_exit(CPUArchState *, int);
 int gdb_queuesig (void);
 int gdb_handlesig(CPUState *, int);
 void gdb_signalled(CPUArchState *, int);
-void gdbserver_fork(CPUArchState *);
+void gdbserver_fork(CPUState *);
 #endif
 /* Get or set a register.  Returns the size of the register.  */
 typedef int (*gdb_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
index 6c5c2effbf5672070674e30a1633d259f27ecc0b..2b4b276356e9b635a6d63a4510fda1cc42460572 100644 (file)
@@ -130,7 +130,7 @@ void fork_end(int child)
         pthread_cond_init(&exclusive_cond, NULL);
         pthread_cond_init(&exclusive_resume, NULL);
         pthread_mutex_init(&tcg_ctx.tb_ctx.tb_lock, NULL);
-        gdbserver_fork((CPUArchState *)thread_cpu->env_ptr);
+        gdbserver_fork(thread_cpu);
     } else {
         pthread_mutex_unlock(&exclusive_lock);
         pthread_mutex_unlock(&tcg_ctx.tb_ctx.tb_lock);
This page took 0.037411 seconds and 4 git commands to generate.