qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Warner Losh" <imp@bsdimp.com>
Cc: "Kyle Evans" <kevans@freebsd.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org, "Ilya Leoshkevich" <iii@linux.ibm.com>
Subject: [PATCH v3 05/11] {linux,bsd}-user: Pass pid to gdbserver_fork()
Date: Fri, 16 Feb 2024 14:05:32 +0100	[thread overview]
Message-ID: <20240216130817.369377-6-iii@linux.ibm.com> (raw)
In-Reply-To: <20240216130817.369377-1-iii@linux.ibm.com>

The upcoming follow-fork-mode child support requires knowing the child
pid. Pass it down.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 bsd-user/main.c        | 2 +-
 gdbstub/user.c         | 2 +-
 include/gdbstub/user.h | 2 +-
 linux-user/main.c      | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/bsd-user/main.c b/bsd-user/main.c
index bc233a85cef..e8c658eda5d 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -131,7 +131,7 @@ void fork_end(abi_long pid)
          */
         qemu_init_cpu_list();
         ((TaskState *)thread_cpu->opaque)->ts_tid = qemu_get_thread_id();
-        gdbserver_fork(thread_cpu);
+        gdbserver_fork(pid);
     } else {
         mmap_fork_end(child);
         cpu_list_unlock();
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 5024c670f85..69b9857e5b6 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -375,7 +375,7 @@ static void disable_gdbstub(void)
 }
 
 /* Disable gdb stub for child processes.  */
-void gdbserver_fork(CPUState *cpu)
+void gdbserver_fork(pid_t pid)
 {
     if (!gdbserver_state.init || gdbserver_user_state.fd < 0) {
         return;
diff --git a/include/gdbstub/user.h b/include/gdbstub/user.h
index e33f8d9a9a6..66dd0d319cf 100644
--- a/include/gdbstub/user.h
+++ b/include/gdbstub/user.h
@@ -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(pid_t pid);
 
 /**
  * gdb_syscall_entry() - inform gdb of syscall entry and yield control to it
diff --git a/linux-user/main.c b/linux-user/main.c
index f1a0267816b..ad1c6394520 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -164,7 +164,7 @@ void fork_end(abi_long pid)
         }
         qemu_init_cpu_list();
         ((TaskState *)thread_cpu->opaque)->ts_tid = qemu_get_thread_id();
-        gdbserver_fork(thread_cpu);
+        gdbserver_fork(pid);
     } else {
         cpu_list_unlock();
     }
-- 
2.43.0



  parent reply	other threads:[~2024-02-16 13:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 13:05 [PATCH v3 00/11] gdbstub: Implement follow-fork-mode child Ilya Leoshkevich
2024-02-16 13:05 ` [PATCH v3 01/11] gdbstub: Support disablement in a multi-threaded process Ilya Leoshkevich
2024-02-16 17:04   ` Alex Bennée
2024-02-17 20:21   ` Richard Henderson
2024-02-19 13:05     ` Ilya Leoshkevich
2024-02-19 14:18       ` Ilya Leoshkevich
2024-02-16 13:05 ` [PATCH v3 02/11] {linux,bsd}-user: Update ts_tid after fork() Ilya Leoshkevich
2024-02-16 17:45   ` Alex Bennée
2024-02-17 20:22     ` Richard Henderson
2024-02-16 13:05 ` [PATCH v3 03/11] gdbstub: Introduce gdbserver_fork_start() Ilya Leoshkevich
2024-02-16 17:46   ` Alex Bennée
2024-02-16 13:05 ` [PATCH v3 04/11] {linux,bsd}-user: Pass pid to fork_end() Ilya Leoshkevich
2024-02-16 17:48   ` Alex Bennée
2024-02-17 20:26   ` Richard Henderson
2024-02-16 13:05 ` Ilya Leoshkevich [this message]
2024-02-17 20:27   ` [PATCH v3 05/11] {linux,bsd}-user: Pass pid to gdbserver_fork() Richard Henderson
2024-02-16 13:05 ` [PATCH v3 06/11] gdbstub: Call gdbserver_fork() both in parent and in child Ilya Leoshkevich
2024-02-17 20:30   ` Richard Henderson
2024-02-16 13:05 ` [PATCH v3 07/11] gdbstub: Introduce gdb_handle_query_supported_user() Ilya Leoshkevich
2024-02-17 20:36   ` Richard Henderson
2024-02-16 13:05 ` [PATCH v3 08/11] gdbstub: Introduce gdb_handle_set_thread_user() Ilya Leoshkevich
2024-02-16 13:05 ` [PATCH v3 09/11] gdbstub: Introduce gdb_handle_detach_user() Ilya Leoshkevich
2024-02-16 13:05 ` [PATCH v3 10/11] gdbstub: Implement follow-fork-mode child Ilya Leoshkevich
2024-02-16 13:05 ` [PATCH v3 11/11] tests/tcg: Add two follow-fork-mode tests Ilya Leoshkevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216130817.369377-6-iii@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=alex.bennee@linaro.org \
    --cc=imp@bsdimp.com \
    --cc=kevans@freebsd.org \
    --cc=laurent@vivier.eu \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).