]> Git Repo - binutils.git/blobdiff - gdb/infrun.c
* annotate.texi (Breakpoint Info): Document annotation of header
[binutils.git] / gdb / infrun.c
index ef9b82603a7d6cfad11a29e21d45475319669af9..dfe2cc0ae783ac8f14484ab671d260c05bd8987a 100644 (file)
@@ -75,7 +75,7 @@ hook_stop_stub PARAMS ((char *));
 #endif
 
 /* For SVR4 shared libraries, each call goes through a small piece of
-   trampoline code in the ".init" section.  IN_SOLIB_TRAMPOLINE evaluates
+   trampoline code in the ".plt" section.  IN_SOLIB_TRAMPOLINE evaluates
    to nonzero if we are current stopped in one of these. */
 #ifndef IN_SOLIB_TRAMPOLINE
 #define IN_SOLIB_TRAMPOLINE(pc,name)   0
@@ -280,6 +280,15 @@ proceed (addr, siggnal, step)
 
       if (breakpoint_here_p (read_pc ()))
        oneproc = 1;
+
+#ifdef STEP_SKIPS_DELAY
+      /* Check breakpoint_here_p first, because breakpoint_here_p is fast
+        (it just checks internal GDB data structures) and STEP_SKIPS_DELAY
+        is slow (it needs to read memory from the target).  */
+      if (breakpoint_here_p (read_pc () + 4)
+         && STEP_SKIPS_DELAY (read_pc ()))
+       oneproc = 1;
+#endif /* STEP_SKIPS_DELAY */
     }
   else
     write_pc (addr);
@@ -615,8 +624,9 @@ switch_thread:
        single_step (0);        /* This actually cleans up the ss */
 #endif /* NO_SINGLE_STEP */
       
-/* If PC is pointing at a nullified instruction, then step beyond it so that
-   the user won't be confused when GDB appears to be ready to execute it. */
+      /* If PC is pointing at a nullified instruction, then step beyond
+        it so that the user won't be confused when GDB appears to be ready
+        to execute it. */
 
       if (INSTRUCTION_NULLIFIED)
        {
@@ -624,7 +634,33 @@ switch_thread:
          continue;
        }
 
-      set_current_frame ( create_new_frame (read_fp (), stop_pc));
+      set_current_frame (create_new_frame (read_fp (), stop_pc));
+      select_frame (get_current_frame (), 0);
+
+#ifdef HAVE_STEPPABLE_WATCHPOINT
+      /* It may not be necessary to disable the watchpoint to stop over
+        it.  For example, the PA can (with some kernel cooperation) 
+        single step over a watchpoint without disabling the watchpoint.  */
+      if (STOPPED_BY_WATCHPOINT (w))
+       {
+         resume (1, 0);
+         continue;
+       }
+#endif
+
+#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
+      /* It is far more common to need to disable a watchpoint
+        to step the inferior over it.  FIXME.  What else might
+        a debug register or page protection watchpoint scheme need
+        here?  */
+      if (STOPPED_BY_WATCHPOINT (w))
+       {
+         remove_breakpoints ();
+         resume (1, 0);
+         insert_breakpoints ();
+         continue;
+       }
+#endif
 
       stop_frame_address = FRAME_FP (get_current_frame ());
       stop_sp = read_sp ();
@@ -975,9 +1011,9 @@ switch_thread:
            sr_sal.pc = prev_pc;
            sr_sal.symtab = NULL;
            sr_sal.line = 0;
-           /* We perhaps could set the frame if we kept track of what
-              the frame corresponding to prev_pc was.  But we don't,
-              so don't.  */
+           /* We could probably be setting the frame to
+              prev_frame_address; the reason we don't is that it didn't used
+              to exist.  */
            step_resume_breakpoint =
              set_momentary_breakpoint (sr_sal, NULL, bp_step_resume);
            if (breakpoints_inserted)
@@ -1272,8 +1308,9 @@ step_into_function:
             to one-proceed past a breakpoint.  */
          /* If we've just finished a special step resume and we don't
             want to hit a breakpoint, pull em out.  */
-         if (step_resume_breakpoint == NULL &&
-             remove_breakpoints_on_following_step)
+         if (step_resume_breakpoint == NULL
+             && through_sigtramp_breakpoint == NULL
+             && remove_breakpoints_on_following_step)
            {
              remove_breakpoints_on_following_step = 0;
              remove_breakpoints ();
@@ -1394,8 +1431,6 @@ Further execution is probably impossible.\n");
      if we have one.  */
   if (!stop_stack_dummy)
     {
-      select_frame (get_current_frame (), 0);
-
       if (stop_print_frame)
        {
          int source_only;
@@ -1704,7 +1739,7 @@ signals_info (signum_exp, from_tty)
 
   printf_filtered ("\n");
   /* These ugly casts brought to you by the native VAX compiler.  */
-  for (oursig = 0;
+  for (oursig = TARGET_SIGNAL_FIRST;
        (int)oursig < (int)TARGET_SIGNAL_LAST;
        oursig = (enum target_signal)((int)oursig + 1))
     {
This page took 0.029272 seconds and 4 git commands to generate.