This is the mail archive of the gdb@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: Displaced stepping not always working as expected


On Wednesday 21 September 2011 16:39:06, Yao Qi wrote:
> On 09/21/2011 06:23 PM, Pedro Alves wrote:
> > On Wednesday 21 September 2011 07:08:43, Yao Qi wrote:
> >> The line of log looks strange to me.  Why LWP 763 switch to itself?
> > 
> > This is non-stop mode, and fetch_inferior_event always prints the
> > "context switch":
> > 
> >   if (non_stop
> >       && ecs->ws.kind != TARGET_WAITKIND_IGNORE
> >       && ecs->ws.kind != TARGET_WAITKIND_EXITED
> >       && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED)
> >     /* In non-stop mode, each thread is handled individually.  Switch
> >        early, so the global state is set correctly for this
> >        thread.  */
> >     context_switch (ecs->ptid);
> > 
> 
> Pedro,
> I don't quite understand this piece of code and the comments here, but I
> think that debug log "context switch from Thread A to Thread A" is not
> useful, if not confusing.  

I guess you'd have to back to a time where context_switch really did more
than just switching the thread.  It used to swap a _bunch_ of globals
with the copies in the thread structure.  It was horrible.

> How about this patch?

Sure.  Okay.

-- 
Pedro Alves


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