[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/11] {linux,bsd}-user: Update ts_tid after fork()
From: |
Ilya Leoshkevich |
Subject: |
[PATCH v2 02/11] {linux,bsd}-user: Update ts_tid after fork() |
Date: |
Mon, 5 Feb 2024 12:22:16 +0100 |
Currently ts_tid contains the parent tid after fork(), which is not
correct. So far it has not affected anything, but the upcoming
follow-fork-mode child support relies on the correct value, so fix it.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
bsd-user/main.c | 1 +
linux-user/main.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index e5efb7b8458..4140edc8311 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -127,6 +127,7 @@ void fork_end(int child)
* state, so we don't need to end_exclusive() here.
*/
qemu_init_cpu_list();
+ ((TaskState *)thread_cpu->opaque)->ts_tid = qemu_get_thread_id();
gdbserver_fork(thread_cpu);
} else {
mmap_fork_end(child);
diff --git a/linux-user/main.c b/linux-user/main.c
index 74b2fbb3938..e6427d72332 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -160,6 +160,7 @@ void fork_end(int child)
}
}
qemu_init_cpu_list();
+ ((TaskState *)thread_cpu->opaque)->ts_tid = qemu_get_thread_id();
gdbserver_fork(thread_cpu);
} else {
cpu_list_unlock();
--
2.43.0
- [PATCH v2 00/11] gdbstub: Implement follow-fork-mode child, Ilya Leoshkevich, 2024/02/05
- [PATCH v2 01/11] gdbstub: Support disablement in a multi-threaded process, Ilya Leoshkevich, 2024/02/05
- [PATCH v2 03/11] gdbstub: Introduce gdbserver_fork_start(), Ilya Leoshkevich, 2024/02/05
- [PATCH v2 04/11] {linux,bsd}-user: Pass pid to fork_end(), Ilya Leoshkevich, 2024/02/05
- [PATCH v2 06/11] gdbstub: Call gdbserver_fork() both in parent and in child, Ilya Leoshkevich, 2024/02/05
- [PATCH v2 02/11] {linux,bsd}-user: Update ts_tid after fork(),
Ilya Leoshkevich <=
- [PATCH v2 05/11] {linux,bsd}-user: Pass pid to gdbserver_fork(), Ilya Leoshkevich, 2024/02/05
- [PATCH v2 10/11] gdbstub: Implement follow-fork-mode child, Ilya Leoshkevich, 2024/02/05
- [PATCH v2 08/11] gdbstub: Introduce gdb_handle_set_thread_user(), Ilya Leoshkevich, 2024/02/05
- [PATCH v2 09/11] gdbstub: Introduce gdb_handle_detach_user(), Ilya Leoshkevich, 2024/02/05
- [PATCH v2 11/11] tests/tcg: Add two follow-fork-mode tests, Ilya Leoshkevich, 2024/02/05
- [PATCH v2 07/11] gdbstub: Introduce gdb_handle_query_supported_user(), Ilya Leoshkevich, 2024/02/05