This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Multi-threaded single-step vs. breakpoint problems (prepare_to_proceed)
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: Michael dot Snyder at access-company dot com
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 26 Jul 2007 00:38:29 +0200 (CEST)
- Subject: Re: Multi-threaded single-step vs. breakpoint problems (prepare_to_proceed)
Michael Snyder wrote:
>> The main problem is related to switching to a different thread
>> at the user-interface level, and then attempting to step.
>
>Unfortunately, gdb doesn't do what you probably think it does.
>
>Switching to a different thread (focus) within gdb has no
>effect on the operating system's scheduling behavior. In
>particular it has no effect on which thread will run next
>when you say step or continue.
I'm not sure I understand what you're saying here, sorry.
I'm aware that the scheduling behaviour is not directly
influenced by GDB, and that generally (unless you use the
set scheduler-locking command) all threads will continue
to run.
However, it is still the case the GDB decides which thread
it wants to *step*. In the case of hardware single-stepping,
the linux-nat target for example makes sure that only the
currently selected thread gets a PT_SINGLESTEP, while the
others get a PT_CONT. In the case of software single-step,
GDB makes sure to ignore all other threads but the one it
is currently stepping, if they accidentally run onto a
single-step sofware breakpoint. In fact, I don't even see
how it would make sense to talk about "single-stepping"
without referring to a particular thread.
The problem I was raising in my original mail was refering
to this thread that GDB considers to be currently single-
stepping. In fact, the problem -as I see it- is that GDB
under certain circumstances selects (what I'd consider)
the wrong thread for this purpose.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com