X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Finfrun.c;h=5d60a908a2abc8070849c430b7ac296b88beba79;hb=2117c711ae07700adb57ea5b5ca61e4c32d7e3d2;hp=311bf9c4359b92cbf574b06bec814c4a1e4f5448;hpb=8213266aeadc6cfae8313f1335f33a43e40f0a8c;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/infrun.c b/gdb/infrun.c index 311bf9c435..5d60a908a2 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2963,7 +2963,7 @@ adjust_pc_after_break (struct execution_control_state *ecs) 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. @@ -3025,15 +3025,16 @@ adjust_pc_after_break (struct execution_control_state *ecs) 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. @@ -3158,6 +3159,10 @@ fill_in_stop_func (struct gdbarch *gdbarch, 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; } } @@ -4379,7 +4384,11 @@ handle_signal_stop (struct execution_control_state *ecs) 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; }