This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[obv] Code cleanup: main.c declarations
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 20 Feb 2012 20:45:36 +0100
- Subject: [obv] Code cleanup: main.c declarations
Hi,
"extern var" should not be in *.c files. "write_files" is already in
gdbcore.h included by main.c.
external_editor_command is insight-specific, so it is not so easy to fix it
that way but at least make it clearly [GDBTK] and localized.
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-02/msg00118.html
--- src/gdb/ChangeLog 2012/02/20 19:24:34 1.13846
+++ src/gdb/ChangeLog 2012/02/20 19:44:00 1.13847
@@ -1,3 +1,10 @@
+2012-02-20 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Code cleanup.
+ * main.c (write_files): Remove the declaration.
+ (external_editor_command): Move the declaration ...
+ [GDBTK] (external_editor_command): ... here. Fix the comment.
+
2012-02-20 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dw2_map_symtabs_matching_filename): Remove
--- src/gdb/main.c 2012/01/04 08:17:06 1.100
+++ src/gdb/main.c 2012/02/20 19:44:01 1.101
@@ -84,19 +84,12 @@
int return_child_result = 0;
int return_child_result_value = -1;
-/* Whether to enable writing into executable and core files. */
-extern int write_files;
/* GDB as it has been invoked from the command line (i.e. argv[0]). */
static char *gdb_program_name;
static void print_gdb_help (struct ui_file *);
-/* These two are used to set the external editor commands when gdb is
- farming out files to be edited by another program. */
-
-extern char *external_editor_command;
-
/* Relocate a file or directory. PROGNAME is the name by which gdb
was invoked (i.e., argv[0]). INITIAL is the default value for the
file or directory. FLAG is true if the value is relocatable, false
@@ -588,6 +581,10 @@
break;
case 'w':
{
+ /* Set the external editor commands when gdb is farming out files
+ to be edited by another program. */
+ extern char *external_editor_command;
+
external_editor_command = xstrdup (optarg);
break;
}