non-stop linux native, unbreak -exec-interrupt --all, add an MI test

Pedro Alves pedro@codesourcery.com
Sun Sep 14 16:13:00 GMT 2008


On Friday 22 August 2008 21:21:30, Pedro Alves wrote:
> This patch unbreaks "interrupt -a" in linux native, non-stop mode.
>
> The issue here is that we currently are using SIGINT to interrupt
> all lwps, by sending each one a signal, and this goes against
> the logic in place to filter out SIGINT's when they are delivered
> to each lwp in the process group.
>
> I've also added a new MI testcase to explicitly test that
> the -exec-interrupt --all works as expected.

...

> While doing that, I noticed that mi_expect_stop would sometimes
> match the  wrong thing or eat to much input if input
> came intermingled with other notifications and warnings.

...

> I've fixed it by removing the trailing anchor and making the regex match
> all input before the *stopped notification non-greedily, so
> it matches on the first *stopped notification it sees, and only consumes
> one notification.  Perhaps there another way to do this?

... Daniel properly fixed this bit (thanks!), so here's an updated patch.

The changes to -exec-run bit are because I saw this failure a couple of times:

expect: does "-exec-run\r\n=thread-created,id="1"\r\n^running\r\n*running,thread-id="1"\r\n(gdb) \r\n~"[Thread debugging using libthread_db enabled]\n"\r\n" (spawn_id exp7) match 
regular expression ".*\^running.*[(]gdb[)] \r\n$"? no

I saw that in mi-nsintrall.exp, but that bit was copied from mi-nonstop.exp, so
it gets the same fix.

Does it look OK?  I couldn't get it to fail on x86_64-unknown-linux-gnu -m32,
in a couple of hundred runs.  I did see a failure once on -m64, that I
couldn't reproduce anymore, that looked like a real bug -- a couple of
threads somehow never made it to the initial thread_function breakpoint,
resulting in cascaded timeouts.

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nonstop_interrupt_all.diff
Type: text/x-diff
Size: 15546 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080914/0cd22340/attachment.bin>


More information about the Gdb-patches mailing list