[non-stop] 00/10 non-stop mode

Pedro Alves
2008-06-15T22:58:09Z

[ 3rd time I'm sending this. Don't know why, but it doesn't seem
to want to go through, while the rest of the series went ok. Maybe
because I had an attachment with .cmd extension. Here are the
contents of the nonstop.cmd file mentioned in the body of the message:

cat /home/pedro/nonstop.cmd
# GDB Command file to turn on non-stop debugging mode.

# Enable the async interface
maint set linux-async 1

# With non-stop, breakpoints have to be always inserted
set breakpoint always-inserted 1

# If using the CLI, pagination breaks non-stop
set pagination off

# Finally, turn it on!
set non-stop 1
]

Hi,

Here goes a new series of non-stop debugging support, core
and linux native (x86, and probably PowerPC once Luis' displaced
stepping patch for PPC goes in).

The series now has no uncommited dependencies, so you
can now easilly pick it.

There are still unresolved ongoing discussions on how to
expose target support for non-stop, but that shouldn't
prevent this series to go in.

Contrary to the previous series, this series does add the
support for GDB to *not* switch threads automatically on
events (in non-stop mode), and implements the support for
exited threads. I'd say it's in commit-state, except for
any rework due to review, of course.

MI/non-stop is our main focus, but CLI works a bit
too, although there are a few rough UI edges.

To activate nonstop mode, I use the attached nonstop.cmd
command file, with 'gdb -x nonstop.cmd program'.

I've tested the full series on x86-pc-linux-gnu
async/sync/all-stop to make sure nothing broke, and
also on arm-linux to make sure software single-stepping
didn't brake, and also on cygwin, to test at least
a non-linux target.

Here's the looks of non-stop mode in the CLI, debugging
a multi-threaded app:

(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)

--
Pedro Alves