* infrun.c (adjust_pc_after_break): Do not assume software single-step
[deliverable/binutils-gdb.git] / gdb / solib-sunos.c
index b87361e9e163cf687ead5b13c4558b8cf08772ba..ef6e41174eb1bdab16c47dcccc08beb252a81122 100644 (file)
@@ -775,12 +775,18 @@ sunos_solib_create_inferior_hook (void)
   /* We are now either at the "mapping complete" breakpoint (or somewhere
      else, a condition we aren't prepared to deal with anyway), so adjust
      the PC as necessary after a breakpoint, disable the breakpoint, and
-     add any shared libraries that were mapped in. */
+     add any shared libraries that were mapped in.
 
-  if (DECR_PC_AFTER_BREAK)
+     Note that adjust_pc_after_break did not perform any PC adjustment,
+     as the breakpoint the inferior just hit was not inserted by GDB,
+     but by the dynamic loader itself, and is therefore not found on
+     the GDB software break point list.  Thus we have to adjust the
+     PC here.  */
+
+  if (gdbarch_decr_pc_after_break (current_gdbarch))
     {
-      stop_pc -= DECR_PC_AFTER_BREAK;
-      write_register (PC_REGNUM, stop_pc);
+      stop_pc -= gdbarch_decr_pc_after_break (current_gdbarch);
+      write_pc (stop_pc);
     }
 
   if (!disable_break ())
This page took 0.023523 seconds and 4 git commands to generate.