+ bp_watchpoint_scope,
+
+ /* The breakpoint at the end of a call dummy. */
+ /* FIXME: What if the function we are calling longjmp()s out of
+ the call, or the user gets out with the "return" command? We
+ currently have no way of cleaning up the breakpoint in these
+ (obscure) situations. (Probably can solve this by noticing
+ longjmp, "return", etc., it's similar to noticing when a
+ watchpoint on a local variable goes out of scope (with hardware
+ support for watchpoints)). */
+ bp_call_dummy,
+
+ /* A breakpoint set on std::terminate, that is used to catch
+ otherwise uncaught exceptions thrown during an inferior call. */
+ bp_std_terminate,
+
+ /* Some dynamic linkers (HP, maybe Solaris) can arrange for special
+ code in the inferior to run when significant events occur in the
+ dynamic linker (for example a library is loaded or unloaded).
+
+ By placing a breakpoint in this magic code GDB will get control
+ when these significant events occur. GDB can then re-examine
+ the dynamic linker's data structures to discover any newly loaded
+ dynamic libraries. */
+ bp_shlib_event,
+
+ /* Some multi-threaded systems can arrange for a location in the
+ inferior to be executed when certain thread-related events occur
+ (such as thread creation or thread death).
+
+ By placing a breakpoint at one of these locations, GDB will get
+ control when these events occur. GDB can then update its thread
+ lists etc. */
+
+ 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,
+
+ /* Master copies of longjmp breakpoints. These are always installed
+ as soon as an objfile containing longjmp is loaded, but they are
+ always disabled. While necessary, temporary clones of bp_longjmp
+ type will be created and enabled. */
+
+ bp_longjmp_master,
+
+ /* Master copies of std::terminate breakpoints. */
+ bp_std_terminate_master,
+
+ /* Like bp_longjmp_master, but for exceptions. */
+ bp_exception_master,
+
+ bp_catchpoint,
+
+ bp_tracepoint,
+ bp_fast_tracepoint,
+ bp_static_tracepoint,
+
+ /* Event for JIT compiled code generation or deletion. */
+ bp_jit_event,
+ };
+
+/* States of enablement of breakpoint. */
+
+enum enable_state
+ {
+ bp_disabled, /* The eventpoint is inactive, and cannot
+ trigger. */
+ bp_enabled, /* The eventpoint is active, and can
+ trigger. */
+ bp_call_disabled, /* The eventpoint has been disabled while a
+ call into the inferior is "in flight",
+ because some eventpoints interfere with
+ the implementation of a call on some
+ targets. The eventpoint will be
+ automatically enabled and reset when the
+ call "lands" (either completes, or stops
+ at another eventpoint). */
+ bp_startup_disabled, /* The eventpoint has been disabled during
+ inferior startup. This is necessary on
+ some targets where the main executable
+ will get relocated during startup, making
+ breakpoint addresses invalid. The
+ eventpoint will be automatically enabled
+ and reset once inferior startup is
+ complete. */
+ bp_permanent /* There is a breakpoint instruction
+ hard-wired into the target's code. Don't
+ try to write another breakpoint
+ instruction on top of it, or restore its
+ value. Step over it using the
+ architecture's SKIP_INSN macro. */
+ };
+
+
+/* Disposition of breakpoint. Ie: what to do after hitting it. */
+
+enum bpdisp
+ {
+ disp_del, /* Delete it */
+ disp_del_at_next_stop, /* Delete at next stop,
+ whether hit or not */
+ disp_disable, /* Disable it */
+ disp_donttouch /* Leave it alone */
+ };
+
+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;