From: Michael Snyder <Michael.Snyder@palmsource.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sourceware.org
Subject: Re: Single stepping and threads
Date: Thu, 30 Nov 2006 23:22:00 -0000 [thread overview]
Message-ID: <1164928952.14460.22.camel@localhost.localdomain> (raw)
In-Reply-To: <20061129052942.GA16029@nevyn.them.org>
On Wed, 2006-11-29 at 00:29 -0500, Daniel Jacobowitz wrote:
> Ulrich's message earlier reminded me of something I've been meaning to
> discuss for a while. This isn't specific to software single stepping,
> but to single step in general for threaded programs.
>
> We have a knob "set scheduler-locking". It offers three values:
>
> Set mode for locking scheduler during execution.
> off == no locking (threads may preempt at any time)
> on == full locking (no thread except the current thread may run)
> step == scheduler locked during every single-step operation.
> In this mode, no other thread may run during a step command.
> Other threads may run while stepping over a function call
> ('next').
>
> The default is "off". Should it be "step" instead? The example I used
> to use whenever someone asked me about this was single stepping through
> something like a barrier or mutex; if other threads don't run, you
> won't advance, because no other thread will have a chance to release
> the lock. That much is true. But it seems like a reasonable thing to
> document and reference "set scheduler-locking". And having threads
> run during single stepping has surprised a lot of users who've asked
> me about the current behavior.
>
> What do you all think?
I implemented "set scheduler-locking", at user request.
The behavior that the users were requesting is "step".
I left the default at "off", because that was gdb's
original behavior, and I didn't want to change it
out from under people without notice.
It may very well be time to change the default.
>
> One reason I've procrastinated bringing this up is that set
> scheduler-locking off, the current default, has a lot more nasty
> corner cases that I've meant to look into; if step becomes the default,
> I suspect more of those will linger unfixed. But users won't encounter
> them as often, which is much like fixing them :-)
>
> A related issue is the tendency of "step" to let other threads run even
> in "set scheduler-locking step". For instance:
>
> - We use a breakpoint to skip the prologue of a function when we step
> into it. This could either be implemented with a stepping range
> instead, or else we could continue to use the breakpoint but honor
> the scheduler locking mode anyway, but the current behavior is
> silly.
>
> - "step" acts like "next" when stepping over a function without debug
> info. Should we honor "set scheduler-locking step" when doing
> this?
>
prev parent reply other threads:[~2006-11-30 23:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-29 5:29 Daniel Jacobowitz
2006-11-29 5:58 ` Joel Brobecker
2006-11-29 13:25 ` Daniel Jacobowitz
2006-11-29 16:38 ` Joel Brobecker
2006-11-30 13:54 ` Daniel Jacobowitz
2006-11-30 23:36 ` Michael Snyder
2006-11-30 23:54 ` Joel Brobecker
2006-12-01 1:02 ` Daniel Jacobowitz
2006-12-01 22:43 ` Michael Snyder
2006-12-02 16:27 ` Rob Quill
2006-12-02 16:33 ` Daniel Jacobowitz
2006-12-02 16:36 ` Joel Brobecker
2006-12-04 19:50 ` Michael Snyder
2006-11-30 8:44 ` Robert Dewar
2006-11-30 23:32 ` Michael Snyder
2006-11-30 23:26 ` Michael Snyder
2006-11-30 23:31 ` Joel Brobecker
2006-11-29 12:41 ` Mark Kettenis
2006-11-29 13:36 ` Daniel Jacobowitz
2006-11-30 23:38 ` Michael Snyder
2006-11-30 23:22 ` Michael Snyder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1164928952.14460.22.camel@localhost.localdomain \
--to=michael.snyder@palmsource.com \
--cc=drow@false.org \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox