public inbox for rda@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Use "monitor" commands to enable / disable diagnostic messages for linux targets
@ 2005-08-23 23:37 Kevin Buettner
  0 siblings, 0 replies; only message in thread
From: Kevin Buettner @ 2005-08-23 23:37 UTC (permalink / raw)
  To: rda

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;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-23 23:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-23 23:37 [PATCH] Use "monitor" commands to enable / disable diagnostic messages for linux targets Kevin Buettner

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).