[RFC: 1/9] No context-switching in all-stop mode

Pedro Alves pedro@codesourcery.com
Sat Aug 16 15:31:00 GMT 2008


This patch removes all the globals that are context switched in
all-stop mode.  These are globals that are already per thread currently.

I chose to split this patch from the following ones, since
the globals I'll be removing in the following patches, are per-thread
in non-stop, but global in all-stop.  After the series, they'll
all be converted to be per-thread.

Things to note in the patch:

 - inferior_thread () is a function that returns the thread_info object
   associated with inferior_ptid.  This is a convenience function, whose
   job is to assert that the returned object is not NULL.

 - The patch actually fixes a bug, where in all-stop, we would leave
   behind a step-resume breakpoint if execution stopped in another
   thread other than the one we were stepping.  Afterwards, when the
   user resumed, the old step-resume breakpoint would be spuriously
   hit.

 - I've added "struct thread_info *event_thread" to ecs, so
   handle_inferior_event has handy access to the thread_info of
   the thread that had the last event.

 - I chose to not rename any member of thread_info, to ease the
   review, and to prevent myself from messing up.

   You'll notice that this brings back trap_expected:

   stepping_over_breakpoint -> thread_info->trap_expected
   ecs->stepping_over_breakpoint -> thread_info->stepping_over_breakpoint

   This is the same mapping as before, I'm not changing it.  Naturaly,
   we can't have both variables with the same name in thread_info.

   (I'm of the opinion that stepping_over_breakpoint and
   ecs->stepping_over_breakpoint are currently too similarly named, and
   that although they mean different things, can be easilly misread.)

 - Following a child of a fork means we have to copy a bit of stepping
   state around from the parent thread to the child thread.  I'd like to pack
   the high level stepping state (relative to a user command) into own single
   copiable unit, but I chose to not do it now, as that is not a functional
   change, but a cleanup instead.

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001-allstop_no_context_switch.diff
Type: text/x-diff
Size: 63578 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080816/aeb5b178/attachment.bin>


More information about the Gdb-patches mailing list