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

@ -9751,7 +9751,7 @@ remote_download_command_source (int num, ULONGEST addr,
}
static void
remote_download_tracepoint (struct breakpoint *t)
remote_download_tracepoint (struct breakpoint *b)
{
struct bp_location *loc;
CORE_ADDR tpaddr;
@ -9764,13 +9764,14 @@ remote_download_tracepoint (struct breakpoint *t)
struct agent_expr *aexpr;
struct cleanup *aexpr_chain = NULL;
char *pkt;
struct tracepoint *t = (struct tracepoint *) b;
/* Iterate over all the tracepoint locations. It's up to the target to
notice multiple tracepoint packets with the same number but different
addresses, and treat them as multiple locations. */
for (loc = t->loc; loc; loc = loc->next)
for (loc = b->loc; loc; loc = loc->next)
{
encode_actions (t, loc, &tdp_actions, &stepping_actions);
encode_actions (b, loc, &tdp_actions, &stepping_actions);
old_chain = make_cleanup (free_actions_list_cleanup_wrapper,
tdp_actions);
(void) make_cleanup (free_actions_list_cleanup_wrapper,
@ -9778,14 +9779,14 @@ remote_download_tracepoint (struct breakpoint *t)
tpaddr = loc->address;
sprintf_vma (addrbuf, tpaddr);
sprintf (buf, "QTDP:%x:%s:%c:%lx:%x", t->number,
sprintf (buf, "QTDP:%x:%s:%c:%lx:%x", b->number,
addrbuf, /* address */
(t->enable_state == bp_enabled ? 'E' : 'D'),
(b->enable_state == bp_enabled ? 'E' : 'D'),
t->step_count, t->pass_count);
/* Fast tracepoints are mostly handled by the target, but we can
tell the target how big of an instruction block should be moved
around. */
if (t->type == bp_fast_tracepoint)
if (b->type == bp_fast_tracepoint)
{
/* Only test for support at download time; we may not know
target capabilities at definition time. */
@ -9808,9 +9809,9 @@ remote_download_tracepoint (struct breakpoint *t)
tracepoints, so don't take lack of support as a reason to
give up on the trace run. */
warning (_("Target does not support fast tracepoints, "
"downloading %d as regular tracepoint"), t->number);
"downloading %d as regular tracepoint"), b->number);
}
else if (t->type == bp_static_tracepoint)
else if (b->type == bp_static_tracepoint)
{
/* Only test for support at download time; we may not know
target capabilities at definition time. */
@ -9848,10 +9849,10 @@ remote_download_tracepoint (struct breakpoint *t)
}
else
warning (_("Target does not support conditional tracepoints, "
"ignoring tp %d cond"), t->number);
"ignoring tp %d cond"), b->number);
}
if (t->commands || *default_collect)
if (b->commands || *default_collect)
strcat (buf, "-");
putpkt (buf);
remote_get_noisy_reply (&target_buf, &target_buf_size);
@ -9865,7 +9866,7 @@ remote_download_tracepoint (struct breakpoint *t)
{
QUIT; /* Allow user to bail out with ^C. */
sprintf (buf, "QTDP:-%x:%s:%s%c",
t->number, addrbuf, /* address */
b->number, addrbuf, /* address */
tdp_actions[ndx],
((tdp_actions[ndx + 1] || stepping_actions)
? '-' : 0));
@ -9882,7 +9883,7 @@ remote_download_tracepoint (struct breakpoint *t)
{
QUIT; /* Allow user to bail out with ^C. */
sprintf (buf, "QTDP:-%x:%s:%s%s%s",
t->number, addrbuf, /* address */
b->number, addrbuf, /* address */
((ndx == 0) ? "S" : ""),
stepping_actions[ndx],
(stepping_actions[ndx + 1] ? "-" : ""));
@ -9897,11 +9898,11 @@ remote_download_tracepoint (struct breakpoint *t)
if (remote_protocol_packets[PACKET_TracepointSource].support
== PACKET_ENABLE)
{
if (t->addr_string)
if (b->addr_string)
{
strcpy (buf, "QTDPsrc:");
encode_source_string (t->number, loc->address,
"at", t->addr_string, buf + strlen (buf),
encode_source_string (b->number, loc->address,
"at", b->addr_string, buf + strlen (buf),
2048 - strlen (buf));
putpkt (buf);
@ -9909,19 +9910,19 @@ remote_download_tracepoint (struct breakpoint *t)
if (strcmp (target_buf, "OK"))
warning (_("Target does not support source download."));
}
if (t->cond_string)
if (b->cond_string)
{
strcpy (buf, "QTDPsrc:");
encode_source_string (t->number, loc->address,
"cond", t->cond_string, buf + strlen (buf),
encode_source_string (b->number, loc->address,
"cond", b->cond_string, buf + strlen (buf),
2048 - strlen (buf));
putpkt (buf);
remote_get_noisy_reply (&target_buf, &target_buf_size);
if (strcmp (target_buf, "OK"))
warning (_("Target does not support source download."));
}
remote_download_command_source (t->number, loc->address,
breakpoint_commands (t));
remote_download_command_source (b->number, loc->address,
breakpoint_commands (b));
}
do_cleanups (old_chain);