* serial.h (SERIAL_SET_TTY_STATE): Comment return value.
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index c7d183141805e48ac1b3a242ec83842c91009ce9..717335fcc879b2e45c2971b1b0eb49faf879da62 100644 (file)
@@ -484,10 +484,6 @@ remove_breakpoints ()
   register struct breakpoint *b;
   int val;
 
-#ifdef BREAKPOINT_DEBUG
-  printf_unfiltered ("Removing breakpoints.\n");
-#endif /* BREAKPOINT_DEBUG */
-
   ALL_BREAKPOINTS (b)
     if (b->type != bp_watchpoint && b->inserted)
       {
@@ -495,14 +491,6 @@ remove_breakpoints ()
        if (val)
          return val;
        b->inserted = 0;
-#ifdef BREAKPOINT_DEBUG
-       printf_unfiltered ("Removed breakpoint at %s",
-               local_hex_string((unsigned long) b->address));
-       printf_unfiltered (", shadow %s",
-               local_hex_string((unsigned long) b->shadow_contents[0]));
-       printf_unfiltered (", %s.\n",
-               local_hex_string((unsigned long) b->shadow_contents[1]));
-#endif /* BREAKPOINT_DEBUG */
       }
 
   return 0;
@@ -567,16 +555,23 @@ frame_in_dummy (frame)
 {
   struct breakpoint *b;
 
+#ifdef CALL_DUMMY
   ALL_BREAKPOINTS (b)
     {
-      /* We could also check whether fi->pc is within the call dummy, but
-        that should not be necessary if we check the frame (note the
-        call dummy is sizeof (dummy) / sizeof (LONGEST) * REGISTER_SIZE
-        bytes not just sizeof (dummy) bytes).  */
+      static unsigned LONGEST dummy[] = CALL_DUMMY;
+
       if (b->type == bp_call_dummy
-         && b->frame == frame->frame)
+         && b->frame == frame->frame
+
+         /* We need to check the PC as well as the frame on the sparc,
+            for signals.exp in the testsuite.  */
+         && (frame->pc
+             >= (b->address
+                 - sizeof (dummy) / sizeof (LONGEST) * REGISTER_SIZE))
+         && frame->pc <= b->address)
        return 1;
     }
+#endif /* CALL_DUMMY */
   return 0;
 }
 
@@ -1269,6 +1264,9 @@ bpstat_what (bs)
     /* We hit the longjmp_resume breakpoint.  */
     long_resume,
 
+    /* We hit the step_resume breakpoint.  */
+    step_resume,
+
     /* This is just used to count how many enums there are.  */
     class_last
     };
@@ -1283,6 +1281,8 @@ bpstat_what (bs)
 #define setlr BPSTAT_WHAT_SET_LONGJMP_RESUME
 #define clrlr BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
 #define clrlrs BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE
+#define sr BPSTAT_WHAT_STEP_RESUME
+
 /* "Can't happen."  Might want to print an error message.
    abort() is not out of the question, but chances are GDB is just
    a bit confused, not unusable.  */
@@ -1295,20 +1295,26 @@ bpstat_what (bs)
      (BPSTAT_WHAT_SINGLE type stuff) is handled in proceed() without
      reference to how we stopped.  We retain separate wp_silent and bp_silent
      codes in case we want to change that someday.  */
+
+  /* step_resume entries: a step resume breakpoint overrides another
+     breakpoint of signal handling (see comment in wait_for_inferior
+     at first IN_SIGTRAMP where we set the step_resume breakpoint).  */
+
   static const enum bpstat_what_main_action
     table[(int)class_last][(int)BPSTAT_WHAT_LAST] =
       {
        /*                              old action */
-       /*       keep_c  stop_s  stop_n  single  setlr   clrlr   clrlrs */
-
-/*no_effect*/  {keep_c, stop_s, stop_n, single, setlr , clrlr , clrlrs},
-/*wp_silent*/  {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s},
-/*wp_noisy*/    {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n},
-/*bp_nostop*/  {single, stop_s, stop_n, single, setlr , clrlrs, clrlrs},
-/*bp_silent*/  {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s},
-/*bp_noisy*/    {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n},
-/*long_jump*/  {setlr , stop_s, stop_n, setlr , err   , err   , err   },
-/*long_resume*/        {clrlr , stop_s, stop_n, clrlrs, err   , err   , err   }
+       /*       keep_c  stop_s  stop_n  single  setlr   clrlr   clrlrs  sr */
+
+/*no_effect*/  {keep_c, stop_s, stop_n, single, setlr , clrlr , clrlrs, sr},
+/*wp_silent*/  {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s, sr},
+/*wp_noisy*/    {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, sr},
+/*bp_nostop*/  {single, stop_s, stop_n, single, setlr , clrlrs, clrlrs, sr},
+/*bp_silent*/  {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s, sr},
+/*bp_noisy*/    {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, sr},
+/*long_jump*/  {setlr , stop_s, stop_n, setlr , err   , err   , err   , sr},
+/*long_resume*/        {clrlr , stop_s, stop_n, clrlrs, err   , err   , err   , sr},
+/*step_resume*/        {sr    , sr    , sr    , sr    , sr    , sr    , sr    , sr}
              };
 #undef keep_c
 #undef stop_s
@@ -1322,7 +1328,6 @@ bpstat_what (bs)
   struct bpstat_what retval;
 
   retval.call_dummy = 0;
-  retval.step_resume = 0;
   for (; bs != NULL; bs = bs->next)
     {
       enum class bs_class = no_effect;
@@ -1373,9 +1378,7 @@ bpstat_what (bs)
          if (bs->stop)
            {
 #endif
-             retval.step_resume = 1;
-             /* We don't handle this via the main_action.  */
-             bs_class = no_effect;
+             bs_class = step_resume;
 #if 0
            }
          else
@@ -1491,8 +1494,10 @@ breakpoint_1 (bnum, allflag)
        printf_filtered ("\n");
 
        if (b->frame)
-         printf_filtered ("\tstop only in stack frame at %s\n",
-                          local_hex_string((unsigned long) b->frame));
+         {
+           printf_filtered ("\tstop only in stack frame at ");
+           print_address_numeric (b->frame, gdb_stdout);
+           printf_filtered ("\n");
        if (b->cond)
          {
            printf_filtered ("\tstop only if ");
@@ -1571,17 +1576,20 @@ describe_other_breakpoints (pc)
       others++;
   if (others > 0)
     {
-      printf_unfiltered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
+      printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
       ALL_BREAKPOINTS (b)
        if (b->address == pc)
          {
            others--;
-           printf_unfiltered ("%d%s%s ",
-                   b->number,
-                   (b->enable == disabled) ? " (disabled)" : "",
-                   (others > 1) ? "," : ((others == 1) ? " and" : ""));
+           printf_filtered
+             ("%d%s%s ",
+              b->number,
+              (b->enable == disabled) ? " (disabled)" : "",
+              (others > 1) ? "," : ((others == 1) ? " and" : ""));
          }
-      printf_unfiltered ("also set at pc %s.\n", local_hex_string((unsigned long) pc));
+      printf_filtered ("also set at pc ");
+      print_address_numeric (pc, gdb_stdout);
+      printf_filtered (".\n");
     }
 }
 \f
@@ -1815,8 +1823,8 @@ mention (b)
       print_expression (b->exp, gdb_stdout);
       break;
     case bp_breakpoint:
-      printf_filtered ("Breakpoint %d at %s", b->number,
-                      local_hex_string((unsigned long) b->address));
+      printf_filtered ("Breakpoint %d at ", b->number);
+      print_address_numeric (b->address);
       if (b->source_file)
        printf_filtered (": file %s, line %d.",
                         b->source_file, b->line_number);
@@ -2040,8 +2048,8 @@ break_command_1 (arg, tempflag, from_tty)
 
   if (sals.nelts > 1)
     {
-      printf_unfiltered ("Multiple breakpoints were set.\n");
-      printf_unfiltered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
+      printf_filtered ("Multiple breakpoints were set.\n");
+      printf_filtered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
     }
   do_cleanups (old_chain);
 }
@@ -2175,7 +2183,7 @@ until_break_command (arg, from_tty)
       make_cleanup(delete_breakpoint, breakpoint);
     }
   
-  proceed (-1, -1, 0);
+  proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
   do_cleanups(old_chain);
 }
 \f
This page took 0.024888 seconds and 4 git commands to generate.