/* Data structures associated with breakpoints in GDB.
- Copyright (C) 1992-2018 Free Software Foundation, Inc.
+ Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "frame.h"
#include "value.h"
-#include "vec.h"
+#include "gdbsupport/vec.h"
#include "ax.h"
#include "command.h"
-#include "break-common.h"
+#include "gdbsupport/break-common.h"
#include "probe.h"
#include "location.h"
#include <vector>
-#include "common/array-view.h"
+#include "gdbsupport/array-view.h"
#include "cli/cli-script.h"
struct block;
struct linespec_sals;
struct inferior;
+/* Enum for exception-handling support in 'catch throw', 'catch rethrow',
+ 'catch catch' and the MI equivalent. */
+
+enum exception_event_kind
+{
+ EX_EVENT_THROW,
+ EX_EVENT_RETHROW,
+ EX_EVENT_CATCH
+};
+
/* Why are we removing the breakpoint from the target? */
enum remove_bp_reason
bp_loc_other /* Miscellaneous... */
};
-/* This structure is a collection of function pointers that, if
- available, will be called instead of performing the default action
- for this bp_loc_type. */
-
-struct bp_location_ops
-{
- /* Destructor. Releases everything from SELF (but not SELF
- itself). */
- void (*dtor) (struct bp_location *self);
-};
-
class bp_location
{
public:
bp_location () = default;
- bp_location (const bp_location_ops *ops, breakpoint *owner);
+ bp_location (breakpoint *owner);
+
+ virtual ~bp_location ();
/* Chain pointer to the next breakpoint location for
the same parent breakpoint. */
bp_location *next = NULL;
- /* Methods associated with this location. */
- const bp_location_ops *ops = NULL;
-
/* The reference count. */
int refc = 0;
watch_triggered_yes
};
-typedef struct bp_location *bp_location_p;
-DEF_VEC_P(bp_location_p);
-
/* 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
int static_trace_marker_id_idx;
};
-typedef struct breakpoint *breakpoint_p;
-DEF_VEC_P(breakpoint_p);
\f
/* The following stuff is an abstract data type "bpstat" ("breakpoint
status"). This provides the ability to determine whether we have
extern int remove_breakpoints (void);
-extern int remove_breakpoints_inf (inferior *inf);
+/* Remove breakpoints of inferior INF. */
+
+extern void remove_breakpoints_inf (inferior *inf);
/* This function can be used to update the breakpoint package's state
after an exec() system call has been executed.
get_tracepoint_by_number (const char **arg,
number_or_range_parser *parser);
-/* Return a vector of all tracepoints currently defined. The vector
- is newly allocated; the caller should free when done with it. */
-extern VEC(breakpoint_p) *all_tracepoints (void);
+/* Return a vector of all tracepoints currently defined. */
+extern std::vector<breakpoint *> all_tracepoints (void);
extern int is_tracepoint (const struct breakpoint *b);
-/* Return a vector of all static tracepoints defined at ADDR. The
- vector is newly allocated; the caller should free when done with
- it. */
-extern VEC(breakpoint_p) *static_tracepoints_here (CORE_ADDR addr);
+/* Return a vector of all static tracepoints defined at ADDR. */
+extern std::vector<breakpoint *> static_tracepoints_here (CORE_ADDR addr);
/* Create an instance of this to start registering breakpoint numbers
for a later "commands" command. */
/* Print the specified breakpoint. */
extern void print_breakpoint (breakpoint *bp);
+/* Command element for the 'commands' command. */
+extern cmd_list_element *commands_cmd_element;
+
+/* Whether to use the fixed output when printing information about a
+ multi-location breakpoint (see PR 9659). */
+
+extern bool fix_multi_location_breakpoint_output_globally;
+
+/* Deal with "catch catch", "catch throw", and "catch rethrow" commands and
+ the MI equivalents. Sets up to catch events of type EX_EVENT. When
+ TEMPFLAG is true only the next matching event is caught after which the
+ catch-point is deleted. If REGEX is not NULL then only exceptions whose
+ type name matches REGEX will trigger the event. */
+
+extern void catch_exception_event (enum exception_event_kind ex_event,
+ const char *regex, bool tempflag,
+ int from_tty);
+
#endif /* !defined (BREAKPOINT_H) */