2011-07-25 Pedro Alves <pedro@codesourcery.com>

gdb/
	* breakpoint.h (print_recreate_thread): Declare.
	(struct breakpoint): Move step_count, pass_count,
	number_on_target, static_trace_marker_id,
	static_trace_marker_id_idx ...
	(struct tracepoint): ... to this new struct.
	(get_tracepoint, get_tracepoint_by_number_on_target)
	(get_tracepoint_by_number): Change return type to struct
	tracepoint pointer.
	* breakpoint.c (is_tracepoint_type): New, factored out from
	is_tracepoint.
	(is_tracepoint): Adjust.
	(print_one_breakpoint_location): Cast to struct tracepoint as
	necessary, and adjust.
	(print_recreate_catch_fork, print_recreate_catch_vfork)
	(print_recreate_catch_syscall, print_recreate_catch_exec): Call
	print_recreate_thread.
	(init_breakpoint_sal): New, factored out from
	create_breakpoint_sal.
	(create_breakpoint_sal): Reimplement.
	(create_breakpoint): Allocate a struct tracecepoint if the caller
	wanted a tracepoint.  Use init_breakpoint_sal and
	install_breakpoint.
	(print_recreate_ranged_breakpoint, print_recreate_watchpoint)
	(print_recreate_masked_watchpoint)
	(print_recreate_exception_catchpoint): Call print_recreate_thread.
	(tracepoint_print_one_detail): Adjust.
	(tracepoint_print_recreate): Adjust.  Call print_recreate_thread.
	Dump the pass count here.
	(update_static_tracepoint): Adjust.
	(addr_string_to_sals): Adjust.
	(create_tracepoint_from_upload): Adjust.  Change return type to
	struct tracepoint pointer.
	(trace_pass_set_count): Change parameter type to struct tracepoint
	pointer, and adjust.
	(trace_pass_command): Adjust.
	(get_tracepoint, get_tracepoint_by_number_on_target)
	(get_tracepoint_by_number): Change return type to struct
	tracepoint pointer, and adjust.
	(print_recreate_thread): New, factored out from save_breakpoints.
	(save_breakpoints): Don't print thread and task and passcount
	recreation here.
	* remote.c (remote_download_tracepoint): Adjust.
	* tracepoint.c (trace_actions_command, validate_actionline)
	(start_tracing, tfind_1, trace_find_tracepoint_command)
	(trace_dump_command): Adjust.
	(find_matching_tracepoint): Change return type to struct
	tracepoint pointer, and adjust.
	(merge_uploaded_tracepoints, tfile_get_traceframe_address)
	(tfile_trace_find, tfile_fetch_registers): Adjust.
	* tracepoint.h (create_tracepoint_from_upload): Change return type
	to struct tracepoint pointer.
	* ada-lang.c (print_recreate_exception): Call
	print_recreate_thread.
	* mi/mi-cmd-break.c (mi_cmd_break_passcount): Adjust.
This commit is contained in:
Pedro Alves
2011-07-25 11:24:44 +00:00
parent 3a5c3e2258
commit d9b3f62eb2
8 changed files with 330 additions and 184 deletions

View File

@ -482,6 +482,15 @@ struct breakpoint_ops
void (*print_recreate) (struct breakpoint *, struct ui_file *fp);
};
/* Helper for breakpoint_ops->print_recreate implementations. Prints
the "thread" or "task" condition of B, and then a newline.
Necessary because most breakpoint implementations accept
thread/task conditions at the end of the spec line, like "break foo
thread 1", which needs outputting before any breakpoint-type
specific extra command necessary for B's recreation. */
extern void print_recreate_thread (struct breakpoint *b, struct ui_file *fp);
enum watchpoint_triggered
{
/* This watchpoint definitely did not trigger. */
@ -610,29 +619,6 @@ struct breakpoint
the condition in. */
int condition_not_parsed;
/* Number of times this tracepoint should single-step
and collect additional data. */
long step_count;
/* Number of times this tracepoint should be hit before
disabling/ending. */
int pass_count;
/* The number of the tracepoint on the target. */
int number_on_target;
/* The static tracepoint marker id, if known. */
char *static_trace_marker_id;
/* LTTng/UST allow more than one marker with the same ID string,
although it unadvised because it confuses tools. When setting
static tracepoints by marker ID, this will record the index in
the array of markers we found for the given marker ID for which
this static tracepoint corresponds. When resetting
breakpoints, we will use this index to try to find the same
marker again. */
int static_trace_marker_id_idx;
/* With a Python scripting enabled GDB, store a reference to the
Python object that has been associated with this breakpoint.
This is always NULL for a GDB that is not script enabled. It
@ -700,6 +686,38 @@ struct watchpoint
extern int is_watchpoint (const struct breakpoint *bpt);
/* An instance of this type is used to represent all kinds of
tracepoints. It includes a "struct breakpoint" as a kind of base
class; users downcast to "struct breakpoint *" when needed. */
struct tracepoint
{
/* The base class. */
struct breakpoint base;
/* Number of times this tracepoint should single-step and collect
additional data. */
long step_count;
/* Number of times this tracepoint should be hit before
disabling/ending. */
int pass_count;
/* The number of the tracepoint on the target. */
int number_on_target;
/* The static tracepoint marker id, if known. */
char *static_trace_marker_id;
/* LTTng/UST allow more than one marker with the same ID string,
although it unadvised because it confuses tools. When setting
static tracepoints by marker ID, this will record the index in
the array of markers we found for the given marker ID for which
this static tracepoint corresponds. When resetting breakpoints,
we will use this index to try to find the same marker again. */
int static_trace_marker_id_idx;
};
typedef struct breakpoint *breakpoint_p;
DEF_VEC_P(breakpoint_p);
@ -1301,12 +1319,12 @@ extern int catch_syscall_enabled (void);
extern int catching_syscall_number (int syscall_number);
/* Return a tracepoint with the given number if found. */
extern struct breakpoint *get_tracepoint (int num);
extern struct tracepoint *get_tracepoint (int num);
extern struct breakpoint *get_tracepoint_by_number_on_target (int num);
extern struct tracepoint *get_tracepoint_by_number_on_target (int num);
/* Find a tracepoint by parsing a number in the supplied string. */
extern struct breakpoint *
extern struct tracepoint *
get_tracepoint_by_number (char **arg,
struct get_number_or_range_state *state,
int optional_p);