This is the mail archive of the
mailing list for the GDB project.
[patch 3/5] Print a message on gdb disconnected.
- From: Yao Qi <yao at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 15 Nov 2011 15:46:52 +0800
- Subject: [patch 3/5] Print a message on gdb disconnected.
- References: <4EC20E2E.email@example.com>
This patch is to print a warning when gdb disconnects from remote stub,
while there are still pending tracepoints, because pending tracepoints
can't be resolved without gdb.
* tracepoint.c (process_tracepoint_on_disconnect): New.
(disconnect_tracing): Call process_tracepoint_on_disconnect.
gdb/tracepoint.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index e155515..c0b5231 100644
@@ -1642,6 +1642,32 @@ add_aexpr (struct collection_list *collect, struct agent_expr *aexpr)
+ 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 || b->loc->shlib_disabled)
+ has_pending_p = 1;
+ VEC_free (breakpoint_p, tp_vec);
+ if (has_pending_p)
+ warning (_("Pending tracepoint will not be resolved while"
+ " GBD is disconnected\n"));
@@ -2020,6 +2046,8 @@ disconnect_tracing (int from_tty)
if (current_trace_status ()->running && from_tty)
+ process_tracepoint_on_disconnect ();
if (current_trace_status ()->disconnected_tracing)
if (!query (_("Trace is running and will "