2003-07-16 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / breakpoint.h
index 44cde48328ef197828b6e7d2bb4ab5f8f2aacefa..86eec4ae3105280d96e95f09b9f2a3d725388a48 100644 (file)
@@ -28,6 +28,7 @@
 #include "gdb-events.h"
 
 struct value;
+struct block;
 
 /* This is the maximum number of bytes a breakpoint instruction can take.
    Feel free to increase it.  It's just used in a few places to size
@@ -107,6 +108,14 @@ enum bptype
 
     bp_thread_event,
 
+    /* On the same principal, an overlay manager can arrange to call a
+       magic location in the inferior whenever there is an interesting
+       change in overlay status.  GDB can update its overlay tables
+       and fiddle with breakpoints in overlays when this breakpoint 
+       is hit.  */
+
+    bp_overlay_event, 
+
     /* These breakpoints are used to implement the "catch load" command
        on platforms whose dynamic linkers support such functionality.  */
     bp_catch_load,
@@ -175,6 +184,24 @@ enum target_hw_bp_type
     hw_execute = 3             /* Execute HW breakpoint */
   };
 
+/* This structure is a collection of function pointers that, if available,
+   will be called instead of the performing the default action for this
+   bptype.  */
+
+struct breakpoint_ops 
+{
+  /* The normal print routine for this breakpoint, called when we
+     hit it.  */
+  enum print_stop_action (*print_it) (struct breakpoint *);
+
+  /* Display information about this breakpoint, for "info breakpoints".  */
+  void (*print_one) (struct breakpoint *, CORE_ADDR *);
+
+  /* Display information about this breakpoint after setting it (roughly
+     speaking; this is called from "mention").  */
+  void (*print_mention) (struct breakpoint *);
+};
+
 /* Note that the ->silent field is not currently used by any commands
    (though the code is in there if it was to be, and set_raw_breakpoint
    does set it to 0).  I implemented it because I thought it would be
@@ -195,10 +222,10 @@ struct breakpoint
     /* Number assigned to distinguish breakpoints.  */
     int number;
 
-    /* Address to break at.
-       Note that zero is a perfectly valid code address on some
-       platforms (for example, the mn10200 and mn10300 simulators).
-       NULL is not a special value for this field.  */
+    /* Address to break at.  Note that zero is a perfectly valid code
+       address on some platforms (for example, the OBSOLETE mn10200
+       and mn10300 simulators).  NULL is not a special value for this
+       field.  */
     CORE_ADDR address;
 
     /* Line number of this address.  */
@@ -229,7 +256,7 @@ struct breakpoint
     struct command_line *commands;
     /* Stack depth (address of frame).  If nonzero, break only if fp
        equals this.  */
-    CORE_ADDR frame;
+    struct frame_id frame_id;
     /* Conditional.  Break only if this expression's value is nonzero.  */
     struct expression *cond;
 
@@ -262,10 +289,10 @@ struct breakpoint
        it the watchpoint_scope breakpoint or something like that. FIXME).  */
     struct breakpoint *related_breakpoint;
 
-    /* Holds the frame address which identifies the frame this watchpoint
-       should be evaluated in, or NULL if the watchpoint should be evaluated
-       on the outermost frame.  */
-    CORE_ADDR watchpoint_frame;
+    /* Holds the frame address which identifies the frame this
+       watchpoint should be evaluated in, or `null' if the watchpoint
+       should be evaluated on the outermost frame.  */
+    struct frame_id watchpoint_frame;
 
     /* Thread number for thread-specific breakpoint, or -1 if don't care */
     int thread;
@@ -297,6 +324,9 @@ struct breakpoint
     char *exec_pathname;
 
     asection *section;
+
+    /* Methods associated with this breakpoint.  */
+    struct breakpoint_ops *ops;
   };
 \f
 /* The following stuff is an abstract data type "bpstat" ("breakpoint
@@ -314,7 +344,7 @@ extern void bpstat_clear (bpstat *);
    is part of the bpstat is copied as well.  */
 extern bpstat bpstat_copy (bpstat);
 
-extern bpstat bpstat_stop_status (CORE_ADDR *int);
+extern bpstat bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint);
 \f
 /* This bpstat_what stuff tells wait_for_inferior what to do with a
    breakpoint (a challenging task).  */
@@ -513,18 +543,20 @@ enum breakpoint_here
 
 /* Prototypes for breakpoint-related functions.  */
 
-/* Forward declarations for prototypes */
-struct frame_info;
-
 extern enum breakpoint_here breakpoint_here_p (CORE_ADDR);
 
 extern int breakpoint_inserted_here_p (CORE_ADDR);
 
-extern int frame_in_dummy (struct frame_info *);
+/* FIXME: cagney/2002-11-10: The current [generic] dummy-frame code
+   implements a functional superset of this function.  The only reason
+   it hasn't been removed is because some architectures still don't
+   use the new framework.  Once they have been fixed, this can go.  */
+struct frame_info;
+extern int deprecated_frame_in_dummy (struct frame_info *);
 
 extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
 
-extern void until_break_command (char *, int);
+extern void until_break_command (char *, int, int);
 
 extern void breakpoint_re_set (void);
 
@@ -533,7 +565,7 @@ extern void breakpoint_re_set_thread (struct breakpoint *);
 extern int ep_is_exception_catchpoint (struct breakpoint *);
 
 extern struct breakpoint *set_momentary_breakpoint
-  (struct symtab_and_line, struct frame_info *, enum bptype);
+  (struct symtab_and_line, struct frame_id, enum bptype);
 
 extern void set_ignore_count (int, int, int);
 
@@ -603,15 +635,16 @@ extern void update_breakpoints_after_exec (void);
 extern int detach_breakpoints (int);
 
 extern void enable_longjmp_breakpoint (void);
-
 extern void disable_longjmp_breakpoint (void);
+extern void enable_overlay_breakpoints (void);
+extern void disable_overlay_breakpoints (void);
 
-extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_info *);
+extern void set_longjmp_resume_breakpoint (CORE_ADDR, struct frame_id);
 /* These functions respectively disable or reenable all currently
    enabled watchpoints.  When disabled, the watchpoints are marked
    call_disabled.  When reenabled, they are marked enabled.
 
-   The intended client of these functions is infcmd.c\run_stack_dummy.
+   The intended client of these functions is call_function_by_hand.
 
    The inferior must be stopped, and all breakpoints removed, when
    these functions are used.
This page took 0.031932 seconds and 4 git commands to generate.