public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: rda@sources.redhat.com
Subject: [PATCH] Use "monitor" commands to enable / disable diagnostic messages for linux targets
Date: Tue, 23 Aug 2005 23:37:00 -0000	[thread overview]
Message-ID: <20050823163704.4cce036c@ironwood.lan> (raw)

I've just committed the patch below.

Note that you used to be able to do "monitor 1" (or "monitor 0") to
enable (or disable) the "backend" messages, but RDA would send back an
empty RDA packet which indicated that the command failed.  The command
didn't really fail, but the GDB user would think that it did.  RDA now
(for Linux targets only) sends back non-empty informational packets
for each recognized command and a help message if it can't make sense
of the command.

The diagnostic messages are printed to stderr.  These diagnostics are
really only useful to developers wishing to debug RDA.  See the help
message near the bottom of the patch for the precise list of commands
for enabling / disabling these diagnostics.

	* gdbserv-thread-db.h (proc_service_noisy): Declare.
	* linux-target.c (linux_process_rcmd): Add "monitor" commands
	for enabling and disabling various types of diagnostic messages.
	Delete old "monitor 1" and "monitor 0" commands for enabling /
	disabling just the back-end diagnostics.
	(decr_pc_after_break): Delete extern declaration for
	``thread_db_noisy''.

Index: gdbserv-thread-db.h
===================================================================
RCS file: /cvs/src/src/rda/unix/gdbserv-thread-db.h,v
retrieving revision 1.4
diff -u -p -r1.4 gdbserv-thread-db.h
--- gdbserv-thread-db.h	30 Jun 2005 03:24:18 -0000	1.4
+++ gdbserv-thread-db.h	23 Aug 2005 23:15:52 -0000
@@ -35,6 +35,7 @@ typedef void *                 gdb_ps_wr
 typedef size_t                 gdb_ps_size_t;
 
 extern int thread_db_noisy;
+extern int proc_service_noisy;
 
 /* Determine if register is a member of GREGSET_T.  */
 extern int is_gp_reg (int regnum);
Index: linux-target.c
===================================================================
RCS file: /cvs/src/src/rda/unix/linux-target.c,v
retrieving revision 1.17
diff -u -p -r1.17 linux-target.c
--- linux-target.c	30 Jun 2005 03:24:18 -0000	1.17
+++ linux-target.c	23 Aug 2005 23:15:52 -0000
@@ -2851,14 +2851,46 @@ linux_process_rcmd (struct gdbserv *serv
 {
   struct child_process *process = gdbserv_target_data (serv);
 
-  if (!strcmp (cmd, "1"))
+  if (strcmp (cmd, "rda-backend-noisy") == 0)
     {
       process->debug_backend = 1;
+      gdbserv_output_string_as_bytes (serv, "RDA backend diagnostics enabled.\n");
     }
-  else if (!strcmp (cmd, "0"))
+  else if (strcmp (cmd, "rda-backend-quiet") == 0)
     {
       process->debug_backend = 0;
+      gdbserv_output_string_as_bytes (serv, "RDA backend diagnostics disabled.\n");
     }
+  else if (strcmp (cmd, "thread-db-noisy") == 0)
+    {
+      thread_db_noisy = 1;
+      gdbserv_output_string_as_bytes (serv, "RDA thread-db diagnostics enabled.\n");
+    }
+  else if (strcmp (cmd, "thread-db-quiet") == 0)
+    {
+      thread_db_noisy = 0;
+      gdbserv_output_string_as_bytes (serv, "RDA thread-db diagnostics disabled.\n");
+    }
+  else if (strcmp (cmd, "proc-service-noisy") == 0)
+    {
+      proc_service_noisy = 1;
+      gdbserv_output_string_as_bytes (serv, "RDA proc-service diagnostics enabled.\n");
+    }
+  else if (strcmp (cmd, "proc-service-quiet") == 0)
+    {
+      proc_service_noisy = 0;
+      gdbserv_output_string_as_bytes (serv, "RDA proc-service diagnostics disabled.\n");
+    }
+  else
+    gdbserv_output_string_as_bytes (serv,
+      "Unrecognized monitor command.\n"
+      "Available commands are:\n"
+      "  monitor rda-backend-noisy\n"
+      "  monitor rda-backend-quiet\n"
+      "  monitor thread-db-noisy\n"
+      "  monitor thread-db-quiet\n"
+      "  monitor proc-service-noisy\n"
+      "  monitor proc-service-quiet\n");
 }
 
 /* This function is called from gdbloop_poll when a new incoming
@@ -3037,7 +3069,6 @@ struct server_vector gdbserver = 
 int
 decr_pc_after_break (struct gdbserv *serv, pid_t pid)
 {
-  extern int thread_db_noisy;
   unsigned long pc;
   int status;
 

                 reply	other threads:[~2005-08-23 23:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050823163704.4cce036c@ironwood.lan \
    --to=kevinb@redhat.com \
    --cc=rda@sources.redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).