*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 88eb63430ed4a630d402eba6f2efbaf3bf61384b..4544ed54a63e5c4c55fcd296e4e92551ce37d1c8 100644 (file)
@@ -1,7 +1,7 @@
 /* Everything about breakpoints, for GDB.
 
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
    Foundation, Inc.
 
    This file is part of GDB.
@@ -73,7 +73,7 @@ static void map_breakpoint_numbers (char *, void (*)(struct breakpoint *));
 
 static void ignore_command (char *, int);
 
-static int breakpoint_re_set_one (PTR);
+static int breakpoint_re_set_one (void *);
 
 static void clear_command (char *, int);
 
@@ -108,9 +108,9 @@ static void breakpoint_1 (int, int);
 
 static bpstat bpstat_alloc (struct breakpoint *, bpstat);
 
-static int breakpoint_cond_eval (PTR);
+static int breakpoint_cond_eval (void *);
 
-static void cleanup_executing_breakpoints (PTR);
+static void cleanup_executing_breakpoints (void *);
 
 static void commands_command (char *, int);
 
@@ -140,9 +140,9 @@ typedef struct
   }
 args_for_catchpoint_enable;
 
-static int watchpoint_check (PTR);
+static int watchpoint_check (void *);
 
-static int cover_target_enable_exception_callback (PTR);
+static int cover_target_enable_exception_callback (void *);
 
 static void maintenance_info_breakpoints (char *, int);
 
@@ -735,9 +735,11 @@ insert_breakpoints (void)
 
   ALL_BREAKPOINTS_SAFE (b, temp)
   {
-    if (b->enable_state == bp_permanent)
-      /* Permanent breakpoints cannot be inserted or removed.  */
+    /* Permanent breakpoints cannot be inserted or removed.  Disabled
+       breakpoints should not be inserted.  */
+    if (b->enable_state != bp_enabled)
       continue;
+
     if ((b->type == bp_watchpoint
         || b->type == bp_hardware_watchpoint
         || b->type == bp_read_watchpoint
@@ -759,9 +761,6 @@ insert_breakpoints (void)
        && b->type != bp_catch_exec
        && b->type != bp_catch_throw
        && b->type != bp_catch_catch
-       && b->enable_state != bp_disabled
-       && b->enable_state != bp_shlib_disabled
-       && b->enable_state != bp_call_disabled
        && !b->inserted
        && !b->duplicate)
       {
@@ -880,9 +879,6 @@ insert_breakpoints (void)
          return_val = val;     /* remember failure */
       }
     else if (ep_is_exception_catchpoint (b)
-            && b->enable_state != bp_disabled
-            && b->enable_state != bp_shlib_disabled
-            && b->enable_state != bp_call_disabled
             && !b->inserted
             && !b->duplicate)
 
@@ -940,7 +936,6 @@ insert_breakpoints (void)
     else if ((b->type == bp_hardware_watchpoint ||
              b->type == bp_read_watchpoint ||
              b->type == bp_access_watchpoint)
-            && b->enable_state == bp_enabled
             && b->disposition != disp_del_at_next_stop
             && !b->inserted
             && !b->duplicate)
@@ -1059,7 +1054,6 @@ insert_breakpoints (void)
     else if ((b->type == bp_catch_fork
              || b->type == bp_catch_vfork
              || b->type == bp_catch_exec)
-            && b->enable_state == bp_enabled
             && !b->inserted
             && !b->duplicate)
       {
@@ -1922,7 +1916,7 @@ bpstat_clear_actions (bpstat bs)
 /* Stub for cleaning up our state if we error-out of a breakpoint command */
 /* ARGSUSED */
 static void
-cleanup_executing_breakpoints (PTR ignore)
+cleanup_executing_breakpoints (void *ignore)
 {
   executing_breakpoint_commands = 0;
 }
@@ -2337,7 +2331,7 @@ bpstat_print (bpstat bs)
    make it pass through catch_errors.  */
 
 static int
-breakpoint_cond_eval (PTR exp)
+breakpoint_cond_eval (void *exp)
 {
   struct value *mark = value_mark ();
   int i = !value_true (evaluate_expression ((struct expression *) exp));
@@ -2377,7 +2371,7 @@ bpstat_alloc (struct breakpoint *b, bpstat cbs /* Current "bs" value */ )
 /* Check watchpoint condition.  */
 
 static int
-watchpoint_check (PTR p)
+watchpoint_check (void *p)
 {
   bpstat bs = (bpstat) p;
   struct breakpoint *b;
@@ -5582,7 +5576,7 @@ until_break_command_continuation (struct continuation_arg *arg)
 
 /* ARGSUSED */
 void
-until_break_command (char *arg, int from_tty)
+until_break_command (char *arg, int from_tty, int anywhere)
 {
   struct symtabs_and_lines sals;
   struct symtab_and_line sal;
@@ -5615,9 +5609,16 @@ until_break_command (char *arg, int from_tty)
 
   resolve_sal_pc (&sal);
 
-  breakpoint = 
-    set_momentary_breakpoint (sal,get_frame_id (deprecated_selected_frame),
-                             bp_until);
+  if (anywhere)
+    /* If the user told us to continue until a specified location,
+       we don't specify a frame at which we need to stop.  */
+    breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until);
+  else
+    /* Otherwise, specify the current frame, because we want to stop only
+       at the very same frame.  */
+    breakpoint = set_momentary_breakpoint (sal,
+                                          get_frame_id (deprecated_selected_frame),
+                                          bp_until);
 
   if (!event_loop_p || !target_can_async_p ())
     old_chain = make_cleanup_delete_breakpoint (breakpoint);
@@ -5645,8 +5646,8 @@ until_break_command (char *arg, int from_tty)
       add_continuation (until_break_command_continuation, arg1);
     }
 
-  /* Keep within the current frame */
-
+  /* Keep within the current frame, or in frames called by the current
+     one.  */
   if (prev_frame)
     {
       sal = find_pc_line (get_frame_pc (prev_frame), 0);
@@ -5665,7 +5666,7 @@ until_break_command (char *arg, int from_tty)
   if (!event_loop_p || !target_can_async_p ())
     do_cleanups (old_chain);
 }
-\f
+
 #if 0
 /* These aren't used; I don't konw what they were for.  */
 /* Set a breakpoint at the catch clause for NAME.  */
@@ -6231,7 +6232,7 @@ catch_exception_command_1 (enum exception_event_kind ex_event, char *arg,
    inside a catch_errors */
 
 static int
-cover_target_enable_exception_callback (PTR arg)
+cover_target_enable_exception_callback (void *arg)
 {
   args_for_catchpoint_enable *args = arg;
   struct symtab_and_line *sal;
@@ -6908,7 +6909,7 @@ delete_command (char *arg, int from_tty)
    Unused in this case.  */
 
 static int
-breakpoint_re_set_one (PTR bint)
+breakpoint_re_set_one (void *bint)
 {
   /* get past catch_errs */
   struct breakpoint *b = (struct breakpoint *) bint;
@@ -7049,7 +7050,7 @@ breakpoint_re_set_one (PTR bint)
        value_free (b->val);
       b->val = evaluate_expression (b->exp);
       release_value (b->val);
-      if (VALUE_LAZY (b->val))
+      if (VALUE_LAZY (b->val) && b->enable_state == bp_enabled)
        value_fetch_lazy (b->val);
 
       if (b->cond_string != NULL)
This page took 0.026293 seconds and 4 git commands to generate.