2012-12-15 Yao Qi <yao@codesourcery.com>

* breakpoint.c (print_one_breakpoint_location): Display the
	state of 'installed' of each non-pending location of a tracepoint
	in both CLI and MI.
	(download_tracepoint_locations): Notify 'breakpoint-modified'
	observer if any tracepoint location is downloaded.
	* tracepoint.c (start_tracing): Likewise.
	(merge_uploaded_tracepoints): Record all modified
	tracepoints and notify 'breakpoint-modified' observer for them.

	* NEWS: Mention the change for CLI and MI.

gdb/doc:
2012-12-15  Yao Qi  <yao@codesourcery.com>

	* gdb.texinfo (Listing Tracepoints): New item and example about
	'installed on target' output.
	Add more in the example about 'installed on target'.
	(GDB/MI Breakpoint Commands): Doc about 'installed field.

gdb/testsuite:
2012-12-15  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/mi-tracepoint-changed.exp (test_pending_resolved): Check
	'installed' field in '=breakpoint-modified'.
	(test_reconnect): Check 'installed' field in
	'=breakpoint-modified' and '=breakpoint-created'.

	* gdb.trace/actions.exp: Update test for 'installed' field.
	* gdb.trace/change-loc.exp (tracepoint_change_loc_1):
	(tracepoint_change_loc_2): Likewise.
	Check 'info tracepoint' display nothing else.
	* gdb.trace/deltrace.exp: Likewise.
	* gdb.trace/infotrace.exp: Likewise.
	* gdb.trace/mi-traceframe-changed.exp (test_tfind_remote):
	Likewise.
	* gdb.trace/passcount.exp: Likewise.
	* gdb.trace/tracecmd.exp: Likewise.
	* gdb.trace/while-stepping.exp: Likewise.
This commit is contained in:
Yao Qi
2012-12-15 02:19:21 +00:00
parent 59965708ea
commit f2a8bc8a74
16 changed files with 221 additions and 44 deletions

View File

@ -1767,6 +1767,7 @@ start_tracing (char *notes)
{
struct tracepoint *t = (struct tracepoint *) b;
struct bp_location *loc;
int bp_location_downloaded = 0;
/* Clear `inserted' flag. */
for (loc = b->loc; loc; loc = loc->next)
@ -1788,6 +1789,7 @@ start_tracing (char *notes)
target_download_tracepoint (loc);
loc->inserted = 1;
bp_location_downloaded = 1;
}
t->number_on_target = b->number;
@ -1795,6 +1797,9 @@ start_tracing (char *notes)
for (loc = b->loc; loc; loc = loc->next)
if (loc->probe != NULL)
loc->probe->pops->set_semaphore (loc->probe, loc->gdbarch);
if (bp_location_downloaded)
observer_notify_breakpoint_modified (b);
}
VEC_free (breakpoint_p, tp_vec);
@ -3470,6 +3475,10 @@ void
merge_uploaded_tracepoints (struct uploaded_tp **uploaded_tps)
{
struct uploaded_tp *utp;
/* A set of tracepoints which are modified. */
VEC(breakpoint_p) *modified_tp = NULL;
int ix;
struct breakpoint *b;
/* Look for GDB tracepoints that match up with our uploaded versions. */
for (utp = *uploaded_tps; utp; utp = utp->next)
@ -3480,6 +3489,8 @@ merge_uploaded_tracepoints (struct uploaded_tp **uploaded_tps)
loc = find_matching_tracepoint_location (utp);
if (loc)
{
int found = 0;
/* Mark this location as already inserted. */
loc->inserted = 1;
t = (struct tracepoint *) loc->owner;
@ -3487,6 +3498,22 @@ merge_uploaded_tracepoints (struct uploaded_tp **uploaded_tps)
"as target's tracepoint %d at %s.\n"),
loc->owner->number, utp->number,
paddress (loc->gdbarch, utp->addr));
/* The tracepoint LOC->owner was modified (the location LOC
was marked as inserted in the target). Save it in
MODIFIED_TP if not there yet. The 'breakpoint-modified'
observers will be notified later once for each tracepoint
saved in MODIFIED_TP. */
for (ix = 0;
VEC_iterate (breakpoint_p, modified_tp, ix, b);
ix++)
if (b == loc->owner)
{
found = 1;
break;
}
if (!found)
VEC_safe_push (breakpoint_p, modified_tp, loc->owner);
}
else
{
@ -3509,6 +3536,12 @@ merge_uploaded_tracepoints (struct uploaded_tp **uploaded_tps)
t->number_on_target = utp->number;
}
/* Notify 'breakpoint-modified' observer that at least one of B's
locations was changed. */
for (ix = 0; VEC_iterate (breakpoint_p, modified_tp, ix, b); ix++)
observer_notify_breakpoint_modified (b);
VEC_free (breakpoint_p, modified_tp);
free_uploaded_tps (uploaded_tps);
}