This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Make continuations per-thread.


A Friday 02 May 2008 16:19:06, Ulrich Weigand wrote:
> Note that current GDB is really broken when it comes to handling
> step / next operations that are interrupted by an event in some
> other thread.  There is some code to "context switch" the stepping
> status, but this appears to be incomplete, and leads to inconsistent
> results; e.g. GDB can run into internal assertion failures like
> "Thread Event Breakpoint: gdb should not stop!"  (see PR 2250).
>
> I'm currently carrying the following patch in our GDB builds that
> fixes the issue be ensuring:
>

Thanks for showing us that.

> - If the step operation is interrupted by an *internal* breakpoint
>   that is handled transparently, the operation continues in a
>   transparent and consistent manner after the breakpoint was handled.
>
> - If the step operation is interrupted by an *explicit* breakpoint
>   that breaks to a user prompt, it is completely cancelled.  It is
>   then up to the user how to continue from the prompt.
>

A agree that this behaviour is sensible in all-stop
(what we have now) mode.  I tried your patch, and the bahaviour
makes sense to me.

Note, however, that in non-stop mode, we need to retain the
stepping state per-thread (and actually make a
few more things per-thread), so we'd like to keep the variables
you're removing from struct thread_info in some form.

http://sourceware.org/ml/gdb-patches/2008-05/msg00232.html

> Now it looks like the second point is in conflict to the goal you
> are proposing here (namely, that even after a user prompt, the
> interrupted step/next/finish still continues in some manner).
> I'm not sure how this could be accomplished ...
>

Our major goal is to have that in non-stop mode.  It seemed
we would win some of it for free in all-stop mode, but it
turned out it isn't so.

Thanks!

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]