struct regcache *regcache;
struct gdbarch *gdbarch;
struct address_space *aspace;
- CORE_ADDR breakpoint_pc;
+ CORE_ADDR breakpoint_pc, decr_pc;
/* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP. If
we aren't, just return.
we have nothing to do. */
regcache = get_thread_regcache (ecs->ptid);
gdbarch = get_regcache_arch (regcache);
- if (gdbarch_decr_pc_after_break (gdbarch) == 0)
+
+ decr_pc = target_decr_pc_after_break (gdbarch);
+ if (decr_pc == 0)
return;
aspace = get_regcache_aspace (regcache);
/* Find the location where (if we've hit a breakpoint) the
breakpoint would be. */
- breakpoint_pc = regcache_read_pc (regcache)
- - gdbarch_decr_pc_after_break (gdbarch);
+ breakpoint_pc = regcache_read_pc (regcache) - decr_pc;
/* Check whether there actually is a software breakpoint inserted at
that location.
ecs->stop_func_start
+= gdbarch_deprecated_function_start_offset (gdbarch);
+ if (gdbarch_skip_entrypoint_p (gdbarch))
+ ecs->stop_func_start = gdbarch_skip_entrypoint (gdbarch,
+ ecs->stop_func_start);
+
ecs->stop_func_filled_in = 1;
}
}
ecs->event_thread->step_after_step_resume_breakpoint = 1;
/* Reset trap_expected to ensure breakpoints are re-inserted. */
ecs->event_thread->control.trap_expected = 0;
- keep_going (ecs);
+
+ /* If we were nexting/stepping some other thread, switch to
+ it, so that we don't continue it, losing control. */
+ if (!switch_back_to_stepped_thread (ecs))
+ keep_going (ecs);
return;
}