This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC] 00/10 non-stop support (and linux native support)
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 6 May 2008 16:45:44 +0100
- Subject: [RFC] 00/10 non-stop support (and linux native support)
Hi,
This series adds inferior control support for non-stop mode, and
then adds linux native support on top.
There are still ongoing discussions on how to activate and
expose to frontends the non-stop support. MI seems to getting
stable enough now.
This series adds no docs yet, as they are yet to be writen, but
we'll get to it.
In the meantime, I'd like to get comments on the rest of the
code, and maybe even a couple of testers.
One patch I'm not adding in this series , is the support
for GDB to *not* switch threads automatically on events
(in non-stop mode), and what to do when the current thread exits.
I'll post those separatelly.
MI/non-stop is our main focus, but CLI works a bit too, although
there are a lot of rough edges:
Debugging a multi-threaded app has these looks:
(gdb) r&
Starting program: /home/pedro/gdb/tests/threads32
(gdb) [Thread debugging using libthread_db enabled]
[New LWP 23453]
[New LWP 23454]
info threads
3 Thread 0xf7603b90 (LWP 23454) (running)
2 Thread 0xf7e04b90 (LWP 23453) (running)
* 1 LWP 23450 (running)
(gdb) thread 2
[Switching to thread 2 (Thread 0xf7e04b90 (LWP 23453))] (running)
(gdb) interrupt
(gdb)
Program received signal SIGINT, Interrupt.
[Switching to Thread 0xf7e04b90 (LWP 23453)]
0xffffe410 in __kernel_vsyscall ()
b 63
Breakpoint 1 at 0x80485a6: file threads.c, line 63.
(gdb) info threads
During symbol reading, incomplete CFI data; unspecified registers (e.g., eax)
at 0xffffe411.
3 Thread 0xf7603b90 (LWP 23454) (running)
* 2 Thread 0xf7e04b90 (LWP 23453) 0xffffe410 in __kernel_vsyscall ()
1 Thread 0xf7e056b0 (LWP 23450) (running)
(gdb) c&
Continuing.
(gdb)
Breakpoint 1, thread_function0 (arg=0x0) at threads.c:63
63 (*myp) ++;
info threads
3 Thread 0xf7603b90 (LWP 23454) (running)
* 2 Thread 0xf7e04b90 (LWP 23453) thread_function0 (arg=0x0) at threads.c:63
1 Thread 0xf7e056b0 (LWP 23450) (running)
(gdb) b 80
Breakpoint 2 at 0x80485f0: file threads.c, line 80.
(gdb) [Switching to Thread 0xf7603b90 (LWP 23454)]
Breakpoint 2, thread_function1 (arg=0x1) at threads.c:80
80 (*myp) ++;
info threads
* 3 Thread 0xf7603b90 (LWP 23454) thread_function1 (arg=0x1) at threads.c:80
2 Thread 0xf7e04b90 (LWP 23453) thread_function0 (arg=0x0) at threads.c:63
1 Thread 0xf7e056b0 (LWP 23450) (running)
(gdb)
The series is layed out as:
001 Add "executing" property
Adding an "executing" property to GDB's view of threads.
002 Don't trim ptids on fork/exec
Don't trim ptids on follow fork/vfork/exec, so the previous
patch works in those cases.
003 Add non-stop global
Add a non_stop global, and associated "set/show non-stop"
commands. Split out or core non-stop, because the following
patch uses it.
004 per-thread commands in non-stop mode
In non-stop mode, we can have one exec command active per-thread,
and they're independant, while in all-stop, there can only be one,
and it's global. This adds the necessary context-switching glue.
005 Expose context_switch
In non-stop mode, whenever we switch threads, and because each
is handled independently of the others, we need to
context-switch outside of infrun.c (e.g., "thread n" command,
thread apply all, "continue --all".)
006 Don't rely on ecs->wait_for_more before fetching the event
ecs->wait_for_more is being checked before fetching the pending
event from the target, and if not, then we're clearing some state.
This patch avoids the need to context switching that variable, by
moving that code in questiong to proceed.
007 non-stop inferior control
This adds the inferior control in non-stop mode.
008 Enable thread commands
Now that "info threads" and "thread" are "running" thread aware,
enable them.
009 Add "continue --all"
This adds "continue --all" for non-stop mode.
010 non-stop for linux native
Adds non-stop support for linux native.
--
Pedro Alves