]> git.proxmox.com Git - mirror_qemu.git/commitdiff
{linux,bsd}-user: Pass pid to gdbserver_fork()
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 5 Mar 2024 12:09:43 +0000 (12:09 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 6 Mar 2024 12:35:19 +0000 (12:35 +0000)
The upcoming follow-fork-mode child support requires knowing the child
pid. Pass it down.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20240219141628.246823-7-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240305121005.3528075-8-alex.bennee@linaro.org>

bsd-user/main.c
gdbstub/user.c
include/gdbstub/user.h
linux-user/main.c

index fca9b3020438bf54ce0d7662e563ca18ca5c91ed..0dbd1cf88013fc709489a9ea4a0513f80031650b 100644 (file)
@@ -138,7 +138,7 @@ void fork_end(pid_t pid)
          */
         qemu_init_cpu_list();
         get_task_state(thread_cpu)->ts_tid = qemu_get_thread_id();
-        gdbserver_fork(thread_cpu);
+        gdbserver_fork(thread_cpu, pid);
     } else {
         mmap_fork_end(child);
         cpu_list_unlock();
index 536fb43b03e810d1e51c73b81c4979a752253883..c61e1a0d1f659df285eef8722744db542ffc0036 100644 (file)
@@ -375,7 +375,7 @@ static void disable_gdbstub(CPUState *thread_cpu)
 }
 
 /* Disable gdb stub for child processes.  */
-void gdbserver_fork(CPUState *cpu)
+void gdbserver_fork(CPUState *cpu, pid_t pid)
 {
     if (!gdbserver_state.init || gdbserver_user_state.fd < 0) {
         return;
index e33f8d9a9a6ccaa496cb3d4c5958b524a32f679a..3f9f45946e0d8b8ffdc0b23b26d2e44574d6af50 100644 (file)
@@ -54,7 +54,7 @@ void gdbserver_fork_start(void);
  * gdbserver_fork() - disable gdb stub for child processes.
  * @cs: CPU
  */
-void gdbserver_fork(CPUState *cs);
+void gdbserver_fork(CPUState *cs, pid_t pid);
 
 /**
  * gdb_syscall_entry() - inform gdb of syscall entry and yield control to it
index cab95f5b0aa25d34f1cdcdd4be285f8779294edb..70314e0ab6ae4fc82f5cf62f1de45e7591478c43 100644 (file)
@@ -165,7 +165,7 @@ void fork_end(pid_t pid)
         }
         qemu_init_cpu_list();
         get_task_state(thread_cpu)->ts_tid = qemu_get_thread_id();
-        gdbserver_fork(thread_cpu);
+        gdbserver_fork(thread_cpu, pid);
     } else {
         cpu_list_unlock();
     }