struct target_waitstatus ws;
int random_signal;
+ int stop_func_filled_in;
CORE_ADDR stop_func_start;
CORE_ADDR stop_func_end;
char *stop_func_name;
return 1;
}
+/* Clear the supplied execution_control_state's stop_func_* fields. */
+
+static void
+clear_stop_func (struct execution_control_state *ecs)
+{
+ ecs->stop_func_filled_in = 0;
+ ecs->stop_func_start = 0;
+ ecs->stop_func_end = 0;
+ ecs->stop_func_name = NULL;
+}
+
+/* Lazily fill in the execution_control_state's stop_func_* fields. */
+
+static void
+fill_in_stop_func (struct gdbarch *gdbarch,
+ struct execution_control_state *ecs)
+{
+ if (!ecs->stop_func_filled_in)
+ {
+ /* Don't care about return value; stop_func_start and stop_func_name
+ will both be 0 if it doesn't work. */
+ find_pc_partial_function (stop_pc, &ecs->stop_func_name,
+ &ecs->stop_func_start, &ecs->stop_func_end);
+ ecs->stop_func_start
+ += gdbarch_deprecated_function_start_offset (gdbarch);
+
+ ecs->stop_func_filled_in = 1;
+ }
+}
+
/* Given an execution control state that has been freshly filled in
by an event from the inferior, figure out what it means and take
appropriate action. */
return;
}
- ecs->stop_func_start = 0;
- ecs->stop_func_end = 0;
- ecs->stop_func_name = 0;
- /* Don't care about return value; stop_func_start and stop_func_name
- will both be 0 if it doesn't work. */
- find_pc_partial_function (stop_pc, &ecs->stop_func_name,
- &ecs->stop_func_start, &ecs->stop_func_end);
- ecs->stop_func_start
- += gdbarch_deprecated_function_start_offset (gdbarch);
+ clear_stop_func (ecs);
ecs->event_thread->stepping_over_breakpoint = 0;
bpstat_clear (&ecs->event_thread->control.stop_bpstat);
ecs->event_thread->control.stop_step = 0;
keep_going (ecs);
return;
}
+ fill_in_stop_func (gdbarch, ecs);
if (stop_pc == ecs->stop_func_start
&& execution_direction == EXEC_REVERSE)
{
a dangling pointer. */
frame = get_current_frame ();
gdbarch = get_frame_arch (frame);
+ fill_in_stop_func (gdbarch, ecs);
/* If stepping through a line, keep going if still within it.
struct symtab *s;
struct symtab_and_line stop_func_sal, sr_sal;
+ fill_in_stop_func (gdbarch, ecs);
+
s = find_pc_symtab (stop_pc);
if (s && s->language != language_asm)
ecs->stop_func_start = gdbarch_skip_prologue (gdbarch,
struct symtab *s;
struct symtab_and_line stop_func_sal;
+ fill_in_stop_func (gdbarch, ecs);
+
s = find_pc_symtab (stop_pc);
if (s && s->language != language_asm)
ecs->stop_func_start = gdbarch_skip_prologue (gdbarch,