+enum target_hw_bp_type
+ {
+ hw_write = 0, /* Common HW watchpoint */
+ hw_read = 1, /* Read HW watchpoint */
+ hw_access = 2, /* Access HW watchpoint */
+ hw_execute = 3 /* Execute HW breakpoint */
+ };
+
+
+/* Information used by targets to insert and remove breakpoints. */
+
+struct bp_target_info
+{
+ /* Address space at which the breakpoint was placed. */
+ struct address_space *placed_address_space;
+
+ /* Address at which the breakpoint was placed. This is normally the
+ same as ADDRESS from the bp_location, except when adjustment
+ happens in gdbarch_breakpoint_from_pc. The most common form of
+ adjustment is stripping an alternate ISA marker from the PC which
+ is used to determine the type of breakpoint to insert. */
+ CORE_ADDR placed_address;
+
+ /* If the breakpoint lives in memory and reading that memory would
+ give back the breakpoint, instead of the original contents, then
+ the original contents are cached here. Only SHADOW_LEN bytes of
+ this buffer are valid, and only when the breakpoint is inserted. */
+ gdb_byte shadow_contents[BREAKPOINT_MAX];
+
+ /* The length of the data cached in SHADOW_CONTENTS. */
+ int shadow_len;
+
+ /* The size of the placed breakpoint, according to
+ gdbarch_breakpoint_from_pc, when the breakpoint was inserted.
+ This is generally the same as SHADOW_LEN, unless we did not need
+ to read from the target to implement the memory breakpoint
+ (e.g. if a remote stub handled the details). We may still need
+ the size to remove the breakpoint safely. */
+ int placed_size;
+};
+
+/* 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 for
+ the same parent breakpoint. */
+ struct bp_location *next;
+
+ /* The reference count. */
+ int refc;
+
+ /* Type of this breakpoint location. */
+ enum bp_loc_type loc_type;
+
+ /* Each breakpoint location must belong to exactly one higher-level
+ breakpoint. This pointer is NULL iff this bp_location is no
+ longer attached to a breakpoint. For example, when a breakpoint
+ is deleted, its locations may still be found in the
+ moribund_locations list, or if we had stopped for it, in
+ bpstats. */
+ struct breakpoint *owner;
+
+ /* Conditional. Break only if this expression's value is nonzero.
+ Unlike string form of condition, which is associated with
+ breakpoint, this is associated with location, since if breakpoint
+ has several locations, the evaluation of expression can be
+ different for different locations. Only valid for real
+ breakpoints; a watchpoint's conditional expression is stored in
+ the owner breakpoint object. */
+ struct expression *cond;
+
+ /* This location's address is in an unloaded solib, and so this
+ location should not be inserted. It will be automatically
+ enabled when that solib is loaded. */
+ char shlib_disabled;
+
+ /* Is this particular location enabled. */
+ char enabled;
+
+ /* 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. */
+
+ /* Architecture associated with this location's address. May be
+ different from the breakpoint architecture. */
+ struct gdbarch *gdbarch;
+
+ /* The program space associated with this breakpoint location
+ address. Note that an address space may be represented in more
+ than one program space (e.g. each uClinux program will be given
+ its own program space, but there will only be one address space
+ for all of them), but we must not insert more than one location
+ at the same address in the same address space. */
+ struct program_space *pspace;
+
+ /* 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 hardware watchpoints, the size of the memory region being
+ watched. */
+ int length;
+
+ /* Type of hardware watchpoint. */
+ enum target_hw_bp_type watchpoint_type;
+
+ /* For any breakpoint type with an address, this is the section
+ associated with the address. Used primarily for overlay
+ debugging. */
+ struct obj_section *section;
+
+ /* 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;
+
+ char *function_name;
+
+ /* Details of the placed breakpoint, when inserted. */
+ struct bp_target_info target_info;
+
+ /* Similarly, for the breakpoint at an overlay's LMA, if necessary. */
+ struct bp_target_info overlay_target_info;
+
+ /* In a non-stop mode, it's possible that we delete a breakpoint,
+ but as we do that, some still running thread hits that breakpoint.
+ For that reason, we need to keep locations belonging to deleted
+ breakpoints for a bit, so that don't report unexpected SIGTRAP.
+ We can't keep such locations forever, so we use a heuristic --
+ after we process certain number of inferior events since
+ breakpoint was deleted, we retire all locations of that breakpoint.
+ This variable keeps a number of events still to go, when
+ it becomes 0 this location is retired. */
+ int events_till_retirement;
+};
+
+/* 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
+{
+ /* Insert the breakpoint or watchpoint or activate the catchpoint.
+ Return 0 for success, 1 if the breakpoint, watchpoint or catchpoint
+ type is not supported, -1 for failure. */
+ int (*insert_location) (struct bp_location *);
+
+ /* Remove the breakpoint/catchpoint that was previously inserted
+ with the "insert" method above. Return 0 for success, 1 if the
+ breakpoint, watchpoint or catchpoint type is not supported,
+ -1 for failure. */
+ int (*remove_location) (struct bp_location *);
+
+ /* Return non-zero if the debugger should tell the user that this
+ breakpoint was hit. */
+ int (*breakpoint_hit) (struct breakpoint *);
+
+ /* Tell how many hardware resources (debug registers) are needed
+ for this breakpoint. If this function is not provided, then
+ the breakpoint or watchpoint needs one debug register. */
+ int (*resources_needed) (const struct bp_location *);
+
+ /* 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 *, struct bp_location **);
+
+ /* Display information about this breakpoint after setting it
+ (roughly speaking; this is called from "mention"). */
+ void (*print_mention) (struct breakpoint *);
+
+ /* Print to FP the CLI command that recreates this breakpoint. */
+ void (*print_recreate) (struct breakpoint *, struct ui_file *fp);
+};
+
+enum watchpoint_triggered
+{
+ /* This watchpoint definitely did not trigger. */
+ watch_triggered_no = 0,
+
+ /* Some hardware watchpoint triggered, and it might have been this
+ one, but we do not know which it was. */
+ watch_triggered_unknown,
+
+ /* This hardware watchpoint definitely did trigger. */
+ watch_triggered_yes
+};
+
+/* This is used to declare the VEC syscalls_to_be_caught. */
+DEF_VEC_I(int);
+
+typedef struct bp_location *bp_location_p;
+DEF_VEC_P(bp_location_p);
+
+/* A reference-counted struct command_line. This lets multiple
+ breakpoints share a single command list. This is an implementation
+ detail to the breakpoints module. */
+struct counted_command_line;
+
+/* Some targets (e.g., embedded PowerPC) need two debug registers to set
+ a watchpoint over a memory region. If this flag is true, GDB will use
+ only one register per watchpoint, thus assuming that all acesses that
+ modify a memory location happen at its starting address. */
+
+extern int target_exact_watchpoints;
+