* lib/gdb.exp (build_id_debug_filename_get): Improve check for
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 1fc3d104956e076ba9f18c116f1f759073d579e6..99104aa7a0dce17f2ab0fc7c41aee99a51767a0f 100644 (file)
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include <ctype.h>
@@ -1897,6 +1895,15 @@ ep_is_exception_catchpoint (struct breakpoint *ep)
     || (ep->type == bp_catch_throw);
 }
 
+void 
+bpstat_free (bpstat bs)
+{
+  if (bs->old_val != NULL)
+    value_free (bs->old_val);
+  free_command_lines (&bs->commands);
+  xfree (bs);
+}
+
 /* Clear a bpstat so that it says we are not at any breakpoint.
    Also free any storage that is part of a bpstat.  */
 
@@ -1912,10 +1919,7 @@ bpstat_clear (bpstat *bsp)
   while (p != NULL)
     {
       q = p->next;
-      if (p->old_val != NULL)
-       value_free (p->old_val);
-      free_command_lines (&p->commands);
-      xfree (p);
+      bpstat_free (p);
       p = q;
     }
   *bsp = NULL;
@@ -4448,7 +4452,7 @@ create_solib_event_breakpoint (CORE_ADDR address)
    apply to enabled breakpoints, disabled ones can just stay disabled.  */
 
 void
-disable_breakpoints_in_shlibs (int silent)
+disable_breakpoints_in_shlibs (void)
 {
   struct breakpoint *b;
   int disabled_shlib_breaks = 0;
@@ -4463,19 +4467,7 @@ disable_breakpoints_in_shlibs (int silent)
        && solib_address (b->loc->address)
 #endif
        )
-      {
        b->enable_state = bp_shlib_disabled;
-       if (!silent)
-         {
-           if (!disabled_shlib_breaks)
-             {
-               target_terminal_ours_for_output ();
-               warning (_("Temporarily disabling shared library breakpoints:"));
-             }
-           disabled_shlib_breaks = 1;
-           warning (_("breakpoint #%d "), b->number);
-         }
-      }
   }
 }
 
@@ -5775,28 +5767,6 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
        error (_("Target can only support one kind of HW watchpoint at a time."));
     }
 
-#if defined(HPUXHPPA)
-  /*  On HP-UX if you set a h/w
-     watchpoint before the "run" command, the inferior dies with a e.g.,
-     SIGILL once you start it.  I initially believed this was due to a
-     bad interaction between page protection traps and the initial
-     startup sequence by the dynamic linker.
-
-     However, I tried avoiding that by having HP-UX's implementation of
-     TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_ptid
-     yet, which forced slow watches before a "run" or "attach", and it
-     still fails somewhere in the startup code.
-
-     Until I figure out what's happening, I'm disallowing watches altogether
-     before the "run" or "attach" command.  We'll tell the user they must
-     set watches after getting the program started. */
-  if (!target_has_execution)
-    {
-      warning (_("can't do that without a running program; try \"break main\"), \"run\" first");
-      return;
-    }
-#endif /* HPUXHPPA */
-
   /* Change the type of breakpoint to an ordinary watchpoint if a hardware
      watchpoint could not be set.  */
   if (!mem_cnt || target_resources_ok <= 0)
@@ -7063,7 +7033,13 @@ delete_breakpoint (struct breakpoint *bpt)
 
   /* Be sure no bpstat's are pointing at it after it's been freed.  */
   /* FIXME, how can we find all bpstat's?
-     We just check stop_bpstat for now.  */
+     We just check stop_bpstat for now.  Note that we cannot just
+     remove bpstats pointing at bpt from the stop_bpstat list
+     entirely, as breakpoint commands are associated with the bpstat;
+     if we remove it here, then the later call to
+         bpstat_do_actions (&stop_bpstat);
+     in event-top.c won't do anything, and temporary breakpoints
+     with commands won't work.  */
   for (bs = stop_bpstat; bs; bs = bs->next)
     if (bs->breakpoint_at == bpt)
       {
This page took 0.027017 seconds and 4 git commands to generate.