Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [patch 3/5] Print a message on gdb disconnected.
Date: Tue, 15 Nov 2011 07:47:00 -0000	[thread overview]
Message-ID: <4EC218EC.9090105@codesourcery.com> (raw)
In-Reply-To: <4EC20E2E.6010402@codesourcery.com>

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

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.

-- 
Yao (齐尧)

[-- Attachment #2: 0003-pending-tracepoint-on-disconnect.patch --]
[-- Type: text/x-patch, Size: 1508 bytes --]


        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
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1642,6 +1642,32 @@ 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 || b->loc->shlib_disabled)
+	{
+	  has_pending_p = 1;
+	  break;
+	}
+    }
+  VEC_free (breakpoint_p, tp_vec);
+
+  if (has_pending_p)
+    warning (_("Pending tracepoint will not be resolved while"
+	       " GBD is disconnected\n"));
+}
+
 
 void
 start_tracing (void)
@@ -2020,6 +2046,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 "
-- 
1.7.0.4


  parent reply	other threads:[~2011-11-15  7:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15  7:01 [patch 0/5] pending tracepoint Yao Qi
2011-11-15  7:30 ` [patch 1/5] Call update_global_location_list conditionally in install_breakpoint Yao Qi
2011-11-16 19:04   ` Pedro Alves
2011-11-15  7:43 ` [patch 2/5] allow pending tracepoint Yao Qi
2011-11-16 19:04   ` Pedro Alves
2011-11-17  1:12     ` Yao Qi
2011-11-15  7:47 ` Yao Qi [this message]
2011-11-15 15:32   ` [patch 3/5] Print a message on gdb disconnected Tom Tromey
2011-11-16  3:17     ` Yao Qi
2011-11-16 19:04   ` Pedro Alves
2011-11-17  3:32     ` Yao Qi
2011-11-17 11:08       ` Pedro Alves
2011-11-15  8:03 ` [patch 4/5] Test cases Yao Qi
2011-11-16 19:05   ` Pedro Alves
2011-11-17  3:27     ` Yao Qi
2011-11-17 12:08       ` Pedro Alves
2011-11-17 14:09         ` Yao Qi
2011-11-17 14:54           ` Pedro Alves
2011-11-15  8:08 ` [patch 5/5] Document Yao Qi
2011-11-15 14:29   ` Luis Machado
2011-11-15 14:57     ` Yao Qi
2011-11-15 15:04       ` Luis Machado
2011-11-15 17:02         ` Eli Zaretskii
2011-11-15 17:06   ` Eli Zaretskii
2011-11-16  3:13     ` Yao Qi
2011-11-16  4:01       ` Eli Zaretskii
2011-11-16 19:04       ` Pedro Alves
2011-11-17  3:25         ` Yao Qi
2011-11-17 12:28           ` Pedro Alves
2011-11-17 14:31             ` Yao Qi
2011-11-17 14:41               ` Pedro Alves
2011-11-17 15:17                 ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EC218EC.9090105@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox