From 24a73cce8b28e42bdc79285fec5532ec4787c8d0 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Fri, 22 Aug 2008 14:47:13 +0000 Subject: [PATCH] * infrun.c (adjust_pc_after_break): Do not call get_thread_regcache if the thread has already exited. --- gdb/ChangeLog | 5 +++++ gdb/infrun.c | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 155fb66a4e2..c12701004be 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-08-22 Ulrich Weigand + + * infrun.c (adjust_pc_after_break): Do not call get_thread_regcache + if the thread has already exited. + 2008-08-22 Pedro Alves * infrun.c (proceed): Move back setting previous_inferior_ptid diff --git a/gdb/infrun.c b/gdb/infrun.c index de1827eb669..d6c49ab1391 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1750,15 +1750,10 @@ context_switch_to (ptid_t ptid) static void adjust_pc_after_break (struct execution_control_state *ecs) { - struct regcache *regcache = get_thread_regcache (ecs->ptid); - struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct regcache *regcache; + struct gdbarch *gdbarch; CORE_ADDR breakpoint_pc; - /* If this target does not decrement the PC after breakpoints, then - we have nothing to do. */ - if (gdbarch_decr_pc_after_break (gdbarch) == 0) - return; - /* If we've hit a breakpoint, we'll normally be stopped with SIGTRAP. If we aren't, just return. @@ -1786,6 +1781,13 @@ adjust_pc_after_break (struct execution_control_state *ecs) if (ecs->ws.value.sig != TARGET_SIGNAL_TRAP) return; + /* If this target does not decrement the PC after breakpoints, then + we have nothing to do. */ + regcache = get_thread_regcache (ecs->ptid); + gdbarch = get_regcache_arch (regcache); + if (gdbarch_decr_pc_after_break (gdbarch) == 0) + return; + /* Find the location where (if we've hit a breakpoint) the breakpoint would be. */ breakpoint_pc = regcache_read_pc (regcache) -- 2.30.2