From patchwork Thu Sep 21 05:09:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 23003 Received: (qmail 76605 invoked by alias); 21 Sep 2017 05:13:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 36558 invoked by uid 89); 21 Sep 2017 05:10:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gproxy8-pub.mail.unifiedlayer.com Received: from gproxy8-pub.mail.unifiedlayer.com (HELO gproxy8-pub.mail.unifiedlayer.com) (67.222.33.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 05:10:37 +0000 Received: from cmgw4 (unknown [10.0.90.85]) by gproxy8.mail.unifiedlayer.com (Postfix) with ESMTP id 11BAE1AB3B7 for ; Wed, 20 Sep 2017 23:10:35 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id C5AY1w0172f2jeq015Abeq; Wed, 20 Sep 2017 23:10:35 -0600 X-Authority-Analysis: v=2.2 cv=OZLoNlbY c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=2JCJgTwv5E4A:10 a=zstS-IiYAAAA:8 a=6CMkEjcM0UQJIslPCgwA:9 a=sgL0KUZsP_mPqmeO:21 a=pH0mbaJHdHHnKuVr: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 1dutkt-00118R-SY; Wed, 20 Sep 2017 23:10:31 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 25/67] Constify some commands in symfile.c Date: Wed, 20 Sep 2017 23:09:41 -0600 Message-Id: <20170921051023.19023-26-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: 1dutkt-00118R-SY 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: 26 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes ChangeLog 2017-09-20 Tom Tromey * symfile.c (add_symbol_file_command) (remove_symbol_file_command, list_overlays_command) (map_overlay_command, unmap_overlay_command) (overlay_auto_command, overlay_manual_command) (overlay_off_command, overlay_load_command): Constify. --- gdb/ChangeLog | 8 ++++++++ gdb/symfile.c | 28 +++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/gdb/symfile.c b/gdb/symfile.c index 96b7d6f..c6e3b90 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -87,20 +87,10 @@ static void load_command (char *, int); static void symbol_file_add_main_1 (const char *args, symfile_add_flags add_flags, objfile_flags flags); -static void add_symbol_file_command (char *, int); - static const struct sym_fns *find_sym_fns (bfd *); static void overlay_invalidate_all (void); -static void overlay_auto_command (char *, int); - -static void overlay_manual_command (char *, int); - -static void overlay_off_command (char *, int); - -static void overlay_load_command (char *, int); - static void overlay_command (char *, int); static void simple_free_overlay_table (void); @@ -2198,7 +2188,7 @@ print_transfer_performance (struct ui_file *stream, value to use. We are now discontinuing this type of ad hoc syntax. */ static void -add_symbol_file_command (char *args, int from_tty) +add_symbol_file_command (const char *args, int from_tty) { struct gdbarch *gdbarch = get_current_arch (); gdb::unique_xmalloc_ptr filename; @@ -2333,7 +2323,7 @@ add_symbol_file_command (char *args, int from_tty) /* This function removes a symbol file that was added via add-symbol-file. */ static void -remove_symbol_file_command (char *args, int from_tty) +remove_symbol_file_command (const char *args, int from_tty) { struct objfile *objf = NULL; struct program_space *pspace = current_program_space; @@ -3233,7 +3223,7 @@ find_pc_mapped_section (CORE_ADDR pc) Print a list of mapped sections and their PC ranges. */ static void -list_overlays_command (char *args, int from_tty) +list_overlays_command (const char *args, int from_tty) { int nmapped = 0; struct objfile *objfile; @@ -3275,7 +3265,7 @@ list_overlays_command (char *args, int from_tty) Mark the named section as mapped (ie. residing at its VMA address). */ static void -map_overlay_command (char *args, int from_tty) +map_overlay_command (const char *args, int from_tty) { struct objfile *objfile, *objfile2; struct obj_section *sec, *sec2; @@ -3320,7 +3310,7 @@ map_overlay_command (char *args, int from_tty) (ie. resident in its LMA address range, rather than the VMA range). */ static void -unmap_overlay_command (char *args, int from_tty) +unmap_overlay_command (const char *args, int from_tty) { struct objfile *objfile; struct obj_section *sec = NULL; @@ -3350,7 +3340,7 @@ unmap_overlay_command (char *args, int from_tty) Possibly this should be done via a set/show command. */ static void -overlay_auto_command (char *args, int from_tty) +overlay_auto_command (const char *args, int from_tty) { overlay_debugging = ovly_auto; enable_overlay_breakpoints (); @@ -3363,7 +3353,7 @@ overlay_auto_command (char *args, int from_tty) Possibly this should be done via a set/show command. */ static void -overlay_manual_command (char *args, int from_tty) +overlay_manual_command (const char *args, int from_tty) { overlay_debugging = ovly_on; disable_overlay_breakpoints (); @@ -3376,7 +3366,7 @@ overlay_manual_command (char *args, int from_tty) Possibly this should be done via a set/show command. */ static void -overlay_off_command (char *args, int from_tty) +overlay_off_command (const char *args, int from_tty) { overlay_debugging = ovly_off; disable_overlay_breakpoints (); @@ -3385,7 +3375,7 @@ overlay_off_command (char *args, int from_tty) } static void -overlay_load_command (char *args, int from_tty) +overlay_load_command (const char *args, int from_tty) { struct gdbarch *gdbarch = get_current_arch ();