aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2011-11-18 01:21:35 +0000
committerYao Qi <yao@codesourcery.com>2011-11-18 01:21:35 +0000
commitbfccc43c1218b6d89bb021381276ac742e7a9a9e (patch)
tree4cb5a36039810f966bf54f316a3123ade3e3d952 /gdb/tracepoint.c
parent3ea46bff735f66cca658e990155816c57cc194d3 (diff)
downloadgdb-bfccc43c1218b6d89bb021381276ac742e7a9a9e.zip
gdb-bfccc43c1218b6d89bb021381276ac742e7a9a9e.tar.gz
gdb-bfccc43c1218b6d89bb021381276ac742e7a9a9e.tar.bz2
gdb/
* breakpoint.c (create_breakpoint): Produce query message according to breakpoint's type. Allocate tracepoint per correct type. Don't check SALs for pending fast tracepoints. * tracepoint.c (process_tracepoint_on_disconnect): New. (disconnect_tracing): Call process_tracepoint_on_disconnect. gdb/doc/ * gdb.texinfo (Create and Delete Tracepoints): Mention pending tracepoint. gdb/testsuite/ * gdb.trace/pending.exp: New. * gdb.trace/pending.c: New. * gdb.trace/pendshr1.c: New. * gdb.trace/pendshr2.c: New. * gdb.trace/change-loc.exp (tracepoint_change_loc_1): Check one tracepoint location becomes pending. (tracepoint_change_loc_2): New.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index e155515..97ab633 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1642,6 +1642,48 @@ add_aexpr (struct collection_list *collect, struct agent_expr *aexpr)
collect->next_aexpr_elt++;
}
+static void
+process_tracepoint_on_disconnect (void)
+{
+ VEC(breakpoint_p) *tp_vec = NULL;
+ int ix;
+ struct breakpoint *b;
+ int has_pending_p = 0;
+
+ /* Check whether we still have pending tracepoint. If we have, warn the
+ user that pending tracepoint will no longer work. */
+ tp_vec = all_tracepoints ();
+ for (ix = 0; VEC_iterate (breakpoint_p, tp_vec, ix, b); ix++)
+ {
+ if (b->loc == NULL)
+ {
+ has_pending_p = 1;
+ break;
+ }
+ else
+ {
+ struct bp_location *loc1;
+
+ for (loc1 = b->loc; loc1; loc1 = loc1->next)
+ {
+ if (loc1->shlib_disabled)
+ {
+ has_pending_p = 1;
+ break;
+ }
+ }
+
+ if (has_pending_p)
+ break;
+ }
+ }
+ VEC_free (breakpoint_p, tp_vec);
+
+ if (has_pending_p)
+ warning (_("Pending tracepoints will not be resolved while"
+ " GDB is disconnected\n"));
+}
+
void
start_tracing (void)
@@ -2020,6 +2062,8 @@ disconnect_tracing (int from_tty)
disconnected-tracing. */
if (current_trace_status ()->running && from_tty)
{
+ process_tracepoint_on_disconnect ();
+
if (current_trace_status ()->disconnected_tracing)
{
if (!query (_("Trace is running and will "