From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3073 invoked by alias); 6 Apr 2005 20:55:51 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2996 invoked from network); 6 Apr 2005 20:55:44 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 6 Apr 2005 20:55:44 -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 j36KtiBL031725 for ; Wed, 6 Apr 2005 16:55:44 -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 j36KtiO14945 for ; Wed, 6 Apr 2005 16:55:44 -0400 Received: from localhost.localdomain (vpn50-19.rdu.redhat.com [172.16.50.19]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j36Kthec023029 for ; Wed, 6 Apr 2005 16:55:43 -0400 Received: from ironwood.lan (ironwood.lan [192.168.64.8]) by localhost.localdomain (8.12.11/8.12.10) with ESMTP id j36KtcjB001720 for ; Wed, 6 Apr 2005 13:55:38 -0700 Date: Wed, 06 Apr 2005 20:55:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: [RFC] Eliminate deprecated_show_value_hack from remote.c Message-ID: <20050406135537.0ebe7edc@ironwood.lan> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-04/txt/msg00056.txt.bz2 The patch below eliminates all calls to deprecated_show_value_hack() from remote.c. I considered adding the fprint_filtered() statement which is now in the new show_remote_protocol_packet_cmd() to show_packet_config_cmd(), but I found one other call to this latter function which didn't also want/need the value printed. This is why I created a brand new function. Comments? * remote.c (show_remote_protocol_packet_cmd): New function. (show_remote_protocol_vcont_packet_cmd ) (show_remote_protocol_qSymbol_packet_cmd) (show_remote_protocol_P_packet_cmd) (show_remote_protocol_Z_software_bp_packet_cmd) (show_remote_protocol_Z_hardware_bp_packet_cmd) (show_remote_protocol_Z_write_wp_packet_cmd) (show_remote_protocol_Z_read_wp_packet_cmd) (show_remote_protocol_Z_access_wp_packet_cmd) (show_remote_protocol_binary_download_cmd) (show_remote_protocol_qPart_auxv_packet_cmd) (show_remote_protocol_p_packet_cmd ): Replace calls to deprecated_show_value_hack() and show_packet_config_cmd() with single call to show_remote_protocol_packet_cmd(). Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.179 diff -u -p -r1.179 remote.c --- remote.c 25 Mar 2005 20:39:45 -0000 1.179 +++ remote.c 6 Apr 2005 20:28:00 -0000 @@ -675,6 +675,18 @@ add_packet_config_cmd (struct packet_con } } +static void +show_remote_protocol_packet_cmd (struct ui_file *file, int from_tty, + struct cmd_list_element *c, + const char *value, + struct packet_config *config) +{ + fprintf_filtered (file, + _("Current use of remote protocol `%s' (%s) is %s.\n"), + config->name, config->title, value); + show_packet_config_cmd (config); +} + static enum packet_result packet_ok (const char *buf, struct packet_config *config) { @@ -754,8 +766,8 @@ show_remote_protocol_vcont_packet_cmd (s struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_vcont); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_vcont); } /* Should we try the 'qSymbol' (target symbol lookup service) request? */ @@ -773,8 +785,8 @@ show_remote_protocol_qSymbol_packet_cmd struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_qSymbol); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_qSymbol); } /* Should we try the 'P' (set register) request? */ @@ -793,8 +805,8 @@ show_remote_protocol_P_packet_cmd (struc struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_P); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_P); } /* Should we try one of the 'Z' requests? */ @@ -826,8 +838,8 @@ show_remote_protocol_Z_software_bp_packe struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_SOFTWARE_BP]); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_Z[Z_PACKET_SOFTWARE_BP]); } static void @@ -842,8 +854,8 @@ show_remote_protocol_Z_hardware_bp_packe struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_HARDWARE_BP]); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_Z[Z_PACKET_HARDWARE_BP]); } static void @@ -858,8 +870,8 @@ show_remote_protocol_Z_write_wp_packet_c struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_WRITE_WP]); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_Z[Z_PACKET_WRITE_WP]); } static void @@ -874,8 +886,8 @@ show_remote_protocol_Z_read_wp_packet_cm struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_READ_WP]); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_Z[Z_PACKET_READ_WP]); } static void @@ -890,8 +902,8 @@ show_remote_protocol_Z_access_wp_packet_ struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_Z[Z_PACKET_ACCESS_WP]); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_Z[Z_PACKET_ACCESS_WP]); } /* For compatibility with older distributions. Provide a ``set remote @@ -959,8 +971,8 @@ show_remote_protocol_binary_download_cmd struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_binary_download); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_binary_download); } /* Should we try the 'qPart:auxv' (target auxiliary vector read) request? */ @@ -978,8 +990,8 @@ show_remote_protocol_qPart_auxv_packet_c struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_qPart_auxv); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_qPart_auxv); } static struct packet_config remote_protocol_p; @@ -996,8 +1008,8 @@ show_remote_protocol_p_packet_cmd (struc struct cmd_list_element *c, const char *value) { - deprecated_show_value_hack (file, from_tty, c, value); - show_packet_config_cmd (&remote_protocol_p); + show_remote_protocol_packet_cmd (file, from_tty, c, value, + &remote_protocol_p); }