Single stepping and threads
Daniel Jacobowitz
drow@false.org
Fri Dec 1 01:02:00 GMT 2006
On Thu, Nov 30, 2006 at 03:55:15PM -0800, Joel Brobecker wrote:
> > Default on would be a disaster -- most threaded programs would
> > not behave even remotely the same under the debugger as they would
> > solo.
> >
> > In fact, many would deadlock almost immediately.
>
> Something just occured to me that was clear but maybe isn't. Is the
> scheduling affected when you do a "continue"? I assumed that, if you
> do a "run" or "continue", the actual scheduling policy is irrelevant,
> and all threads are resumed.
No, the options are basically never, PTRACE_SINGLESTEP only, or
PTRACE_SINGLESTEP and PTRACE_CONT. With "on", no other thread ever
runs. It's only useful in very specific cases.
An option different to any of the ones we've discussed so far, but that
I think you're expecting from the current "on", would be one that only
applies to the step and next commands. I still think "step" is more
useful a default than we have now, though.
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb
mailing list