From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30115 invoked by alias); 23 Aug 2005 23:37:17 -0000 Mailing-List: contact rda-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rda-owner@sources.redhat.com Received: (qmail 30106 invoked by uid 22791); 23 Aug 2005 23:37:12 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 23 Aug 2005 23:37:12 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j7NNbB8q026726 for ; Tue, 23 Aug 2005 19:37:11 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j7NNbBV25421 for ; Tue, 23 Aug 2005 19:37:11 -0400 Received: from localhost.localdomain (vpn50-47.rdu.redhat.com [172.16.50.47]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j7NNbAZa022160 for ; Tue, 23 Aug 2005 19:37:11 -0400 Received: from ironwood.lan (ironwood.lan [192.168.64.8]) by localhost.localdomain (8.12.11/8.12.10) with ESMTP id j7NNb552001193 for ; Tue, 23 Aug 2005 16:37:05 -0700 Date: Tue, 23 Aug 2005 23:37:00 -0000 From: Kevin Buettner To: rda@sources.redhat.com Subject: [PATCH] Use "monitor" commands to enable / disable diagnostic messages for linux targets Message-ID: <20050823163704.4cce036c@ironwood.lan> Organization: Red Hat X-Mailer: Sylpheed-Claws 0.9.12cvs173.1 (GTK+ 2.4.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-q3/txt/msg00001.txt.bz2 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;