infrun.c: Split handle_inferior_event further.
authorPedro Alves <palves@redhat.com>
Thu, 14 Nov 2013 19:43:27 +0000 (19:43 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 14 Nov 2013 19:51:50 +0000 (19:51 +0000)
commit4f5d7f635cd1dd81575edb35395272ee3d535502
tree3c9cb5fa87c5d0122fb8d2bfe20840b672467fdb
parent47591c29add16c520c7bc2c7ace227deeb08f4a5
infrun.c: Split handle_inferior_event further.

After the previous patches, we only ever reach the code after the
initial 'switch (ecs->ws.kind)' switch for TARGET_WAITKIND_STOPPED.
We can now factor out all that to its own function.

Unfortunately, stepped_after_stopped_by_watchpoint needed to move to
the ecs.  I think that indicates a state machine bug -- no event other
than TARGET_WAITKIND_STOPPED indicates a single-step actually
finished.  TARGET_WAITKIND_SYSCALL_XXX, TARGET_WAITKIND_FORK, etc. are
all events that are triggered from the kernel, _within_ a syscall,
IOW, from userspace's perspective, halfway through an instruction
being executed.  This might actually matter for the syscall events, as
syscalls can change memory (and thus trigger watchpoints).

gdb/
2013-11-14  Pedro Alves  <palves@redhat.com>

* infrun.c (struct execution_control_state)
<stepped_after_stopped_by_watchpoint>: New field.
(get_inferior_stop_soon): New function.
(handle_inferior_event): 'stepped_after_stopped_by_watchpoint' was
moved to struct execution_control_state -- adjust.  Use
get_inferior_stop_soon.  Split TARGET_WAITKIND_STOPPED handling to
new function.
(handle_signal_stop): New function, factored out from
handle_inferior_event.
gdb/ChangeLog
gdb/infrun.c