#include "frame.h"
#include "value.h"
+#include "gdb-events.h"
+
/* 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
arrays that should be independent of the target architecture. */
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,
+
/* These breakpoints are used to implement the "catch load" command
on platforms whose dynamic linkers support such functionality. */
bp_catch_load,
enum enable
{
- disabled, /* The eventpoint is inactive, and cannot trigger. */
- enabled, /* The eventpoint is active, and can trigger. */
- shlib_disabled, /* The eventpoint's address is within an unloaded solib.
- The eventpoint will be automatically enabled & reset
- when that solib is loaded. */
- 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
- & reset when the call "lands" (either completes, or
- stops at another eventpoint). */
+ disabled, /* The eventpoint is inactive, and cannot trigger. */
+ enabled, /* The eventpoint is active, and can trigger. */
+ shlib_disabled, /* The eventpoint's address is in an unloaded solib.
+ The eventpoint will be automatically enabled
+ and reset when that solib is loaded. */
+ 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). */
+ 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. */
};
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 */
+ };
+
/* 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
aborting, so you can back up to just before the abort. */
int hit_count;
- /* Filename of a dynamically-linked library (dll), used for bp_catch_load
- and bp_catch_unload (malloc'd), or NULL if any library is significant. */
+ /* Filename of a dynamically-linked library (dll), used for
+ bp_catch_load and bp_catch_unload (malloc'd), or NULL if any
+ library is significant. */
char *dll_pathname;
/* Filename of a dll whose state change (e.g., load or unload)
after this catchpoint has triggered. */
char *triggered_dll_pathname;
- /* Process id of a child process whose forking triggered this catchpoint.
- This field is only vaid immediately after this catchpoint has triggered. */
+ /* Process id of a child process whose forking triggered this
+ catchpoint. This field is only vaid immediately after this
+ catchpoint has triggered. */
int forked_inferior_pid;
- /* Filename of a program whose exec triggered this catchpoint. This
- field is only vaid immediately after this catchpoint has triggered. */
+ /* Filename of a program whose exec triggered this catchpoint.
+ This field is only vaid immediately after this catchpoint has
+ triggered. */
char *exec_pathname;
asection *section;
};
\f
-/* The following stuff is an abstract data type "bpstat" ("breakpoint status").
- This provides the ability to determine whether we have stopped at a
- breakpoint, and what we should do about it. */
+/* The following stuff is an abstract data type "bpstat" ("breakpoint
+ status"). This provides the ability to determine whether we have
+ stopped at a breakpoint, and what we should do about it. */
typedef struct bpstats *bpstat;
int call_dummy;
};
+/* The possible return values for print_bpstat, print_it_normal,
+ print_it_done, print_it_noop. */
+enum print_stop_action
+ {
+ PRINT_UNKNOWN = -1,
+ PRINT_SRC_AND_LOC,
+ PRINT_SRC_ONLY,
+ PRINT_NOTHING
+ };
+
/* Tell what to do about this bpstat. */
struct bpstat_what bpstat_what PARAMS ((bpstat));
\f
/* Print a message indicating what happened. Returns nonzero to
say that only the source line should be printed after this (zero
return means print the frame as well as the source line). */
-extern int bpstat_print PARAMS ((bpstat));
+extern enum print_stop_action bpstat_print PARAMS ((bpstat));
/* Return the breakpoint number of the first breakpoint we are stopped
at. *BSP upon return is a bpstat which points to the remaining
extern void bpstat_get_triggered_catchpoints PARAMS ((bpstat, bpstat *));
/* Implementation: */
+
+/* Values used to tell the printing routine how to behave for this bpstat. */
+enum bp_print_how
+ {
+ /* This is used when we want to do a normal printing of the reason
+ for stopping. The output will depend on the type of eventpoint
+ we are dealing with. This is the default value, most commonly
+ used. */
+ print_it_normal,
+ /* This is used when nothing should be printed for this bpstat entry. */
+ print_it_noop,
+ /* This is used when everything which needs to be printed has
+ already been printed. But we still want to print the frame. */
+ print_it_done
+ };
+
struct bpstats
{
- /* Linked list because there can be two breakpoints at the
- same place, and a bpstat reflects the fact that both have been hit. */
+ /* Linked list because there can be two breakpoints at the same
+ place, and a bpstat reflects the fact that both have been hit. */
bpstat next;
/* Breakpoint that we are at. */
struct breakpoint *breakpoint_at;
/* Nonzero if this breakpoint tells us to stop. */
char stop;
- /* Function called by bpstat_print to print stuff associated with
- this element of the bpstat chain. Returns 0 or 1 just like
- bpstat_print, or -1 if it can't deal with it. */
- int (*print_it) PARAMS ((bpstat bs));
+ /* Tell bpstat_print and print_bp_stop_message how to print stuff
+ associated with this element of the bpstat chain. */
+ enum bp_print_how print_it;
};
enum inf_context
inf_running,
inf_exited
};
+
+/* The possible return values for breakpoint_here_p.
+ We guarantee that zero always means "no breakpoint here". */
+enum breakpoint_here
+ {
+ no_breakpoint_here = 0,
+ ordinary_breakpoint_here,
+ permanent_breakpoint_here
+ };
\f
/* Prototypes for breakpoint-related functions. */
-#ifdef __STDC__ /* Forward declarations for prototypes */
+/* Forward declarations for prototypes */
struct frame_info;
-#endif
-extern int breakpoint_here_p PARAMS ((CORE_ADDR));
+extern enum breakpoint_here breakpoint_here_p PARAMS ((CORE_ADDR));
extern int breakpoint_inserted_here_p PARAMS ((CORE_ADDR));
extern void set_ignore_count PARAMS ((int, int, int));
-extern void set_default_breakpoint PARAMS ((int, CORE_ADDR, struct symtab *, int));
+extern void set_default_breakpoint PARAMS ((int, CORE_ADDR,
+ struct symtab *, int));
extern void mark_breakpoints_out PARAMS ((void));
extern void break_command PARAMS ((char *, int));
+extern void hbreak_command_wrapper PARAMS ((char *, int));
+extern void thbreak_command_wrapper PARAMS ((char *, int));
+extern void rbreak_command_wrapper PARAMS ((char *, int));
+extern void watch_command_wrapper PARAMS ((char *, int));
+extern void awatch_command_wrapper PARAMS ((char *, int));
+extern void rwatch_command_wrapper PARAMS ((char *, int));
extern void tbreak_command PARAMS ((char *, int));
extern int insert_breakpoints PARAMS ((void));
extern void clear_breakpoint_hit_counts PARAMS ((void));
+extern int get_number PARAMS ((char **));
+
+extern int get_number_or_range PARAMS ((char **));
+
/* The following are for displays, which aren't really breakpoints, but
here is as good a place as any for them. */
extern void enable_breakpoint PARAMS ((struct breakpoint *));
-extern void create_solib_event_breakpoint PARAMS ((CORE_ADDR));
+extern void make_breakpoint_permanent PARAMS ((struct breakpoint *));
+
+extern struct breakpoint *create_solib_event_breakpoint PARAMS ((CORE_ADDR));
+
+extern struct breakpoint *create_thread_event_breakpoint PARAMS ((CORE_ADDR));
extern void remove_solib_event_breakpoints PARAMS ((void));
+extern void remove_thread_event_breakpoints PARAMS ((void));
+
extern void disable_breakpoints_in_shlibs PARAMS ((int silent));
extern void re_enable_breakpoints_in_shlibs PARAMS ((void));
-extern void create_solib_load_event_breakpoint PARAMS ((char *, int, char *, char *));
+extern void create_solib_load_event_breakpoint PARAMS ((char *, int,
+ char *, char *));
-extern void create_solib_unload_event_breakpoint PARAMS ((char *, int, char *, char *));
+extern void create_solib_unload_event_breakpoint PARAMS ((char *, int,
+ char *, char *));
extern void create_fork_event_catchpoint PARAMS ((int, char *));
extern struct breakpoint *set_breakpoint_sal PARAMS ((struct symtab_and_line));
+/* Enable breakpoints and delete when hit. Called with ARG == NULL
+ deletes all breakpoints. */
+extern void delete_command (char *arg, int from_tty);
+
#endif /* !defined (BREAKPOINT_H) */