Now that all ecs->random_signal handing is always done before the
'process_event_stop_test' label, we can easily make that a real
function and actually give it a describing comment that somewhat makes
sense.
Reindenting the new function will be handled in a follow up patch.
2013-10-28 Pedro Alves <palves@redhat.com>
* infrun.c (process_event_stop_test): New function, factored out
from handle_inferior_event.
(handle_inferior_event): 'process_event_stop_test' is now a
function instead of a goto label -- adjust.
+2013-10-28 Pedro Alves <palves@redhat.com>
+
+ * infrun.c (process_event_stop_test): New function, factored out
+ from handle_inferior_event.
+ (handle_inferior_event): 'process_event_stop_test' is now a
+ function instead of a goto label -- adjust.
+
2013-10-28 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event): Move process_event_stop_test
2013-10-28 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event): Move process_event_stop_test
static void stop_stepping (struct execution_control_state *ecs);
static void prepare_to_wait (struct execution_control_state *ecs);
static void keep_going (struct execution_control_state *ecs);
static void stop_stepping (struct execution_control_state *ecs);
static void prepare_to_wait (struct execution_control_state *ecs);
static void keep_going (struct execution_control_state *ecs);
+static void process_event_stop_test (struct execution_control_state *ecs);
static int switch_back_to_stepped_thread (struct execution_control_state *ecs);
/* Callback for iterate over threads. If the thread is stopped, but
static int switch_back_to_stepped_thread (struct execution_control_state *ecs);
/* Callback for iterate over threads. If the thread is stopped, but
struct gdbarch *gdbarch;
int stopped_by_watchpoint;
int stepped_after_stopped_by_watchpoint = 0;
struct gdbarch *gdbarch;
int stopped_by_watchpoint;
int stepped_after_stopped_by_watchpoint = 0;
- struct symtab_and_line stop_pc_sal;
enum stop_kind stop_soon;
if (ecs->ws.kind == TARGET_WAITKIND_IGNORE)
enum stop_kind stop_soon;
if (ecs->ws.kind == TARGET_WAITKIND_IGNORE)
{
/* A catchpoint triggered. */
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP;
{
/* A catchpoint triggered. */
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP;
- goto process_event_stop_test;
+ process_event_stop_test (ecs);
+ return;
}
/* If requested, stop when the dynamic linker notifies
}
/* If requested, stop when the dynamic linker notifies
return;
}
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP;
return;
}
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP;
- goto process_event_stop_test;
+ process_event_stop_test (ecs);
+ return;
case TARGET_WAITKIND_VFORK_DONE:
/* Done with the shared memory region. Re-insert breakpoints in
case TARGET_WAITKIND_VFORK_DONE:
/* Done with the shared memory region. Re-insert breakpoints in
return;
}
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP;
return;
}
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_TRAP;
- goto process_event_stop_test;
+ process_event_stop_test (ecs);
+ return;
/* Be careful not to try to gather much state about a thread
that's in a syscall. It's frequently a losing proposition. */
/* Be careful not to try to gather much state about a thread
that's in a syscall. It's frequently a losing proposition. */
fprintf_unfiltered (gdb_stdlog,
"infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n");
/* Getting the current syscall number. */
fprintf_unfiltered (gdb_stdlog,
"infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n");
/* Getting the current syscall number. */
- if (handle_syscall_event (ecs) != 0)
- return;
- goto process_event_stop_test;
+ if (handle_syscall_event (ecs) == 0)
+ process_event_stop_test (ecs);
+ return;
/* Before examining the threads further, step this thread to
get it entirely out of the syscall. (We get notice of the
/* Before examining the threads further, step this thread to
get it entirely out of the syscall. (We get notice of the
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: TARGET_WAITKIND_SYSCALL_RETURN\n");
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: TARGET_WAITKIND_SYSCALL_RETURN\n");
- if (handle_syscall_event (ecs) != 0)
- return;
- goto process_event_stop_test;
+ if (handle_syscall_event (ecs) == 0)
+ process_event_stop_test (ecs);
+ return;
case TARGET_WAITKIND_STOPPED:
if (debug_infrun)
case TARGET_WAITKIND_STOPPED:
if (debug_infrun)
+
+ process_event_stop_test (ecs);
+}
+
+/* Come here when we've got some debug event / signal we can explain
+ (IOW, not a random signal), and test whether it should cause a
+ stop, or whether we should resume the inferior (transparently).
+ E.g., could be a breakpoint whose condition evaluates false; we
+ could be still stepping within the line; etc. */
+
+static void
+process_event_stop_test (struct execution_control_state *ecs)
+{
+ struct symtab_and_line stop_pc_sal;
+ struct frame_info *frame;
+ struct gdbarch *gdbarch;
+
{
/* Handle cases caused by hitting a breakpoint. */
CORE_ADDR jmp_buf_pc;
struct bpstat_what what;
{
/* Handle cases caused by hitting a breakpoint. */
CORE_ADDR jmp_buf_pc;
struct bpstat_what what;
-process_event_stop_test:
-
- /* Re-fetch current thread's frame in case we did a
- "goto process_event_stop_test" above. */
frame = get_current_frame ();
gdbarch = get_frame_arch (frame);
frame = get_current_frame ();
gdbarch = get_frame_arch (frame);