Allow for the possibility that the local labels won't be in the objdump output.
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index a3ef4793f1068e4a62120995f304edea56fa5ddf..5eb1fa4d93b8165424df5a833fbfab55b5f751e0 100644 (file)
@@ -1,6 +1,6 @@
 /* Everything about breakpoints, for GDB.
-   Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000
-   Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -197,12 +197,12 @@ static char *ep_parse_optional_filename (char **arg);
 static void catch_exec_command_1 (char *arg, int tempflag, int from_tty);
 #endif
 
-static void create_exception_catchpoint
-  (int tempflag, char *cond_string,
-   enum exception_event_kind ex_event, struct symtab_and_line *sal);
+static void create_exception_catchpoint (int tempflag, char *cond_string,
+                                        enum exception_event_kind ex_event,
+                                        struct symtab_and_line *sal);
 
-static void catch_exception_command_1
-  (enum exception_event_kind ex_event, char *arg, int tempflag, int from_tty);
+static void catch_exception_command_1 (enum exception_event_kind ex_event, 
+                                      char *arg, int tempflag, int from_tty);
 
 static void tcatch_command (char *arg, int from_tty);
 
@@ -696,10 +696,9 @@ read_memory_nobpt (CORE_ADDR memaddr, char *myaddr, unsigned len)
       if (bp_addr + bp_size < memaddr + len)
        {
          /* Copy the section of memory after the breakpoint.  */
-         status = read_memory_nobpt
-           (bp_addr + bp_size,
-            myaddr + bp_addr + bp_size - memaddr,
-            memaddr + len - (bp_addr + bp_size));
+         status = read_memory_nobpt (bp_addr + bp_size,
+                                     myaddr + bp_addr + bp_size - memaddr,
+                                     memaddr + len - (bp_addr + bp_size));
          if (status != 0)
            return status;
        }
@@ -1613,11 +1612,9 @@ ep_is_catchpoint (struct breakpoint *ep)
     || (ep->type == bp_catch_vfork)
     || (ep->type == bp_catch_exec)
     || (ep->type == bp_catch_catch)
-    || (ep->type == bp_catch_throw)
-
+    || (ep->type == bp_catch_throw);
 
   /* ??rehrauer: Add more kinds here, as are implemented... */
-    ;
 }
 
 int
@@ -1625,8 +1622,7 @@ ep_is_shlib_catchpoint (struct breakpoint *ep)
 {
   return
     (ep->type == bp_catch_load)
-    || (ep->type == bp_catch_unload)
-    ;
+    || (ep->type == bp_catch_unload);
 }
 
 int
@@ -1634,8 +1630,7 @@ ep_is_exception_catchpoint (struct breakpoint *ep)
 {
   return
     (ep->type == bp_catch_catch)
-    || (ep->type == bp_catch_throw)
-    ;
+    || (ep->type == bp_catch_throw);
 }
 
 /* Clear a bpstat so that it says we are not at any breakpoint.
@@ -2093,8 +2088,8 @@ print_it_typical (bpstat bs)
        {
          mention (bs->breakpoint_at);
          if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
-           ui_out_list_begin (uiout, "value");
-         ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+           ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
+         ui_out_list_begin (uiout, "value");
          ui_out_text (uiout, "\nValue = ");
        }
       value_print (bs->breakpoint_at->val, stb->stream, 0,Val_pretty_default);
@@ -2182,7 +2177,8 @@ print_bp_stop_message (bpstat bs)
       return print_it_typical (bs);
       break;
     default:
-      internal_error ("print_bp_stop_message: unrecognized enum value");
+      internal_error (__FILE__, __LINE__,
+                     "print_bp_stop_message: unrecognized enum value");
       break;
     }
 }
@@ -2399,7 +2395,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
   char message[sizeof (message1) + 30 /* slop */ ];
 
   /* Get the address where the breakpoint would have been.  */
-  bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P ? 
+  bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () 
                    0 : DECR_PC_AFTER_BREAK);
 
   ALL_BREAKPOINTS_SAFE (b, temp)
@@ -3131,7 +3127,8 @@ print_one_breakpoint (struct breakpoint *b,
   annotate_field (1);
   if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0])))
       || ((int) b->type != bptypes[(int) b->type].type))
-    internal_error ("bptypes table does not describe type #%d.",
+    internal_error (__FILE__, __LINE__,
+                   "bptypes table does not describe type #%d.",
                    (int) b->type);
 #ifdef UI_OUT
   ui_out_field_string (uiout, "type", bptypes[(int) b->type].description);
@@ -3163,7 +3160,8 @@ print_one_breakpoint (struct breakpoint *b,
   switch (b->type)
     {
     case bp_none:
-      internal_error ("print_one_breakpoint: bp_none encountered\n");
+      internal_error (__FILE__, __LINE__,
+                     "print_one_breakpoint: bp_none encountered\n");
       break;
 
     case bp_watchpoint:
@@ -3335,10 +3333,9 @@ print_one_breakpoint (struct breakpoint *b,
          annotate_field (4);
          /* FIXME-32x64: need a print_address_numeric with
             field width */
-         printf_filtered
-           ("%s ",
-            local_hex_string_custom
-            ((unsigned long) b->address, "08l"));
+         printf_filtered ("%s ",
+                          local_hex_string_custom
+                          ((unsigned long) b->address, "08l"));
        }
       annotate_field (5);
       *last_addr = b->address;
@@ -3678,15 +3675,15 @@ describe_other_breakpoints (CORE_ADDR pc, asection *section)
            b->section == section)
          {
            others--;
-           printf_filtered
-             ("%d%s%s ",
-              b->number,
-              ((b->enable == disabled || 
-                b->enable == shlib_disabled || 
-                b->enable == call_disabled) ? " (disabled)" 
-               : b->enable == permanent ? " (permanent)"
-               : ""),
-              (others > 1) ? "," : ((others == 1) ? " and" : ""));
+           printf_filtered ("%d%s%s ",
+                            b->number,
+                            ((b->enable == disabled || 
+                              b->enable == shlib_disabled || 
+                              b->enable == call_disabled) ? " (disabled)" 
+                             : b->enable == permanent ? " (permanent)"
+                             : ""),
+                            (others > 1) ? "," 
+                            : ((others == 1) ? " and" : ""));
          }
       printf_filtered ("also set at pc ");
       print_address_numeric (pc, 1, gdb_stdout);
@@ -3750,14 +3747,16 @@ check_duplicates (CORE_ADDR address, asection *section)
 
       /* Permanent breakpoint should always be inserted.  */
       if (! perm_bp->inserted)
-       internal_error ("allegedly permanent breakpoint is not "
+       internal_error (__FILE__, __LINE__,
+                       "allegedly permanent breakpoint is not "
                        "actually inserted");
 
       ALL_BREAKPOINTS (b)
        if (b != perm_bp)
          {
            if (b->inserted)
-             internal_error ("another breakpoint was inserted on top of "
+             internal_error (__FILE__, __LINE__,
+                             "another breakpoint was inserted on top of "
                              "a permanent breakpoint");
 
            if (b->enable != disabled
@@ -3871,7 +3870,7 @@ create_longjmp_breakpoint (char *func_name)
   b->enable = disabled;
   b->silent = 1;
   if (func_name)
-    b->addr_string = strsave (func_name);
+    b->addr_string = xstrdup (func_name);
   b->number = internal_breakpoint_number--;
 }
 
@@ -3928,7 +3927,7 @@ create_thread_event_breakpoint (CORE_ADDR address)
   b->enable = enabled;
   /* addr_string has to be used or breakpoint_re_set will delete me.  */
   sprintf (addr_string, "*0x%s", paddr (b->address));
-  b->addr_string = strsave (addr_string);
+  b->addr_string = xstrdup (addr_string);
 
   return b;
 }
@@ -6782,7 +6781,8 @@ delete_breakpoint (struct breakpoint *bpt)
             If there is a permanent breakpoint somewhere, it should
             always be the only one inserted.  */
          if (b->enable == permanent)
-           internal_error ("another breakpoint was inserted on top of "
+           internal_error (__FILE__, __LINE__,
+                           "another breakpoint was inserted on top of "
                            "a permanent breakpoint");
 
          if (b->type == bp_hardware_breakpoint)
This page took 0.027551 seconds and 4 git commands to generate.