2002-01-23 Elena Zannoni <ezannoni@redhat.com>
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index e706f1acc7391ac44b4a65ef73b9da80bc892b0c..d310766043b91c16a56c2624f366cc71d3f1d87a 100644 (file)
@@ -1,6 +1,8 @@
 /* Everything about breakpoints, for GDB.
-   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -40,9 +42,9 @@
 #include "symfile.h"
 #include "objfiles.h"
 #include "linespec.h"
-#ifdef UI_OUT
+#include "completer.h"
+#include "gdb.h"
 #include "ui-out.h"
-#endif
 
 #include "gdb-events.h"
 
@@ -135,7 +137,7 @@ static enum print_stop_action print_bp_stop_message (bpstat bs);
 typedef struct
   {
     enum exception_event_kind kind;
-    int enable;
+    int enable_p;
   }
 args_for_catchpoint_enable;
 
@@ -375,7 +377,7 @@ get_number_trailer (char **pp, int trailer)
          to pass to lookup_internalvar().  */
       char *varname;
       char *start = ++p;
-      value_ptr val;
+      struct value *val;
 
       while (isalnum (*p) || *p == '_')
        p++;
@@ -721,7 +723,7 @@ insert_breakpoints (void)
 
   ALL_BREAKPOINTS_SAFE (b, temp)
   {
-    if (b->enable == permanent)
+    if (b->enable_state == bp_permanent)
       /* Permanent breakpoints cannot be inserted or removed.  */
       continue;
     else if (b->type != bp_watchpoint
@@ -733,9 +735,9 @@ insert_breakpoints (void)
        && b->type != bp_catch_exec
        && b->type != bp_catch_throw
        && b->type != bp_catch_catch
-       && b->enable != disabled
-       && b->enable != shlib_disabled
-       && b->enable != call_disabled
+       && b->enable_state != bp_disabled
+       && b->enable_state != bp_shlib_disabled
+       && b->enable_state != bp_call_disabled
        && !b->inserted
        && !b->duplicate)
       {
@@ -774,7 +776,7 @@ insert_breakpoints (void)
              {
                /* See also: disable_breakpoints_in_shlibs. */
                val = 0;
-               b->enable = shlib_disabled;
+               b->enable_state = bp_shlib_disabled;
                if (!disabled_breaks)
                  {
                    target_terminal_ours_for_output ();
@@ -802,9 +804,9 @@ insert_breakpoints (void)
          return_val = val;     /* remember failure */
       }
     else if (ep_is_exception_catchpoint (b)
-            && b->enable != disabled
-            && b->enable != shlib_disabled
-            && b->enable != call_disabled
+            && b->enable_state != bp_disabled
+            && b->enable_state != bp_shlib_disabled
+            && b->enable_state != bp_call_disabled
             && !b->inserted
             && !b->duplicate)
 
@@ -822,7 +824,7 @@ insert_breakpoints (void)
            target_terminal_ours_for_output ();
            warning ("Cannot insert catchpoint %d; disabling it.",
                     b->number);
-           b->enable = disabled;
+           b->enable_state = bp_disabled;
          }
        else
          {
@@ -831,7 +833,7 @@ insert_breakpoints (void)
            args_for_catchpoint_enable args;
            args.kind = b->type == bp_catch_catch ? 
              EX_EVENT_CATCH : EX_EVENT_THROW;
-           args.enable = 1;
+           args.enable_p = 1;
            val = catch_errors (cover_target_enable_exception_callback,
                                &args,
                                message, RETURN_MASK_ALL);
@@ -846,7 +848,7 @@ insert_breakpoints (void)
                target_terminal_ours_for_output ();
                warning ("Cannot insert catchpoint %d; disabling it.",
                         b->number);
-               b->enable = disabled;
+               b->enable_state = bp_disabled;
              }
          }
 
@@ -857,15 +859,15 @@ insert_breakpoints (void)
     else if ((b->type == bp_hardware_watchpoint ||
              b->type == bp_read_watchpoint ||
              b->type == bp_access_watchpoint)
-            && b->enable == enabled
-            && b->disposition != del_at_next_stop
+            && b->enable_state == bp_enabled
+            && b->disposition != disp_del_at_next_stop
             && !b->inserted
             && !b->duplicate)
       {
        struct frame_info *saved_frame;
        int saved_level, within_current_scope;
-       value_ptr mark = value_mark ();
-       value_ptr v;
+       struct value *mark = value_mark ();
+       struct value *v;
 
        /* Save the current frame and level so we can restore it after
           evaluating the watchpoint expression on its own frame.  */
@@ -965,8 +967,8 @@ insert_breakpoints (void)
            printf_filtered ("because the program has left the block \n");
            printf_filtered ("in which its expression is valid.\n");
            if (b->related_breakpoint)
-             b->related_breakpoint->disposition = del_at_next_stop;
-           b->disposition = del_at_next_stop;
+             b->related_breakpoint->disposition = disp_del_at_next_stop;
+           b->disposition = disp_del_at_next_stop;
          }
 
        /* Restore the frame and level.  */
@@ -980,7 +982,7 @@ insert_breakpoints (void)
     else if ((b->type == bp_catch_fork
              || b->type == bp_catch_vfork
              || b->type == bp_catch_exec)
-            && b->enable == enabled
+            && b->enable_state == bp_enabled
             && !b->inserted
             && !b->duplicate)
       {
@@ -1249,7 +1251,7 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
 {
   int val;
 
-  if (b->enable == permanent)
+  if (b->enable_state == bp_permanent)
     /* Permanent breakpoints cannot be inserted or removed.  */
     return 0;
 
@@ -1301,10 +1303,11 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
   else if ((b->type == bp_hardware_watchpoint ||
            b->type == bp_read_watchpoint ||
            b->type == bp_access_watchpoint)
-          && b->enable == enabled
+          && b->enable_state == bp_enabled
           && !b->duplicate)
     {
-      value_ptr v, n;
+      struct value *v;
+      struct value *n;
 
       b->inserted = (is == mark_inserted);
       /* Walk down the saved value chain.  */
@@ -1356,7 +1359,7 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
   else if ((b->type == bp_catch_fork ||
            b->type == bp_catch_vfork ||
            b->type == bp_catch_exec)
-          && b->enable == enabled
+          && b->enable_state == bp_enabled
           && !b->duplicate)
     {
       val = -1;
@@ -1381,7 +1384,7 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
     }
   else if ((b->type == bp_catch_catch ||
            b->type == bp_catch_throw)
-          && b->enable == enabled
+          && b->enable_state == bp_enabled
           && !b->duplicate)
     {
 
@@ -1392,7 +1395,7 @@ remove_breakpoint (struct breakpoint *b, insertion_state_t is)
     }
   else if (ep_is_exception_catchpoint (b)
           && b->inserted       /* sometimes previous insert doesn't happen */
-          && b->enable == enabled
+          && b->enable_state == bp_enabled
           && !b->duplicate)
     {
 
@@ -1503,15 +1506,15 @@ breakpoint_here_p (CORE_ADDR pc)
   int any_breakpoint_here = 0;
 
   ALL_BREAKPOINTS (b)
-    if ((b->enable == enabled
-        || b->enable == permanent)
+    if ((b->enable_state == bp_enabled
+        || b->enable_state == bp_permanent)
        && b->address == pc)    /* bp is enabled and matches pc */
       {
        if (overlay_debugging &&
            section_is_overlay (b->section) &&
            !section_is_mapped (b->section))
          continue;             /* unmapped overlay -- can't be a match */
-       else if (b->enable == permanent)
+       else if (b->enable_state == bp_permanent)
          return permanent_breakpoint_here;
        else
          any_breakpoint_here = 1;
@@ -1589,9 +1592,9 @@ breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid)
   thread = pid_to_thread_id (ptid);
 
   ALL_BREAKPOINTS (b)
-    if (b->enable != disabled
-       && b->enable != shlib_disabled
-       && b->enable != call_disabled
+    if (b->enable_state != bp_disabled
+       && b->enable_state != bp_shlib_disabled
+       && b->enable_state != bp_call_disabled
        && b->address == pc
        && (b->thread == -1 || b->thread == thread))
     {
@@ -1719,13 +1722,19 @@ bpstat_find_breakpoint (bpstat bsp, struct breakpoint *breakpoint)
 struct breakpoint *
 bpstat_find_step_resume_breakpoint (bpstat bsp)
 {
+  int current_thread;
+
   if (bsp == NULL)
     error ("Internal error (bpstat_find_step_resume_breakpoint)");
 
+  current_thread = pid_to_thread_id (inferior_ptid);
+
   for (; bsp != NULL; bsp = bsp->next)
     {
       if ((bsp->breakpoint_at != NULL) &&
-         (bsp->breakpoint_at->type == bp_step_resume))
+         (bsp->breakpoint_at->type == bp_step_resume) &&
+         (bsp->breakpoint_at->thread == current_thread || 
+          bsp->breakpoint_at->thread == -1))
        return bsp->breakpoint_at;
     }
 
@@ -1864,12 +1873,10 @@ top:
 static enum print_stop_action
 print_it_typical (bpstat bs)
 {
-#ifdef UI_OUT
   struct cleanup *old_chain;
   struct ui_stream *stb;
   stb = ui_out_stream_new (uiout);
   old_chain = make_cleanup_ui_out_stream_delete (stb);
-#endif /* UI_OUT */
   /* bs->breakpoint_at can be NULL if it was a momentary breakpoint
      which has since been deleted.  */
   if (bs->breakpoint_at == NULL)
@@ -1879,21 +1886,13 @@ print_it_typical (bpstat bs)
     {
     case bp_breakpoint:
     case bp_hardware_breakpoint:
-#ifdef UI_OUT
       annotate_breakpoint (bs->breakpoint_at->number);
       ui_out_text (uiout, "\nBreakpoint ");
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "reason", "breakpoint-hit");
       ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
       ui_out_text (uiout, ", ");
       return PRINT_SRC_AND_LOC;
-#else
-      /* I think the user probably only wants to see one breakpoint
-         number, not all of them.  */
-      annotate_breakpoint (bs->breakpoint_at->number);
-      printf_filtered ("\nBreakpoint %d, ", bs->breakpoint_at->number);
-      return PRINT_SRC_AND_LOC;
-#endif
       break;
 
     case bp_shlib_event:
@@ -2026,8 +2025,7 @@ print_it_typical (bpstat bs)
       if (bs->old_val != NULL)
        {
          annotate_watchpoint (bs->breakpoint_at->number);
-#ifdef UI_OUT
-         if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+         if (ui_out_is_mi_like_p (uiout))
            ui_out_field_string (uiout, "reason", "watchpoint-trigger");
          mention (bs->breakpoint_at);
          ui_out_tuple_begin (uiout, "value");
@@ -2039,15 +2037,6 @@ print_it_typical (bpstat bs)
          ui_out_field_stream (uiout, "new", stb);
          ui_out_tuple_end (uiout);
          ui_out_text (uiout, "\n");
-#else
-         mention (bs->breakpoint_at);
-         printf_filtered ("\nOld value = ");
-         value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
-         printf_filtered ("\nNew value = ");
-         value_print (bs->breakpoint_at->val, gdb_stdout, 0,
-                      Val_pretty_default);
-         printf_filtered ("\n");
-#endif
          value_free (bs->old_val);
          bs->old_val = NULL;
        }
@@ -2056,8 +2045,7 @@ print_it_typical (bpstat bs)
       break;
 
     case bp_read_watchpoint:
-#ifdef UI_OUT
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
       mention (bs->breakpoint_at);
       ui_out_tuple_begin (uiout, "value");
@@ -2066,22 +2054,14 @@ print_it_typical (bpstat bs)
       ui_out_field_stream (uiout, "value", stb);
       ui_out_tuple_end (uiout);
       ui_out_text (uiout, "\n");
-#else
-      mention (bs->breakpoint_at);
-      printf_filtered ("\nValue = ");
-      value_print (bs->breakpoint_at->val, gdb_stdout, 0,
-                  Val_pretty_default);
-      printf_filtered ("\n");
-#endif
       return PRINT_UNKNOWN;
       break;
 
     case bp_access_watchpoint:
-#ifdef UI_OUT
       if (bs->old_val != NULL)     
        {
          annotate_watchpoint (bs->breakpoint_at->number);
-         if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+         if (ui_out_is_mi_like_p (uiout))
            ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
          mention (bs->breakpoint_at);
          ui_out_tuple_begin (uiout, "value");
@@ -2095,7 +2075,7 @@ print_it_typical (bpstat bs)
       else 
        {
          mention (bs->breakpoint_at);
-         if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+         if (ui_out_is_mi_like_p (uiout))
            ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
          ui_out_tuple_begin (uiout, "value");
          ui_out_text (uiout, "\nValue = ");
@@ -2104,26 +2084,6 @@ print_it_typical (bpstat bs)
       ui_out_field_stream (uiout, "new", stb);
       ui_out_tuple_end (uiout);
       ui_out_text (uiout, "\n");
-#else
-      if (bs->old_val != NULL)     
-       {
-         annotate_watchpoint (bs->breakpoint_at->number);
-         mention (bs->breakpoint_at);
-         printf_filtered ("\nOld value = ");
-         value_print (bs->old_val, gdb_stdout, 0, Val_pretty_default);
-         value_free (bs->old_val);
-         bs->old_val = NULL;
-         printf_filtered ("\nNew value = ");
-       }
-      else 
-       {
-         mention (bs->breakpoint_at);
-         printf_filtered ("\nValue = ");
-       }
-      value_print (bs->breakpoint_at->val, gdb_stdout, 0,
-                  Val_pretty_default);
-      printf_filtered ("\n");
-#endif
       return PRINT_UNKNOWN;
       break;
 
@@ -2131,18 +2091,14 @@ print_it_typical (bpstat bs)
        here. */
 
     case bp_finish:
-#ifdef UI_OUT
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "reason", "function-finished");
-#endif
       return PRINT_UNKNOWN;
       break;
 
     case bp_until:
-#ifdef UI_OUT
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "reason", "location-reached");
-#endif
       return PRINT_UNKNOWN;
       break;
 
@@ -2242,7 +2198,7 @@ bpstat_print (bpstat bs)
 static int
 breakpoint_cond_eval (PTR exp)
 {
-  value_ptr mark = value_mark ();
+  struct value *mark = value_mark ();
   int i = !value_true (evaluate_expression ((struct expression *) exp));
   value_free_to_mark (mark);
   return i;
@@ -2299,6 +2255,14 @@ watchpoint_check (PTR p)
       reinit_frame_cache ();
       fr = find_frame_addr_in_frame_chain (b->watchpoint_frame);
       within_current_scope = (fr != NULL);
+      /* in_function_epilogue_p() returns a non-zero value if we're still
+        in the function but the stack frame has already been invalidated.
+        Since we can't rely on the values of local variables after the
+        stack has been destroyed, we are treating the watchpoint in that
+        state as `not changed' without further checking. */
+      if (within_current_scope && fr == get_current_frame ()
+          && gdbarch_in_function_epilogue_p (current_gdbarch, read_pc ()))
+       return WP_VALUE_NOT_CHANGED;
       if (within_current_scope)
        /* If we end up stopping, the current frame will get selected
           in normal_stop.  So this call to select_frame won't affect
@@ -2313,8 +2277,8 @@ watchpoint_check (PTR p)
          call free_all_values.  We can't call free_all_values because
          we might be in the middle of evaluating a function call.  */
 
-      value_ptr mark = value_mark ();
-      value_ptr new_val = evaluate_expression (bs->breakpoint_at->exp);
+      struct value *mark = value_mark ();
+      struct value *new_val = evaluate_expression (bs->breakpoint_at->exp);
       if (!value_equal (b->val, new_val))
        {
          release_value (new_val);
@@ -2346,22 +2310,16 @@ watchpoint_check (PTR p)
         in this case, by the time we call print_it_typical() this bp
         will be deleted already. So we have no choice but print the
         information here. */
-#ifdef UI_OUT
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        ui_out_field_string (uiout, "reason", "watchpoint-scope");
       ui_out_text (uiout, "\nWatchpoint ");
       ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
       ui_out_text (uiout, " deleted because the program has left the block in\n\
 which its expression is valid.\n");     
-#else
-      printf_filtered ("\
-Watchpoint %d deleted because the program has left the block in\n\
-which its expression is valid.\n", bs->breakpoint_at->number);
-#endif 
 
       if (b->related_breakpoint)
-       b->related_breakpoint->disposition = del_at_next_stop;
-      b->disposition = del_at_next_stop;
+       b->related_breakpoint->disposition = disp_del_at_next_stop;
+      b->disposition = disp_del_at_next_stop;
 
       return WP_DELETED;
     }
@@ -2402,15 +2360,20 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
   "Error evaluating expression for watchpoint %d\n";
   char message[sizeof (message1) + 30 /* slop */ ];
 
-  /* Get the address where the breakpoint would have been.  */
+  /* Get the address where the breakpoint would have been.  
+     The "not_a_breakpoint" argument is meant to distinguish 
+     between a breakpoint trap event and a trace/singlestep
+     trap event.  For a trace/singlestep trap event, we would
+     not want to subtract DECR_PC_AFTER_BREAK from the PC. */
+
   bp_addr = *pc - (not_a_breakpoint && !SOFTWARE_SINGLE_STEP_P () ? 
                    0 : DECR_PC_AFTER_BREAK);
 
   ALL_BREAKPOINTS_SAFE (b, temp)
   {
-    if (b->enable == disabled
-       || b->enable == shlib_disabled
-       || b->enable == call_disabled)
+    if (b->enable_state == bp_disabled
+       || b->enable_state == bp_shlib_disabled
+       || b->enable_state == bp_call_disabled)
       continue;
 
     if (b->type != bp_watchpoint
@@ -2517,8 +2480,8 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
            /* Error from catch_errors.  */
            printf_filtered ("Watchpoint %d deleted.\n", b->number);
            if (b->related_breakpoint)
-             b->related_breakpoint->disposition = del_at_next_stop;
-           b->disposition = del_at_next_stop;
+             b->related_breakpoint->disposition = disp_del_at_next_stop;
+           b->disposition = disp_del_at_next_stop;
            /* We've already printed what needs to be printed.  */
            bs->print_it = print_it_done;
 
@@ -2530,7 +2493,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
             b->type == bp_access_watchpoint)
       {
        CORE_ADDR addr;
-       value_ptr v;
+       struct value *v;
        int found = 0;
 
        addr = target_stopped_data_address ();
@@ -2589,8 +2552,8 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
              /* Error from catch_errors.  */
              printf_filtered ("Watchpoint %d deleted.\n", b->number);
              if (b->related_breakpoint)
-               b->related_breakpoint->disposition = del_at_next_stop;
-             b->disposition = del_at_next_stop;
+               b->related_breakpoint->disposition = disp_del_at_next_stop;
+             b->disposition = disp_del_at_next_stop;
              /* We've already printed what needs to be printed.  */
              bs->print_it = print_it_done;
              break;
@@ -2649,8 +2612,8 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_breakpoint)
        else
          {
            /* We will stop here */
-           if (b->disposition == disable)
-             b->enable = disabled;
+           if (b->disposition == disp_disable)
+             b->enable_state = bp_disabled;
            bs->commands = b->commands;
            if (b->silent)
              bs->print = 0;
@@ -2991,7 +2954,7 @@ bpstat_should_step (void)
 {
   struct breakpoint *b;
   ALL_BREAKPOINTS (b)
-    if (b->enable == enabled && b->type == bp_watchpoint)
+    if (b->enable_state == bp_enabled && b->type == bp_watchpoint)
       return 1;
   return 0;
 }
@@ -3002,7 +2965,7 @@ bpstat_have_active_hw_watchpoints (void)
 {
   struct breakpoint *b;
   ALL_BREAKPOINTS (b)
-    if ((b->enable == enabled) &&
+    if ((b->enable_state == bp_enabled) &&
        (b->inserted) &&
        ((b->type == bp_hardware_watchpoint) ||
         (b->type == bp_read_watchpoint) ||
@@ -3119,23 +3082,15 @@ print_one_breakpoint (struct breakpoint *b,
   {"del", "dstp", "dis", "keep"};
   static char bpenables[] = "nynny";
   char wrap_indent[80];
-#ifdef UI_OUT
   struct ui_stream *stb = ui_out_stream_new (uiout);
   struct cleanup *old_chain = make_cleanup_ui_out_stream_delete (stb);
-#endif
 
   annotate_record ();
-#ifdef UI_OUT
   ui_out_tuple_begin (uiout, "bkpt");
-#endif
 
   /* 1 */
   annotate_field (0);
-#ifdef UI_OUT
   ui_out_field_int (uiout, "number", b->number);
-#else
-  printf_filtered ("%-3d ", b->number);
-#endif
 
   /* 2 */
   annotate_field (1);
@@ -3144,28 +3099,16 @@ print_one_breakpoint (struct breakpoint *b,
     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);
-#else
-  printf_filtered ("%-14s ", bptypes[(int) b->type].description);
-#endif
 
   /* 3 */
   annotate_field (2);
-#ifdef UI_OUT
   ui_out_field_string (uiout, "disp", bpdisps[(int) b->disposition]);
-#else
-  printf_filtered ("%-4s ", bpdisps[(int) b->disposition]);
-#endif
 
   /* 4 */
   annotate_field (3);
-#ifdef UI_OUT
-  ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable]);
+  ui_out_field_fmt (uiout, "enabled", "%c", bpenables[(int) b->enable_state]);
   ui_out_spaces (uiout, 2);
-#else
-  printf_filtered ("%-3c ", bpenables[(int) b->enable]);
-#endif
   
   /* 5 and 6 */
   strcpy (wrap_indent, "                           ");
@@ -3190,16 +3133,11 @@ print_one_breakpoint (struct breakpoint *b,
       /* Field 4, the address, is omitted (which makes the columns
         not line up too nicely with the headers, but the effect
         is relatively readable).  */
-#ifdef UI_OUT
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
       print_expression (b->exp, stb->stream);
       ui_out_field_stream (uiout, "what", stb);
-#else
-      annotate_field (5);
-      print_expression (b->exp, gdb_stdout);
-#endif
       break;
       
     case bp_catch_load:
@@ -3207,7 +3145,6 @@ print_one_breakpoint (struct breakpoint *b,
       /* Field 4, the address, is omitted (which makes the columns
         not line up too nicely with the headers, but the effect
         is relatively readable).  */
-#ifdef UI_OUT
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
@@ -3222,13 +3159,6 @@ print_one_breakpoint (struct breakpoint *b,
          ui_out_field_string (uiout, "what", b->dll_pathname);
          ui_out_text (uiout, "\" ");
        }
-#else
-      annotate_field (5);
-      if (b->dll_pathname == NULL)
-       printf_filtered ("<any library> ");
-      else
-       printf_filtered ("library \"%s\" ", b->dll_pathname);
-#endif
       break;
       
     case bp_catch_fork:
@@ -3236,7 +3166,6 @@ print_one_breakpoint (struct breakpoint *b,
       /* Field 4, the address, is omitted (which makes the columns
         not line up too nicely with the headers, but the effect
         is relatively readable).  */
-#ifdef UI_OUT
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
@@ -3246,18 +3175,11 @@ print_one_breakpoint (struct breakpoint *b,
          ui_out_field_int (uiout, "what", b->forked_inferior_pid);
          ui_out_spaces (uiout, 1);
        }
-#else
-      annotate_field (5);
-      if (b->forked_inferior_pid != 0)
-       printf_filtered ("process %d ", b->forked_inferior_pid);
-      break;
-#endif
       
     case bp_catch_exec:
       /* Field 4, the address, is omitted (which makes the columns
         not line up too nicely with the headers, but the effect
         is relatively readable).  */
-#ifdef UI_OUT
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
@@ -3267,43 +3189,28 @@ print_one_breakpoint (struct breakpoint *b,
          ui_out_field_string (uiout, "what", b->exec_pathname);
          ui_out_text (uiout, "\" ");
        }
-#else
-      annotate_field (5);
-      if (b->exec_pathname != NULL)
-       printf_filtered ("program \"%s\" ", b->exec_pathname);
-#endif
       break;
 
     case bp_catch_catch:
       /* Field 4, the address, is omitted (which makes the columns
         not line up too nicely with the headers, but the effect
         is relatively readable).  */
-#ifdef UI_OUT
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
       ui_out_field_string (uiout, "what", "exception catch");
       ui_out_spaces (uiout, 1);
-#else
-      annotate_field (5);
-      printf_filtered ("exception catch ");
-#endif
       break;
 
     case bp_catch_throw:
       /* Field 4, the address, is omitted (which makes the columns
         not line up too nicely with the headers, but the effect
         is relatively readable).  */
-#ifdef UI_OUT
       if (addressprint)
        ui_out_field_skip (uiout, "addr");
       annotate_field (5);
       ui_out_field_string (uiout, "what", "exception throw");
       ui_out_spaces (uiout, 1);
-#else
-      annotate_field (5);
-      printf_filtered ("exception throw ");
-#endif
       break;
       
     case bp_breakpoint:
@@ -3318,7 +3225,6 @@ print_one_breakpoint (struct breakpoint *b,
     case bp_call_dummy:
     case bp_shlib_event:
     case bp_thread_event:
-#ifdef UI_OUT
       if (addressprint)
        {
          annotate_field (4);
@@ -3346,106 +3252,47 @@ print_one_breakpoint (struct breakpoint *b,
          print_address_symbolic (b->address, stb->stream, demangle, "");
          ui_out_field_stream (uiout, "at", stb);
        }
-#else
-      if (addressprint)
-       {
-         char *tmp;
-
-         annotate_field (4);
-
-         if (TARGET_ADDR_BIT <= 32)
-           tmp = longest_local_hex_string_custom (b->address
-                                                  & (CORE_ADDR) 0xffffffff, 
-                                                  "08l");
-         else
-           tmp = longest_local_hex_string_custom (b->address, "016l");
-
-         printf_filtered ("%s ", tmp);
-       }
-      annotate_field (5);
-      *last_addr = b->address;
-      if (b->source_file)
-       {
-         sym = find_pc_sect_function (b->address, b->section);
-         if (sym)
-           {
-             fputs_filtered ("in ", gdb_stdout);
-             fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
-             wrap_here (wrap_indent);
-             fputs_filtered (" at ", gdb_stdout);
-           }
-         fputs_filtered (b->source_file, gdb_stdout);
-         printf_filtered (":%d", b->line_number);
-       }
-      else
-       print_address_symbolic (b->address, gdb_stdout, demangle, " ");
-#endif
       break;
     }
   
   if (b->thread != -1)
     {
-#ifdef UI_OUT
       /* FIXME: This seems to be redundant and lost here; see the
         "stop only in" line a little further down. */
       ui_out_text (uiout, " thread ");
       ui_out_field_int (uiout, "thread", b->thread);
-#else
-      printf_filtered (" thread %d", b->thread);
-#endif
     }
   
-#ifdef UI_OUT
   ui_out_text (uiout, "\n");
-#else
-  printf_filtered ("\n");
-#endif
   
   if (b->frame)
     {
       annotate_field (6);
-#ifdef UI_OUT
       ui_out_text (uiout, "\tstop only in stack frame at ");
       ui_out_field_core_addr (uiout, "frame", b->frame);
       ui_out_text (uiout, "\n");
-#else
-      printf_filtered ("\tstop only in stack frame at ");
-      print_address_numeric (b->frame, 1, gdb_stdout);
-      printf_filtered ("\n");
-#endif
     }
   
   if (b->cond)
     {
       annotate_field (7);
-#ifdef UI_OUT
       ui_out_text (uiout, "\tstop only if ");
       print_expression (b->cond, stb->stream);
       ui_out_field_stream (uiout, "cond", stb);
       ui_out_text (uiout, "\n");
-#else
-      printf_filtered ("\tstop only if ");
-      print_expression (b->cond, gdb_stdout);
-      printf_filtered ("\n");
-#endif
     }
   
   if (b->thread != -1)
     {
       /* FIXME should make an annotation for this */
-#ifdef UI_OUT
       ui_out_text (uiout, "\tstop only in thread ");
       ui_out_field_int (uiout, "thread", b->thread);
       ui_out_text (uiout, "\n");
-#else
-      printf_filtered ("\tstop only in thread %d\n", b->thread);
-#endif
     }
   
   if (show_breakpoint_hit_counts && b->hit_count)
     {
       /* FIXME should make an annotation for this */
-#ifdef UI_OUT
       if (ep_is_catchpoint (b))
        ui_out_text (uiout, "\tcatchpoint");
       else
@@ -3456,55 +3303,31 @@ print_one_breakpoint (struct breakpoint *b,
        ui_out_text (uiout, " time\n");
       else
        ui_out_text (uiout, " times\n");
-#else
-      if (ep_is_catchpoint (b))
-       printf_filtered ("\tcatchpoint");
-      else
-       printf_filtered ("\tbreakpoint");
-      printf_filtered (" already hit %d time%s\n",
-                      b->hit_count, (b->hit_count == 1 ? "" : "s"));
-#endif
     }
   
-#ifdef UI_OUT
   /* Output the count also if it is zero, but only if this is
      mi. FIXME: Should have a better test for this. */
-  if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+  if (ui_out_is_mi_like_p (uiout))
     if (show_breakpoint_hit_counts && b->hit_count == 0)
       ui_out_field_int (uiout, "times", b->hit_count);
-#endif
 
   if (b->ignore_count)
     {
       annotate_field (8);
-#ifdef UI_OUT
       ui_out_text (uiout, "\tignore next ");
       ui_out_field_int (uiout, "ignore", b->ignore_count);
       ui_out_text (uiout, " hits\n");
-#else
-      printf_filtered ("\tignore next %d hits\n", b->ignore_count);
-#endif
     }
   
   if ((l = b->commands))
     {
       annotate_field (9);
-#ifdef UI_OUT
       ui_out_tuple_begin (uiout, "script");
       print_command_lines (uiout, l, 4);
       ui_out_tuple_end (uiout);
-#else
-      while (l)
-       {
-         print_command_line (l, 4, gdb_stdout);
-         l = l->next;
-       }
-#endif
     }
-#ifdef UI_OUT
   ui_out_tuple_end (uiout);
   do_cleanups (old_chain);
-#endif
 }
 
 struct captured_breakpoint_query_args
@@ -3513,7 +3336,7 @@ struct captured_breakpoint_query_args
   };
 
 static int
-do_captured_breakpoint_query (void *data)
+do_captured_breakpoint_query (struct ui_out *uiout, void *data)
 {
   struct captured_breakpoint_query_args *args = data;
   register struct breakpoint *b;
@@ -3530,33 +3353,92 @@ do_captured_breakpoint_query (void *data)
 }
 
 enum gdb_rc
-gdb_breakpoint_query (/* output object, */ int bnum)
+gdb_breakpoint_query (struct ui_out *uiout, int bnum)
 {
   struct captured_breakpoint_query_args args;
   args.bnum = bnum;
   /* For the moment we don't trust print_one_breakpoint() to not throw
      an error. */
-  return catch_errors (do_captured_breakpoint_query, &args,
-                      NULL, RETURN_MASK_ALL);
+  return catch_exceptions (uiout, do_captured_breakpoint_query, &args,
+                          NULL, RETURN_MASK_ALL);
 }
 
-/* Print information on breakpoint number BNUM, or -1 if all.
-   If WATCHPOINTS is zero, process only breakpoints; if WATCHPOINTS
-   is nonzero, process only watchpoints.  */
+/* Return non-zero if B is user settable (breakpoints, watchpoints,
+   catchpoints, et.al.). */
+
+static int
+user_settable_breakpoint (const struct breakpoint *b)
+{
+  return (b->type == bp_breakpoint
+         || b->type == bp_catch_load
+         || b->type == bp_catch_unload
+         || b->type == bp_catch_fork
+         || b->type == bp_catch_vfork
+         || b->type == bp_catch_exec
+         || b->type == bp_catch_catch
+         || b->type == bp_catch_throw
+         || b->type == bp_hardware_breakpoint
+         || b->type == bp_watchpoint
+         || b->type == bp_read_watchpoint
+         || b->type == bp_access_watchpoint
+         || b->type == bp_hardware_watchpoint);
+}
+       
+/* Print information on user settable breakpoint (watchpoint, etc)
+   number BNUM.  If BNUM is -1 print all user settable breakpoints.
+   If ALLFLAG is non-zero, include non- user settable breakpoints. */
 
 static void
 breakpoint_1 (int bnum, int allflag)
 {
   register struct breakpoint *b;
   CORE_ADDR last_addr = (CORE_ADDR) -1;
-  int found_a_breakpoint = 0;
+  int nr_printable_breakpoints;
   
-#ifdef UI_OUT
+  /* Compute the number of rows in the table. */
+  nr_printable_breakpoints = 0;
+  ALL_BREAKPOINTS (b)
+    if (bnum == -1
+       || bnum == b->number)
+      {
+       if (allflag || user_settable_breakpoint (b))
+         nr_printable_breakpoints++;
+      }
+
   if (addressprint)
-    ui_out_table_begin (uiout, 6, "BreakpointTable");
+    ui_out_table_begin (uiout, 6, nr_printable_breakpoints, "BreakpointTable");
   else
-    ui_out_table_begin (uiout, 5, "BreakpointTable");
-#endif /* UI_OUT */
+    ui_out_table_begin (uiout, 5, nr_printable_breakpoints, "BreakpointTable");
+
+  if (nr_printable_breakpoints > 0)
+    annotate_breakpoints_headers ();
+  if (nr_printable_breakpoints > 0)
+    annotate_field (0);
+  ui_out_table_header (uiout, 3, ui_left, "number", "Num");            /* 1 */
+  if (nr_printable_breakpoints > 0)
+    annotate_field (1);
+  ui_out_table_header (uiout, 14, ui_left, "type", "Type");            /* 2 */
+  if (nr_printable_breakpoints > 0)
+    annotate_field (2);
+  ui_out_table_header (uiout, 4, ui_left, "disp", "Disp");             /* 3 */
+  if (nr_printable_breakpoints > 0)
+    annotate_field (3);
+  ui_out_table_header (uiout, 3, ui_left, "enabled", "Enb");   /* 4 */
+  if (addressprint)
+       {
+         if (nr_printable_breakpoints > 0)
+           annotate_field (4);
+         if (TARGET_ADDR_BIT <= 32)
+           ui_out_table_header (uiout, 10, ui_left, "addr", "Address");/* 5 */
+         else
+           ui_out_table_header (uiout, 18, ui_left, "addr", "Address");/* 5 */
+       }
+  if (nr_printable_breakpoints > 0)
+    annotate_field (5);
+  ui_out_table_header (uiout, 40, ui_noalign, "what", "What"); /* 6 */
+  ui_out_table_body (uiout);
+  if (nr_printable_breakpoints > 0)
+    annotate_breakpoints_table ();
 
   ALL_BREAKPOINTS (b)
     if (bnum == -1
@@ -3564,85 +3446,19 @@ breakpoint_1 (int bnum, int allflag)
       {
        /* We only print out user settable breakpoints unless the
           allflag is set. */
-       if (!allflag
-           && b->type != bp_breakpoint
-           && b->type != bp_catch_load
-           && b->type != bp_catch_unload
-           && b->type != bp_catch_fork
-           && b->type != bp_catch_vfork
-           && b->type != bp_catch_exec
-           && b->type != bp_catch_catch
-           && b->type != bp_catch_throw
-           && b->type != bp_hardware_breakpoint
-           && b->type != bp_watchpoint
-           && b->type != bp_read_watchpoint
-           && b->type != bp_access_watchpoint
-           && b->type != bp_hardware_watchpoint)
-         continue;
-       
-       if (!found_a_breakpoint++)
-         {
-           annotate_breakpoints_headers ();
-#ifdef UI_OUT
-           annotate_field (0);
-           ui_out_table_header (uiout, 3, ui_left, "Num");     /* 1 */
-           annotate_field (1);
-           ui_out_table_header (uiout, 14, ui_left, "Type");   /* 2 */
-           annotate_field (2);
-           ui_out_table_header (uiout, 4, ui_left, "Disp");    /* 3 */
-           annotate_field (3);
-           ui_out_table_header (uiout, 3, ui_left, "Enb");     /* 4 */
-           if (addressprint)
-             {
-               annotate_field (4);
-               if (TARGET_ADDR_BIT <= 32)
-                 ui_out_table_header (uiout, 10, ui_left, "Address");  /* 5 */
-               else
-                 ui_out_table_header (uiout, 18, ui_left, "Address");  /* 5 */
-             }
-           annotate_field (5);
-           ui_out_table_header (uiout, 40, ui_noalign, "What");        /* 6 */
-           ui_out_table_body (uiout);
-#else
-           annotate_field (0);
-           printf_filtered ("Num ");
-           annotate_field (1);
-           printf_filtered ("Type           ");
-           annotate_field (2);
-           printf_filtered ("Disp ");
-           annotate_field (3);
-           printf_filtered ("Enb ");
-           if (addressprint)
-             {
-               annotate_field (4);
-               if (TARGET_ADDR_BIT <= 32)
-                 printf_filtered ("Address    ");
-               else
-                 printf_filtered ("Address            ");
-             }
-           annotate_field (5);
-           printf_filtered ("What\n");
-#endif /* UI_OUT */
-           annotate_breakpoints_table ();
-         }
-       
-       print_one_breakpoint (b, &last_addr);
+       if (allflag || user_settable_breakpoint (b))
+         print_one_breakpoint (b, &last_addr);
       }
   
-  if (!found_a_breakpoint)
+  ui_out_table_end (uiout);
+
+  if (nr_printable_breakpoints == 0)
     {
-#ifdef UI_OUT
       if (bnum == -1)
        ui_out_message (uiout, 0, "No breakpoints or watchpoints.\n");
       else
        ui_out_message (uiout, 0, "No breakpoint or watchpoint number %d.\n",
                        bnum);
-#else
-      if (bnum == -1)
-       printf_filtered ("No breakpoints or watchpoints.\n");
-      else
-       printf_filtered ("No breakpoint or watchpoint number %d.\n", bnum);
-#endif /* UI_OUT */
     }
   else
     {
@@ -3652,9 +3468,6 @@ breakpoint_1 (int bnum, int allflag)
        set_next_address (last_addr);
     }
 
-#ifdef UI_OUT
-  ui_out_table_end (uiout);
-#endif /* UI_OUT */
   /* FIXME? Should this be moved up so that it is only called when
      there have been breakpoints? */
   annotate_breakpoints_table_end ();
@@ -3708,10 +3521,10 @@ describe_other_breakpoints (CORE_ADDR pc, asection *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)"
+                            ((b->enable_state == bp_disabled || 
+                              b->enable_state == bp_shlib_disabled || 
+                              b->enable_state == bp_call_disabled) ? " (disabled)" 
+                             : b->enable_state == bp_permanent ? " (permanent)"
                              : ""),
                             (others > 1) ? "," 
                             : ((others == 1) ? " and" : ""));
@@ -3735,6 +3548,40 @@ set_default_breakpoint (int valid, CORE_ADDR addr, struct symtab *symtab,
   default_breakpoint_line = line;
 }
 
+/* Return true iff it is meaningful to use the address member of
+   BPT.  For some breakpoint types, the address member is irrelevant
+   and it makes no sense to attempt to compare it to other addresses
+   (or use it for any other purpose either).
+
+   More specifically, each of the following breakpoint types will always
+   have a zero valued address and we don't want check_duplicates() to mark
+   breakpoints of any of these types to be a duplicate of an actual
+   breakpoint at address zero:
+
+      bp_watchpoint
+      bp_hardware_watchpoint
+      bp_read_watchpoint
+      bp_access_watchpoint
+      bp_catch_exec
+      bp_longjmp_resume
+      bp_catch_fork
+      bp_catch_vork */
+
+static int
+breakpoint_address_is_meaningful (struct breakpoint *bpt)
+{
+  enum bptype type = bpt->type;
+
+  return (type != bp_watchpoint
+         && type != bp_hardware_watchpoint
+         && type != bp_read_watchpoint
+         && type != bp_access_watchpoint
+         && type != bp_catch_exec
+         && type != bp_longjmp_resume
+         && type != bp_catch_fork
+         && type != bp_catch_vfork);
+}
+
 /* Rescan breakpoints at the same address and section as BPT,
    marking the first one as "first" and any others as "duplicates".
    This is so that the bpt instruction is only inserted once.
@@ -3750,22 +3597,19 @@ check_duplicates (struct breakpoint *bpt)
   CORE_ADDR address = bpt->address;
   asection *section = bpt->section;
 
-  /* Watchpoints are uninteresting.  */
-  if (bpt->type == bp_watchpoint
-      || bpt->type == bp_hardware_watchpoint
-      || bpt->type == bp_read_watchpoint
-      || bpt->type == bp_access_watchpoint)
+  if (! breakpoint_address_is_meaningful (bpt))
     return;
 
   ALL_BREAKPOINTS (b)
-    if (b->enable != disabled
-       && b->enable != shlib_disabled
-       && b->enable != call_disabled
+    if (b->enable_state != bp_disabled
+       && b->enable_state != bp_shlib_disabled
+       && b->enable_state != bp_call_disabled
        && b->address == address
-       && (overlay_debugging == 0 || b->section == section))
+       && (overlay_debugging == 0 || b->section == section)
+       && breakpoint_address_is_meaningful (b))
     {
       /* Have we found a permanent breakpoint?  */
-      if (b->enable == permanent)
+      if (b->enable_state == bp_permanent)
        {
          perm_bp = b;
          break;
@@ -3796,11 +3640,12 @@ check_duplicates (struct breakpoint *bpt)
                              "another breakpoint was inserted on top of "
                              "a permanent breakpoint");
 
-           if (b->enable != disabled
-               && b->enable != shlib_disabled
-               && b->enable != call_disabled
+           if (b->enable_state != bp_disabled
+               && b->enable_state != bp_shlib_disabled
+               && b->enable_state != bp_call_disabled
                && b->address == address
-               && (overlay_debugging == 0 || b->section == section))
+               && (overlay_debugging == 0 || b->section == section)
+               && breakpoint_address_is_meaningful (b))
              b->duplicate = 1;
          }
     }
@@ -3840,7 +3685,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
   b->input_radix = input_radix;
   b->thread = -1;
   b->line_number = sal.line;
-  b->enable = enabled;
+  b->enable_state = bp_enabled;
   b->next = 0;
   b->silent = 0;
   b->ignore_count = 0;
@@ -3877,7 +3722,7 @@ set_raw_breakpoint (struct symtab_and_line sal, enum bptype bptype)
 void
 make_breakpoint_permanent (struct breakpoint *b)
 {
-  b->enable = permanent;
+  b->enable_state = bp_permanent;
 
   /* By definition, permanent breakpoints are already present in the code.  */
   b->inserted = 1;
@@ -3907,8 +3752,8 @@ create_longjmp_breakpoint (char *func_name)
   b = set_raw_breakpoint (sal,
                           func_name != NULL ? bp_longjmp : bp_longjmp_resume);
 
-  b->disposition = donttouch;
-  b->enable = disabled;
+  b->disposition = disp_donttouch;
+  b->enable_state = bp_disabled;
   b->silent = 1;
   if (func_name)
     b->addr_string = xstrdup (func_name);
@@ -3929,7 +3774,7 @@ enable_longjmp_breakpoint (void)
   ALL_BREAKPOINTS (b)
     if (b->type == bp_longjmp)
     {
-      b->enable = enabled;
+      b->enable_state = bp_enabled;
       check_duplicates (b);
     }
 }
@@ -3943,7 +3788,7 @@ disable_longjmp_breakpoint (void)
     if (b->type == bp_longjmp
        || b->type == bp_longjmp_resume)
     {
-      b->enable = disabled;
+      b->enable_state = bp_disabled;
       check_duplicates (b);
     }
 }
@@ -3961,8 +3806,8 @@ create_thread_event_breakpoint (CORE_ADDR address)
   b = set_raw_breakpoint (sal, bp_thread_event);
   
   b->number = internal_breakpoint_number--;
-  b->disposition = donttouch;
-  b->enable = enabled;
+  b->disposition = disp_donttouch;
+  b->enable_state = bp_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 = xstrdup (addr_string);
@@ -4002,7 +3847,7 @@ create_solib_event_breakpoint (CORE_ADDR address)
   sal.section = find_pc_overlay (sal.pc);
   b = set_raw_breakpoint (sal, bp_shlib_event);
   b->number = internal_breakpoint_number--;
-  b->disposition = donttouch;
+  b->disposition = disp_donttouch;
 
   return b;
 }
@@ -4022,11 +3867,11 @@ disable_breakpoints_in_shlibs (int silent)
 #if defined (PC_SOLIB)
     if (((b->type == bp_breakpoint) ||
         (b->type == bp_hardware_breakpoint)) &&
-       b->enable == enabled &&
+       b->enable_state == bp_enabled &&
        !b->duplicate &&
        PC_SOLIB (b->address))
       {
-       b->enable = shlib_disabled;
+       b->enable_state = bp_shlib_disabled;
        if (!silent)
          {
            if (!disabled_shlib_breaks)
@@ -4049,14 +3894,14 @@ re_enable_breakpoints_in_shlibs (void)
   struct breakpoint *b;
 
   ALL_BREAKPOINTS (b)
-    if (b->enable == shlib_disabled)
+    if (b->enable_state == bp_shlib_disabled)
     {
       char buf[1];
 
       /* Do not reenable the breakpoint if the shared library
          is still not mapped in.  */
       if (target_read_memory (b->address, buf, 1) == 0)
-       b->enable = enabled;
+       b->enable_state = bp_enabled;
     }
 }
 
@@ -4123,8 +3968,8 @@ solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
   else if (addr_start)
     b->addr_string = savestring (addr_start, addr_end - addr_start);
 
-  b->enable = enabled;
-  b->disposition = tempflag ? del : donttouch;
+  b->enable_state = bp_enabled;
+  b->disposition = tempflag ? disp_del : disp_donttouch;
 
   if (dll_pathname == NULL)
     b->dll_pathname = NULL;
@@ -4175,8 +4020,8 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
     NULL : savestring (cond_string, strlen (cond_string));
   b->thread = thread;
   b->addr_string = NULL;
-  b->enable = enabled;
-  b->disposition = tempflag ? del : donttouch;
+  b->enable_state = bp_enabled;
+  b->disposition = tempflag ? disp_del : disp_donttouch;
   b->forked_inferior_pid = 0;
 
   mention (b);
@@ -4214,8 +4059,8 @@ create_exec_event_catchpoint (int tempflag, char *cond_string)
     NULL : savestring (cond_string, strlen (cond_string));
   b->thread = thread;
   b->addr_string = NULL;
-  b->enable = enabled;
-  b->disposition = tempflag ? del : donttouch;
+  b->enable_state = bp_enabled;
+  b->disposition = tempflag ? disp_del : disp_donttouch;
 
   mention (b);
 }
@@ -4228,7 +4073,7 @@ hw_breakpoint_used_count (void)
 
   ALL_BREAKPOINTS (b)
   {
-    if (b->type == bp_hardware_breakpoint && b->enable == enabled)
+    if (b->type == bp_hardware_breakpoint && b->enable_state == bp_enabled)
       i++;
   }
 
@@ -4244,14 +4089,14 @@ hw_watchpoint_used_count (enum bptype type, int *other_type_used)
   *other_type_used = 0;
   ALL_BREAKPOINTS (b)
   {
-    if (b->enable == enabled)
+    if (b->enable_state == bp_enabled)
       {
        if (b->type == type)
          i++;
        else if ((b->type == bp_hardware_watchpoint ||
                  b->type == bp_read_watchpoint ||
                  b->type == bp_access_watchpoint)
-                && b->enable == enabled)
+                && b->enable_state == bp_enabled)
          *other_type_used = 1;
       }
   }
@@ -4273,7 +4118,7 @@ set_longjmp_resume_breakpoint (CORE_ADDR pc, struct frame_info *frame)
     if (b->type == bp_longjmp_resume)
     {
       b->address = pc;
-      b->enable = enabled;
+      b->enable_state = bp_enabled;
       if (frame != NULL)
        b->frame = frame->frame;
       else
@@ -4295,9 +4140,9 @@ disable_watchpoints_before_interactive_call_start (void)
         || (b->type == bp_read_watchpoint)
         || (b->type == bp_access_watchpoint)
         || ep_is_exception_catchpoint (b))
-       && (b->enable == enabled))
+       && (b->enable_state == bp_enabled))
       {
-       b->enable = call_disabled;
+       b->enable_state = bp_call_disabled;
        check_duplicates (b);
       }
   }
@@ -4315,9 +4160,9 @@ enable_watchpoints_after_interactive_call_stop (void)
         || (b->type == bp_read_watchpoint)
         || (b->type == bp_access_watchpoint)
         || ep_is_exception_catchpoint (b))
-       && (b->enable == call_disabled))
+       && (b->enable_state == bp_call_disabled))
       {
-       b->enable = enabled;
+       b->enable_state = bp_enabled;
        check_duplicates (b);
       }
   }
@@ -4334,8 +4179,8 @@ set_momentary_breakpoint (struct symtab_and_line sal, struct frame_info *frame,
 {
   register struct breakpoint *b;
   b = set_raw_breakpoint (sal, type);
-  b->enable = enabled;
-  b->disposition = donttouch;
+  b->enable_state = bp_enabled;
+  b->disposition = disp_donttouch;
   b->frame = (frame ? frame->frame : 0);
 
   /* If we're debugging a multi-threaded program, then we
@@ -4354,13 +4199,11 @@ static void
 mention (struct breakpoint *b)
 {
   int say_where = 0;
-#ifdef UI_OUT
   struct cleanup *old_chain;
   struct ui_stream *stb;
 
   stb = ui_out_stream_new (uiout);
   old_chain = make_cleanup_ui_out_stream_delete (stb);
-#endif /* UI_OUT */
 
   /* FIXME: This is misplaced; mention() is called by things (like hitting a
      watchpoint) other than breakpoint creation.  It should be possible to
@@ -4376,7 +4219,6 @@ mention (struct breakpoint *b)
     case bp_none:
       printf_filtered ("(apparently deleted?) Eventpoint %d: ", b->number);
       break;
-#ifdef UI_OUT
     case bp_watchpoint:
       ui_out_text (uiout, "Watchpoint ");
       ui_out_tuple_begin (uiout, "wpt");
@@ -4395,17 +4237,6 @@ mention (struct breakpoint *b)
       ui_out_field_stream (uiout, "exp", stb);
       ui_out_tuple_end (uiout);
       break;
-#else
-    case bp_watchpoint:
-      printf_filtered ("Watchpoint %d: ", b->number);
-      print_expression (b->exp, gdb_stdout);
-      break;
-    case bp_hardware_watchpoint:
-      printf_filtered ("Hardware watchpoint %d: ", b->number);
-      print_expression (b->exp, gdb_stdout);
-      break;
-#endif
-#ifdef UI_OUT
     case bp_read_watchpoint:
       ui_out_text (uiout, "Hardware read watchpoint ");
       ui_out_tuple_begin (uiout, "hw-rwpt");
@@ -4424,36 +4255,21 @@ mention (struct breakpoint *b)
       ui_out_field_stream (uiout, "exp", stb);
       ui_out_tuple_end (uiout);
       break;
-#else
-    case bp_read_watchpoint:
-      printf_filtered ("Hardware read watchpoint %d: ", b->number);
-      print_expression (b->exp, gdb_stdout);
-      break;
-    case bp_access_watchpoint:
-      printf_filtered ("Hardware access (read/write) watchpoint %d: ", 
-                      b->number);
-      print_expression (b->exp, gdb_stdout);
-      break;
-#endif
     case bp_breakpoint:
-#ifdef UI_OUT
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        {
          say_where = 0;
          break;
        }
-#endif
       printf_filtered ("Breakpoint %d", b->number);
       say_where = 1;
       break;
     case bp_hardware_breakpoint:
-#ifdef UI_OUT
-      if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+      if (ui_out_is_mi_like_p (uiout))
        {
          say_where = 0;
          break;
        }
-#endif
       printf_filtered ("Hardware assisted breakpoint %d", b->number);
       say_where = 1;
       break;
@@ -4504,16 +4320,10 @@ mention (struct breakpoint *b)
       if (b->source_file)
        printf_filtered (": file %s, line %d.",
                         b->source_file, b->line_number);
-      TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, b, 1));
-      TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
     }
-#ifdef UI_OUT
   do_cleanups (old_chain);
-#endif
-#ifdef UI_OUT
-  if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+  if (ui_out_is_mi_like_p (uiout))
     return;
-#endif
   printf_filtered ("\n");
 }
 \f
@@ -4565,7 +4375,7 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
        b->addr_string = addr_string[i];
        b->cond_string = cond_string[i];
        b->ignore_count = ignore_count;
-       b->enable = enabled;
+       b->enable_state = bp_enabled;
        b->disposition = disposition;
        mention (b);
       }
@@ -4790,7 +4600,7 @@ break_command_1 (char *arg, int flag, int from_tty)
 
   create_breakpoints (sals, addr_string, cond, cond_string,
                      hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
-                     tempflag ? del : donttouch,
+                     tempflag ? disp_del : disp_donttouch,
                      thread, ignore_count, from_tty);
 
   if (sals.nelts > 1)
@@ -4902,7 +4712,7 @@ do_captured_breakpoint (void *data)
 
   create_breakpoints (sals, addr_string, cond, cond_string,
                      args->hardwareflag ? bp_hardware_breakpoint : bp_breakpoint,
-                     args->tempflag ? del : donttouch,
+                     args->tempflag ? disp_del : disp_donttouch,
                      args->thread, args->ignore_count, 0/*from-tty*/);
 
   /* That's it. Discard the cleanups for data inserted into the
@@ -5368,7 +5178,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
   b = set_raw_breakpoint (sal, bp_type);
   set_breakpoint_count (breakpoint_count + 1);
   b->number = breakpoint_count;
-  b->disposition = donttouch;
+  b->disposition = disp_donttouch;
   b->exp = exp;
   b->exp_valid_block = exp_valid_block;
   b->exp_string = savestring (exp_start, exp_end - exp_start);
@@ -5407,10 +5217,10 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
          set_breakpoint_count (breakpoint_count + 1);
          scope_breakpoint->number = breakpoint_count;
 
-         scope_breakpoint->enable = enabled;
+         scope_breakpoint->enable_state = bp_enabled;
 
          /* Automatically delete the breakpoint when it hits.  */
-         scope_breakpoint->disposition = del;
+         scope_breakpoint->disposition = disp_del;
 
          /* Only break in the proper frame (help with recursion).  */
          scope_breakpoint->frame = prev_frame->frame;
@@ -5513,39 +5323,36 @@ can_use_hardware_watchpoint (struct value *v)
   return found_memory_cnt;
 }
 
-#ifdef UI_OUT
 void
 watch_command_wrapper (char *arg, int from_tty)
 {
   watch_command (arg, from_tty);
 }
-#endif
+
 static void
 watch_command (char *arg, int from_tty)
 {
   watch_command_1 (arg, hw_write, from_tty);
 }
 
-#ifdef UI_OUT
 void
 rwatch_command_wrapper (char *arg, int from_tty)
 {
   rwatch_command (arg, from_tty);
 }
-#endif
+
 static void
 rwatch_command (char *arg, int from_tty)
 {
   watch_command_1 (arg, hw_read, from_tty);
 }
 
-#ifdef UI_OUT
 void
 awatch_command_wrapper (char *arg, int from_tty)
 {
   awatch_command (arg, from_tty);
 }
-#endif
+
 static void
 awatch_command (char *arg, int from_tty)
 {
@@ -5800,15 +5607,11 @@ get_catch_sals (int this_level_only)
          if (blocks_searched[index] == 0)
            {
              struct block *b = BLOCKVECTOR_BLOCK (bl, index);
-             int nsyms;
              register int i;
              register struct symbol *sym;
 
-             nsyms = BLOCK_NSYMS (b);
-
-             for (i = 0; i < nsyms; i++)
+             ALL_BLOCK_SYMBOLS (b, i, sym)
                {
-                 sym = BLOCK_SYM (b, i);
                  if (STREQ (SYMBOL_NAME (sym), "default"))
                    {
                      if (have_default)
@@ -6161,8 +5964,8 @@ create_exception_catchpoint (int tempflag, char *cond_string,
     NULL : savestring (cond_string, strlen (cond_string));
   b->thread = thread;
   b->addr_string = NULL;
-  b->enable = enabled;
-  b->disposition = tempflag ? del : donttouch;
+  b->enable_state = bp_enabled;
+  b->disposition = tempflag ? disp_del : disp_donttouch;
   mention (b);
 }
 
@@ -6225,7 +6028,7 @@ cover_target_enable_exception_callback (PTR arg)
 {
   args_for_catchpoint_enable *args = arg;
   struct symtab_and_line *sal;
-  sal = target_enable_exception_callback (args->kind, args->enable);
+  sal = target_enable_exception_callback (args->kind, args->enable_p);
   if (sal == NULL)
     return 0;
   else if (sal == (struct symtab_and_line *) -1)
@@ -6325,8 +6128,8 @@ handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty)
       b->number = breakpoint_count;
 
       b->cond = cond;
-      b->enable = enabled;
-      b->disposition = tempflag ? del : donttouch;
+      b->enable_state = bp_enabled;
+      b->disposition = tempflag ? disp_del : disp_donttouch;
 
       mention (b);
     }
@@ -6355,8 +6158,8 @@ create_temp_exception_breakpoint (CORE_ADDR pc)
 
   b = set_raw_breakpoint (sal, bp_breakpoint);
 
-  b->disposition = del;
-  b->enable = enabled;
+  b->disposition = disp_del;
+  b->enable_state = bp_enabled;
   b->silent = 1;
   b->number = internal_breakpoint_number--;
   return b;
@@ -6680,13 +6483,13 @@ breakpoint_auto_delete (bpstat bs)
   struct breakpoint *b, *temp;
 
   for (; bs; bs = bs->next)
-    if (bs->breakpoint_at && bs->breakpoint_at->disposition == del
+    if (bs->breakpoint_at && bs->breakpoint_at->disposition == disp_del
        && bs->stop)
       delete_breakpoint (bs->breakpoint_at);
 
   ALL_BREAKPOINTS_SAFE (b, temp)
   {
-    if (b->disposition == del_at_next_stop)
+    if (b->disposition == disp_del_at_next_stop)
       delete_breakpoint (b);
   }
 }
@@ -6725,7 +6528,7 @@ delete_breakpoint (struct breakpoint *bpt)
   breakpoint_delete_event (bpt->number);
 
   if (bpt->inserted)
-    remove_breakpoint (bpt, mark_uninserted);
+    remove_breakpoint (bpt, mark_inserted);
 
   if (breakpoint_chain == bpt)
     breakpoint_chain = bpt->next;
@@ -6746,7 +6549,7 @@ delete_breakpoint (struct breakpoint *bpt)
       sprintf (message, message1, bpt->number);
       args.kind = bpt->type == bp_catch_catch ? 
        EX_EVENT_CATCH : EX_EVENT_THROW;
-      args.enable = 0;
+      args.enable_p = 0;
       catch_errors (cover_target_enable_exception_callback, &args,
                    message, RETURN_MASK_ALL);
     }
@@ -6759,26 +6562,6 @@ delete_breakpoint (struct breakpoint *bpt)
       break;
     }
 
-  /* Before turning off the visuals for the bp, check to see that
-     there are no other bps at the same address. */
-  if (tui_version)
-    {
-      int clearIt;
-
-      ALL_BREAKPOINTS (b)
-      {
-       clearIt = (b->address != bpt->address);
-       if (!clearIt)
-         break;
-      }
-
-      if (clearIt)
-       {
-         TUIDO (((TuiOpaqueFuncPtr) tui_vAllSetHasBreakAt, bpt, 0));
-         TUIDO (((TuiOpaqueFuncPtr) tuiUpdateAllExecInfos));
-       }
-    }
-
   check_duplicates (bpt);
   /* If this breakpoint was inserted, and there is another breakpoint
      at the same address, we need to insert the other breakpoint.  */
@@ -6794,9 +6577,9 @@ delete_breakpoint (struct breakpoint *bpt)
        if (b->address == bpt->address
            && b->section == bpt->section
            && !b->duplicate
-           && b->enable != disabled
-           && b->enable != shlib_disabled
-           && b->enable != call_disabled)
+           && b->enable_state != bp_disabled
+           && b->enable_state != bp_shlib_disabled
+           && b->enable_state != bp_call_disabled)
        {
          int val;
 
@@ -6804,7 +6587,7 @@ delete_breakpoint (struct breakpoint *bpt)
             breakpoint at the same address as the one being deleted.
             If there is a permanent breakpoint somewhere, it should
             always be the only one inserted.  */
-         if (b->enable == permanent)
+         if (b->enable_state == bp_permanent)
            internal_error (__FILE__, __LINE__,
                            "another breakpoint was inserted on top of "
                            "a permanent breakpoint");
@@ -6940,7 +6723,7 @@ breakpoint_re_set_one (PTR bint)
   int i;
   struct symtabs_and_lines sals;
   char *s;
-  enum enable save_enable;
+  enum enable_state save_enable;
 
   switch (b->type)
     {
@@ -6958,10 +6741,32 @@ breakpoint_re_set_one (PTR bint)
          delete_breakpoint (b);
          return 0;
        }
-      /* In case we have a problem, disable this breakpoint.  We'll restore
-         its status if we succeed.  */
-      save_enable = b->enable;
-      b->enable = disabled;
+      /* HACK: cagney/2001-11-11: kettenis/2001-11-11: MarkK wrote:
+
+        ``And a hack it is, although Apple's Darwin version of GDB
+        contains an almost identical hack to implement a "future
+        break" command.  It seems to work in many real world cases,
+        but it is easy to come up with a test case where the patch
+        doesn't help at all.''
+
+        ``It seems that the way GDB implements breakpoints - in -
+        shared - libraries was designed for a.out shared library
+        systems (SunOS 4) where shared libraries were loaded at a
+        fixed address in memory.  Since ELF shared libraries can (and
+        will) be loaded at any address in memory, things break.
+        Fixing this is not trivial.  Therefore, I'm not sure whether
+        we should add this hack to the branch only.  I cannot
+        guarantee that things will be fixed on the trunk in the near
+        future.''
+
+         In case we have a problem, disable this breakpoint.  We'll
+         restore its status if we succeed.  Don't disable a
+         shlib_disabled breakpoint though.  There's a fair chance we
+         can't re-set it if the shared library it's in hasn't been
+         loaded yet.  */
+      save_enable = b->enable_state;
+      if (b->enable_state != bp_shlib_disabled)
+        b->enable_state = bp_disabled;
 
       set_language (b->language);
       input_radix = b->input_radix;
@@ -7017,7 +6822,7 @@ breakpoint_re_set_one (PTR bint)
              breakpoints_changed ();
            }
          b->section = sals.sals[i].section;
-         b->enable = save_enable;      /* Restore it, this worked. */
+         b->enable_state = save_enable;        /* Restore it, this worked. */
 
 
          /* Now that this is re-enabled, check_duplicates
@@ -7061,7 +6866,7 @@ breakpoint_re_set_one (PTR bint)
            xfree (b->cond);
          b->cond = parse_exp_1 (&s, (struct block *) 0, 0);
        }
-      if (b->enable == enabled)
+      if (b->enable_state == bp_enabled)
        mention (b);
       value_free_to_mark (mark);
       break;
@@ -7282,10 +7087,10 @@ disable_breakpoint (struct breakpoint *bpt)
     return;
 
   /* You can't disable permanent breakpoints.  */
-  if (bpt->enable == permanent)
+  if (bpt->enable_state == bp_permanent)
     return;
 
-  bpt->enable = disabled;
+  bpt->enable_state = bp_disabled;
 
   check_duplicates (bpt);
 
@@ -7349,8 +7154,8 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
        error ("Hardware breakpoints used exceeds limit.");
     }
 
-  if (bpt->enable != permanent)
-    bpt->enable = enabled;
+  if (bpt->enable_state != bp_permanent)
+    bpt->enable_state = bp_enabled;
   bpt->disposition = disposition;
   check_duplicates (bpt);
   breakpoints_changed ();
@@ -7374,7 +7179,7 @@ do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
              printf_filtered ("\
 Cannot enable watchpoint %d because the block in which its expression\n\
 is valid is not currently in scope.\n", bpt->number);
-             bpt->enable = disabled;
+             bpt->enable_state = bp_disabled;
              return;
            }
 
@@ -7408,7 +7213,7 @@ is valid is not currently in scope.\n", bpt->number);
              printf_filtered ("\
 Cannot enable watchpoint %d because target watch resources\n\
 have been allocated for other watchpoints.\n", bpt->number);
-             bpt->enable = disabled;
+             bpt->enable_state = bp_disabled;
              value_free_to_mark (mark);
              return;
            }
@@ -7470,7 +7275,7 @@ enable_command (char *args, int from_tty)
 static void
 enable_once_breakpoint (struct breakpoint *bpt)
 {
-  do_enable_breakpoint (bpt, disable);
+  do_enable_breakpoint (bpt, disp_disable);
 }
 
 /* ARGSUSED */
@@ -7483,7 +7288,7 @@ enable_once_command (char *args, int from_tty)
 static void
 enable_delete_breakpoint (struct breakpoint *bpt)
 {
-  do_enable_breakpoint (bpt, del);
+  do_enable_breakpoint (bpt, disp_del);
 }
 
 /* ARGSUSED */
@@ -7544,24 +7349,29 @@ then no output is printed when it is hit, except what the commands print.");
 Usage is `condition N COND', where N is an integer and COND is an\n\
 expression to be evaluated whenever breakpoint N is reached.  ");
 
-  add_com ("tbreak", class_breakpoint, tbreak_command,
-          "Set a temporary breakpoint.  Args like \"break\" command.\n\
+  c = add_com ("tbreak", class_breakpoint, tbreak_command,
+              "Set a temporary breakpoint.  Args like \"break\" command.\n\
 Like \"break\" except the breakpoint is only temporary,\n\
 so it will be deleted when hit.  Equivalent to \"break\" followed\n\
 by using \"enable delete\" on the breakpoint number.");
-  add_com ("txbreak", class_breakpoint, tbreak_at_finish_command,
-          "Set temporary breakpoint at procedure exit.  Either there should\n\
+  c->completer = location_completer;
+
+  c = add_com ("txbreak", class_breakpoint, tbreak_at_finish_command,
+              "Set temporary breakpoint at procedure exit.  Either there should\n\
 be no argument or the argument must be a depth.\n");
+  c->completer = location_completer;
 
-  add_com ("hbreak", class_breakpoint, hbreak_command,
-          "Set a hardware assisted  breakpoint. Args like \"break\" command.\n\
+  c = add_com ("hbreak", class_breakpoint, hbreak_command,
+              "Set a hardware assisted  breakpoint. Args like \"break\" command.\n\
 Like \"break\" except the breakpoint requires hardware support,\n\
 some target hardware may not have this support.");
+  c->completer = location_completer;
 
-  add_com ("thbreak", class_breakpoint, thbreak_command,
-          "Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\
+  c = add_com ("thbreak", class_breakpoint, thbreak_command,
+              "Set a temporary hardware assisted breakpoint. Args like \"break\" command.\n\
 Like \"hbreak\" except the breakpoint is only temporary,\n\
 so it will be deleted when hit.");
+  c->completer = location_completer;
 
   add_prefix_cmd ("enable", class_breakpoint, enable_command,
                  "Enable some breakpoints.\n\
@@ -7663,8 +7473,8 @@ is executing in.\n\
 \n\
 See also the \"delete\" command which clears breakpoints by number.", NULL));
 
-  add_com ("break", class_breakpoint, break_command,
-          concat ("Set breakpoint at specified line or function.\n\
+  c = add_com ("break", class_breakpoint, break_command,
+              concat ("Set breakpoint at specified line or function.\n\
 Argument may be line number, function name, or \"*\" and an address.\n\
 If line number is specified, break at start of code for that line.\n\
 If function is specified, break at start of code for that function.\n\
@@ -7675,6 +7485,8 @@ This is useful for breaking on return to a stack frame.\n\
 Multiple breakpoints at one place are permitted, and useful if conditional.\n\
 \n\
 Do \"help breakpoints\" for info on other commands dealing with breakpoints.", NULL));
+  c->completer = location_completer;
+
   add_com_alias ("b", "break", class_run, 1);
   add_com_alias ("br", "break", class_run, 1);
   add_com_alias ("bre", "break", class_run, 1);
@@ -7820,20 +7632,23 @@ Like \"catch\" except the catchpoint is only temporary,\n\
 so it will be deleted when hit.  Equivalent to \"catch\" followed\n\
 by using \"enable delete\" on the catchpoint number.");
 
-  add_com ("watch", class_breakpoint, watch_command,
-          "Set a watchpoint for an expression.\n\
+  c = add_com ("watch", class_breakpoint, watch_command,
+              "Set a watchpoint for an expression.\n\
 A watchpoint stops execution of your program whenever the value of\n\
 an expression changes.");
+  c->completer = location_completer;
 
-  add_com ("rwatch", class_breakpoint, rwatch_command,
-          "Set a read watchpoint for an expression.\n\
+  c = add_com ("rwatch", class_breakpoint, rwatch_command,
+              "Set a read watchpoint for an expression.\n\
 A watchpoint stops execution of your program whenever the value of\n\
 an expression is read.");
+  c->completer = location_completer;
 
-  add_com ("awatch", class_breakpoint, awatch_command,
-          "Set a watchpoint for an expression.\n\
+  c = add_com ("awatch", class_breakpoint, awatch_command,
+              "Set a watchpoint for an expression.\n\
 A watchpoint stops execution of your program whenever the value of\n\
 an expression is either read or written.");
+  c->completer = location_completer;
 
   add_info ("watchpoints", breakpoints_info,
            "Synonym for ``info breakpoints''.");
This page took 0.312387 seconds and 4 git commands to generate.