[PATCH 3/6] Notify breakpoint-modified when tracepoints are downloaded.

Yao Qi
2012-12-04T04:45:38Z

When any location of a tracepoint is downloaded, notify
'breakpoint-modified' observer.

gdb:

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

* breakpoint.c (download_tracepoint_locations): Notify
'breakpoint-modified' observer if any tracepoint location is
downloaded.
* tracepoint.c (start_tracing): Likewise.
---
gdb/breakpoint.c | 4 ++++
gdb/tracepoint.c | 5 +++++
2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 3f2f0c9..56eeb35 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -12090,6 +12090,7 @@ download_tracepoint_locations (void)
{
struct bp_location *bl;
struct tracepoint *t;
+ int bp_location_downloaded = 0;

if ((b->type == bp_fast_tracepoint
? !may_insert_fast_tracepoints
@@ -12109,9 +12110,12 @@ download_tracepoint_locations (void)
target_download_tracepoint (bl);

bl->inserted = 1;
+ bp_location_downloaded = 1;
}
t = (struct tracepoint *) b;
t->number_on_target = b->number;
+ if (bp_location_downloaded)
+ observer_notify_breakpoint_modified (b);
}

do_cleanups (old_chain);
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 912341a..c467b9c 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -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);

--
1.7.7.6