From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28854 invoked by alias); 6 Apr 2010 19:48:57 -0000 Received: (qmail 28841 invoked by uid 22791); 6 Apr 2010 19:48:55 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Apr 2010 19:48:51 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id o36JmlNt011624 for ; Tue, 6 Apr 2010 21:48:47 +0200 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by wpaz13.hot.corp.google.com with ESMTP id o36Jmkf5016770 for ; Tue, 6 Apr 2010 12:48:46 -0700 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id F12F784397; Tue, 6 Apr 2010 12:48:45 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [patch] Make source_file_name const char *. Message-Id: <20100406194845.F12F784397@ruffy.mtv.corp.google.com> Date: Tue, 06 Apr 2010 19:48:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2010-04/txt/msg00106.txt.bz2 Hi. I will check this patch in in a few days if there are no objections. It just adds const to source_file_name. [fyi, I have some other pending patches that use const char *'s for file names that depend on this one. This one is standalone so I've separated it out.] 2010-04-06 Doug Evans * top.c (source_file_name): Make const char *. * top.h (source_file_name): Update. * cli/cli-script.c (source_cleanup_lines_args): Make old_file const char *. (script_from_file): Change FILE arg to const char *. * cli/cli-script.h (script_from_file): Update. Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.177 diff -u -p -r1.177 top.c --- top.c 19 Jan 2010 22:23:53 -0000 1.177 +++ top.c 6 Apr 2010 19:43:40 -0000 @@ -298,7 +298,7 @@ quit_cover (void *s) /* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c */ -/* static */ char *source_file_name; +/* static */ const char *source_file_name; /* Clean up on error during a "source" command (or execution of a user-defined command). */ Index: top.h =================================================================== RCS file: /cvs/src/src/gdb/top.h,v retrieving revision 1.21 diff -u -p -r1.21 top.h --- top.h 6 Apr 2010 16:51:18 -0000 1.21 +++ top.h 6 Apr 2010 19:43:40 -0000 @@ -68,7 +68,7 @@ extern void gdb_init (char *); /* For use by event-top.c */ /* Variables from top.c. */ extern int source_line_number; -extern char *source_file_name; +extern const char *source_file_name; extern int history_expansion_p; extern int server_command; extern char *lim_at_start; Index: cli/cli-script.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-script.c,v retrieving revision 1.60 diff -u -p -r1.60 cli-script.c --- cli/cli-script.c 28 Mar 2010 18:00:56 -0000 1.60 +++ cli/cli-script.c 6 Apr 2010 19:43:40 -0000 @@ -1557,7 +1557,7 @@ document_command (char *comname, int fro struct source_cleanup_lines_args { int old_line; - char *old_file; + const char *old_file; }; static void @@ -1584,7 +1584,7 @@ wrapped_read_command_file (struct ui_out /* Used to implement source_command */ void -script_from_file (FILE *stream, char *file) +script_from_file (FILE *stream, const char *file) { struct cleanup *old_cleanups; struct source_cleanup_lines_args old_lines; Index: cli/cli-script.h =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-script.h,v retrieving revision 1.15 diff -u -p -r1.15 cli-script.h --- cli/cli-script.h 1 Jan 2010 07:31:47 -0000 1.15 +++ cli/cli-script.h 6 Apr 2010 19:43:40 -0000 @@ -24,7 +24,7 @@ struct cmd_list_element; /* Exported to cli/cli-cmds.c */ -extern void script_from_file (FILE *stream, char *file); +extern void script_from_file (FILE *stream, const char *file); extern void document_command (char *, int);