Bug 10449 - continues main thread when breaking into a secondary thread
Summary: continues main thread when breaking into a secondary thread
Status: RESOLVED INVALID
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: 6.8
: P2 normal
Target Milestone: 6.8
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-25 18:25 UTC by Andreas Pakulat
Modified: 2009-11-16 22:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Pakulat 2009-07-25 18:25:24 UTC
I've got a small test application here creating a GUI in the main thread and
starting two new threads within the window constructor. In both threads there's
a sleep() (one with 2 the other with 4 seconds) to keep them running a bit.

I then put a breakpoint at the start of the constructor and into the 4-second-
seems to continue the main thread once the breakpoint in the 4-second-sleep
thread is hit. So basically the order is:

create and start first extra thread
<n>
create and start second extra thread
<n>
some gui code
<n>
break into second extra thread
<n>
sleep(4)
<n>

At this point the gui from the main thread comes up, which only happens if the
main thread is continue'd and not halted anymore.
Comment 1 Tom Tromey 2009-07-26 05:07:43 UTC
Yes, a "next" will resume all other threads.
See "set scheduler-locking" for your options here.
(I forget offhand if this was in 6.8 or whether it is only in CVS gdb.)
Comment 2 Pedro Alves 2009-11-16 22:28:47 UTC
scheduler-locking was added to gdb over 10 years ago.

I'm closing this.  Please reopen if you have more info indicating a problem.