From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64725 invoked by alias); 21 Sep 2017 05:41:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 64596 invoked by uid 89); 21 Sep 2017 05:41:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1915, agent X-HELO: gproxy9-pub.mail.unifiedlayer.com Received: from gproxy9-pub.mail.unifiedlayer.com (HELO gproxy9-pub.mail.unifiedlayer.com) (69.89.20.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 05:41:01 +0000 Received: from cmgw3 (unknown [10.0.90.84]) by gproxy9.mail.unifiedlayer.com (Postfix) with ESMTP id 688701E06AD for ; Wed, 20 Sep 2017 23:41:00 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id C5gx1w00U2f2jeq015h0YJ; Wed, 20 Sep 2017 23:41:00 -0600 X-Authority-Analysis: v=2.2 cv=K/VSJ2eI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=2JCJgTwv5E4A:10 a=zstS-IiYAAAA:8 a=0ekGapr6pX0CsB_BmEQA:9 a=F7vVWDhSf5WYcwte:21 a=h1Cuxx_mDFmfFw_Q:21 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 75-166-76-94.hlrn.qwest.net ([75.166.76.94]:36574 helo=bapiya.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dutkx-00118R-31; Wed, 20 Sep 2017 23:10:35 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 39/67] Constify some commands in ax-gdb.c Date: Thu, 21 Sep 2017 05:41:00 -0000 Message-Id: <20170921051023.19023-40-tom@tromey.com> In-Reply-To: <20170921051023.19023-1-tom@tromey.com> References: <20170921051023.19023-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1dutkx-00118R-31 X-Source-Sender: 75-166-76-94.hlrn.qwest.net (bapiya.Home) [75.166.76.94]:36574 X-Source-Auth: tom+tromey.com X-Email-Count: 59 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes X-SW-Source: 2017-09/txt/msg00590.txt.bz2 ChangeLog 2017-09-20 Tom Tromey * ax-gdb.c (maint_agent_printf_command, agent_command) (agent_eval_command): Constify. --- gdb/ChangeLog | 5 +++++ gdb/ax-gdb.c | 13 ++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index c4bf2a6..52ca081 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -158,8 +158,6 @@ static void gen_expr_binop_rest (struct expression *exp, struct axs_value *value, struct axs_value *value1, struct axs_value *value2); - -static void agent_command (char *exp, int from_tty); /* Detecting constant expressions. */ @@ -2661,7 +2659,7 @@ agent_command_1 (const char *exp, int eval) } static void -agent_command (char *exp, int from_tty) +agent_command (const char *exp, int from_tty) { agent_command_1 (exp, 0); } @@ -2671,7 +2669,7 @@ agent_command (char *exp, int from_tty) expression. */ static void -agent_eval_command (char *exp, int from_tty) +agent_eval_command (const char *exp, int from_tty) { agent_command_1 (exp, 1); } @@ -2680,12 +2678,11 @@ agent_eval_command (char *exp, int from_tty) that does a printf, and display the resulting expression. */ static void -maint_agent_printf_command (char *exp, int from_tty) +maint_agent_printf_command (const char *cmdrest, int from_tty) { struct cleanup *old_chain = 0; struct expression *argvec[100]; struct frame_info *fi = get_current_frame (); /* need current scope */ - const char *cmdrest; const char *format_start, *format_end; struct format_piece *fpieces; int nargs; @@ -2697,11 +2694,9 @@ maint_agent_printf_command (char *exp, int from_tty) if (overlay_debugging) error (_("GDB can't do agent expression translation with overlays.")); - if (exp == 0) + if (cmdrest == 0) error_no_arg (_("expression to translate")); - cmdrest = exp; - cmdrest = skip_spaces (cmdrest); if (*cmdrest++ != '"') -- 2.9.4