Index: gdb/infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.361 diff -u -p -r1.361 infrun.c --- gdb/infrun.c 1 Mar 2009 23:18:36 -0000 1.361 +++ gdb/infrun.c 16 Mar 2009 17:33:22 -0000 @@ -2089,14 +2089,29 @@ adjust_pc_after_break (struct execution_ 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) - gdbarch_decr_pc_after_break (gdbarch); + if (gdbarch_decr_pc_after_break (gdbarch) == 0) + { + /* Check if we have stopped at a permanent breakpoint. */ + int len; + const gdb_byte *brk; + gdb_byte *target_mem = alloca(32); + + brk = gdbarch_breakpoint_from_pc (gdbarch, &breakpoint_pc, &len); + if (!target_read_memory (breakpoint_pc, target_mem, len) + && memcmp (target_mem, brk, len) == 0) + { + breakpoint_pc += len; + regcache_write_pc (regcache, breakpoint_pc); + } + return; + } + /* Check whether there actually is a software breakpoint inserted at that location.