qemu-patch-raspberry4/linux-user
Nathan Froyd 1e9fa73016 fix gdbstub support for multiple threads in usermode, v3
When debugging multi-threaded programs, QEMU's gdb stub would report the
correct number of threads (the qfThreadInfo and qsThreadInfo packets).
However, the stub was unable to actually switch between threads (the T
packet), since it would report every thread except the first as being
dead.  Furthermore, the stub relied upon cpu_index as a reliable means
of assigning IDs to the threads.  This was a bad idea; if you have this
sequence of events:

initial thread created
new thread #1
new thread #2
thread #1 exits
new thread #3

thread #3 will have the same cpu_index as thread #1, which would confuse
GDB.  (This problem is partly due to the remote protocol not having a
good way to send thread creation/destruction events.)

We fix this by using the host thread ID for the identifier passed to GDB
when debugging a multi-threaded userspace program.  The thread ID might
wrap, but the same sort of problems with wrapping thread IDs would come
up with debugging programs natively, so this doesn't represent a
problem.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
2009-06-04 10:04:49 +01:00
..
alpha
arm
cris
i386
m68k
microblaze microblaze: Add syscall, signal and termbits defs for linux-user. 2009-05-26 21:10:21 +02:00
mips
mips64
mipsn32
ppc linux-user: ppc signal handling 2009-05-16 01:36:12 +04:00
sh4
sparc
sparc64
x86_64
elfload.c microblaze: linux-user support. 2009-05-26 21:10:28 +02:00
elfload32.c
envlist.c
envlist.h
errno_defs.h
flat.h
flatload.c Replace gcc variadic macro extension with C99 version 2009-05-13 17:53:17 +00:00
ioctls.h
linux_loop.h
linuxload.c
m68k-sim.c
main.c microblaze: linux-user support. 2009-05-26 21:10:28 +02:00
mmap.c
path.c
qemu-types.h
qemu.h Avoid implicit truncation compiler warnings 2009-05-19 15:42:39 +01:00
signal.c microblaze: linux-user support. 2009-05-26 21:10:28 +02:00
socket.h
strace.c
strace.list
syscall.c fix gdbstub support for multiple threads in usermode, v3 2009-06-04 10:04:49 +01:00
syscall_defs.h microblaze: linux-user support. 2009-05-26 21:10:28 +02:00
syscall_types.h
uaccess.c
vm86.c