* sparc64-tdep.h (stryct_frame_info, struct trad_frame_saved_reg):
[deliverable/binutils-gdb.git] / gdb / breakpoint.h
index 13e0a570d4b0dceecc880f058d65c02d3f5c3a1b..85cc8b9f3bbf26b240ecf5a13c5635fa90ac21f2 100644 (file)
@@ -184,6 +184,79 @@ enum target_hw_bp_type
     hw_execute = 3             /* Execute HW breakpoint */
   };
 
+/* GDB maintains two types of information about each breakpoint (or
+   watchpoint, or other related event).  The first type corresponds
+   to struct breakpoint; this is a relatively high-level structure
+   which contains the source location(s), stopping conditions, user
+   commands to execute when the breakpoint is hit, and so forth.
+
+   The second type of information corresponds to struct bp_location.
+   Each breakpoint has one or (eventually) more locations associated
+   with it, which represent target-specific and machine-specific
+   mechanisms for stopping the program.  For instance, a watchpoint
+   expression may require multiple hardware watchpoints in order to
+   catch all changes in the value of the expression being watched.  */
+
+enum bp_loc_type
+{
+  bp_loc_software_breakpoint,
+  bp_loc_hardware_breakpoint,
+  bp_loc_hardware_watchpoint,
+  bp_loc_other                 /* Miscellaneous...  */
+};
+
+struct bp_location
+{
+  /* Chain pointer to the next breakpoint location.  */
+  struct bp_location *next;
+
+  /* Type of this breakpoint location.  */
+  enum bp_loc_type loc_type;
+
+  /* Each breakpoint location must belong to exactly one higher-level
+     breakpoint.  This and the DUPLICATE flag are more straightforward
+     than reference counting.  */
+  struct breakpoint *owner;
+
+  /* Nonzero if this breakpoint is now inserted.  */
+  char inserted;
+
+  /* Nonzero if this is not the first breakpoint in the list
+     for the given address.  */
+  char duplicate;
+
+  /* If we someday support real thread-specific breakpoints, then
+     the breakpoint location will need a thread identifier.  */
+
+  /* Data for specific breakpoint types.  These could be a union, but
+     simplicity is more important than memory usage for breakpoints.  */
+
+  /* Note that zero is a perfectly valid code address on some platforms
+     (for example, the mn10200 (OBSOLETE) and mn10300 simulators).  NULL
+     is not a special value for this field.  Valid for all types except
+     bp_loc_other.  */
+  CORE_ADDR address;
+
+  /* For any breakpoint type with an address, this is the BFD section
+     associated with the address.  Used primarily for overlay debugging.  */
+  asection *section;
+
+  /* "Real" contents of byte where breakpoint has been inserted.
+     Valid only when breakpoints are in the program.  Under the complete
+     control of the target insert_breakpoint and remove_breakpoint routines.
+     No other code should assume anything about the value(s) here.
+     Valid only for bp_loc_software_breakpoint.  */
+  char shadow_contents[BREAKPOINT_MAX];
+
+  /* Address at which breakpoint was requested, either by the user or
+     by GDB for internal breakpoints.  This will usually be the same
+     as ``address'' (above) except for cases in which
+     ADJUST_BREAKPOINT_ADDRESS has computed a different address at
+     which to place the breakpoint in order to comply with a
+     processor's architectual constraints.  */
+  CORE_ADDR requested_address;
+};
+
 /* This structure is a collection of function pointers that, if available,
    will be called instead of the performing the default action for this
    bptype.  */
@@ -222,18 +295,8 @@ 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 and mn10300
-       simulators).  NULL is not a special value for this field.  */
-    CORE_ADDR address;
-
-    /* Address at which breakpoint was requested, either by the user or
-       by GDB for internal breakpoints.  This will usually be the same
-       as ``address'' (above) except for cases in which
-       ADJUST_BREAKPOINT_ADDRESS has computed a different address at
-       which to place the breakpoint in order to comply with a
-       processor's architectual constraints.  */
-    CORE_ADDR requested_address;
+    /* Location(s) associated with this high-level breakpoint.  */
+    struct bp_location *loc;
 
     /* Line number of this address.  */
 
@@ -249,16 +312,6 @@ struct breakpoint
     /* Number of stops at this breakpoint that should
        be continued automatically before really stopping.  */
     int ignore_count;
-    /* "Real" contents of byte where breakpoint has been inserted.
-       Valid only when breakpoints are in the program.  Under the complete
-       control of the target insert_breakpoint and remove_breakpoint routines.
-       No other code should assume anything about the value(s) here.  */
-    char shadow_contents[BREAKPOINT_MAX];
-    /* Nonzero if this breakpoint is now inserted.  */
-    char inserted;
-    /* Nonzero if this is not the first breakpoint in the list
-       for the given address.  */
-    char duplicate;
     /* Chain of command lines to execute when this breakpoint is hit.  */
     struct command_line *commands;
     /* Stack depth (address of frame).  If nonzero, break only if fp
@@ -330,8 +383,6 @@ struct breakpoint
        triggered.  */
     char *exec_pathname;
 
-    asection *section;
-
     /* Methods associated with this breakpoint.  */
     struct breakpoint_ops *ops;
   };
This page took 0.024703 seconds and 4 git commands to generate.