Move some declarations to source.h
authorTom Tromey <tom@tromey.com>
Fri, 10 Nov 2017 20:21:10 +0000 (13:21 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 14 Feb 2018 15:09:52 +0000 (08:09 -0700)
I noticed a few declarations in defs.h that really could be put into
source.h.  I think it's generally preferable to something out of
defs.h unless it is needed by most of the files in gdb.

gdb/ChangeLog
2018-02-14  Tom Tromey  <tom@tromey.com>

* solib.c: Include source.h.
* nto-tdep.c: Include source.h.
* mi/mi-cmd-env.c: Include source.h.
* infcmd.c: Include source.h.
* exec.c: Include source.h.
* defs.h (enum openp_flag, openp, source_full_path_of, mod_path)
(add_path, directory_switch, source_path, init_source_path): Move
declarations...
* source.h (enum openp_flag, openp, source_full_path_of, mod_path)
(add_path, directory_switch, source_path, init_source_path):
...here.

gdb/ChangeLog
gdb/defs.h
gdb/exec.c
gdb/infcmd.c
gdb/mi/mi-cmd-env.c
gdb/nto-tdep.c
gdb/solib.c
gdb/source.h

index 697ec49523b374cc1b859fd7a741acd42a56312f..cfab252a7d10d3d03a3c59091c9d70813a811eaa 100644 (file)
@@ -1,3 +1,17 @@
+2018-02-14  Tom Tromey  <tom@tromey.com>
+
+       * solib.c: Include source.h.
+       * nto-tdep.c: Include source.h.
+       * mi/mi-cmd-env.c: Include source.h.
+       * infcmd.c: Include source.h.
+       * exec.c: Include source.h.
+       * defs.h (enum openp_flag, openp, source_full_path_of, mod_path)
+       (add_path, directory_switch, source_path, init_source_path): Move
+       declarations...
+       * source.h (enum openp_flag, openp, source_full_path_of, mod_path)
+       (add_path, directory_switch, source_path, init_source_path):
+       ...here.
+
 2018-02-14  Tom Tromey  <tom@tromey.com>
 
        * solist.h (exec_file_find, solib_find): Return
index 70389ad74525683a66f48d1ed69f0763037529dc..c85bf2cf112e71b6e5867098adbf577b6b647fa9 100644 (file)
@@ -339,33 +339,6 @@ extern int build_address_symbolic (struct gdbarch *,
 extern void print_address (struct gdbarch *, CORE_ADDR, struct ui_file *);
 extern const char *pc_prefix (CORE_ADDR);
 
-/* From source.c */
-
-/* See openp function definition for their description.  */
-
-enum openp_flag
-{
-  OPF_TRY_CWD_FIRST = 0x01,
-  OPF_SEARCH_IN_PATH = 0x02,
-  OPF_RETURN_REALPATH = 0x04,
-};
-
-DEF_ENUM_FLAGS_TYPE(openp_flag, openp_flags);
-
-extern int openp (const char *, openp_flags, const char *, int, char **);
-
-extern int source_full_path_of (const char *, char **);
-
-extern void mod_path (const char *, char **);
-
-extern void add_path (const char *, char **, int);
-
-extern void directory_switch (const char *, int);
-
-extern char *source_path;
-
-extern void init_source_path (void);
-
 /* From exec.c */
 
 /* * Process memory area starting at ADDR with length SIZE.  Area is
index 15f85a278ff4d7679153a4d2d19cb5fd12ec1004..79baf9c5fbbcdd4fc8b8b13c1e7e0fcb1772ca6c 100644 (file)
@@ -35,6 +35,7 @@
 #include "progspace.h"
 #include "gdb_bfd.h"
 #include "gcore.h"
+#include "source.h"
 
 #include <fcntl.h>
 #include "readline/readline.h"
index 3879df3f5a0d3e0d1a26bca969ac76c85e0537ff..331fd8751b16a16d7b78b7e912eb25d3d3c1d69d 100644 (file)
@@ -59,6 +59,7 @@
 #include "top.h"
 #include "interps.h"
 #include "common/gdb_optional.h"
+#include "source.h"
 
 /* Local functions: */
 
index e7c41dd7bd44cdaafec7c17ccd87db2706e9adb0..2f5b803d5bdebd2403630515e1b488ed64a00103 100644 (file)
@@ -31,6 +31,7 @@
 #include "ui-out.h"
 #include "top.h"
 #include <sys/stat.h>
+#include "source.h"
 
 static const char path_var_name[] = "PATH";
 static char *orig_path = NULL;
index 03b2d1e96d7c84573b96c228b6a8b5552fc9b2f8..30db99c759d37e2a2765a33b4981016015929946 100644 (file)
@@ -31,6 +31,7 @@
 #include "solib-svr4.h"
 #include "gdbcore.h"
 #include "objfiles.h"
+#include "source.h"
 
 #define QNX_NOTE_NAME  "QNX"
 #define QNX_INFO_SECT_NAME "QNX_info"
index b8f726bc10d0518e6cdbb2d2a7ccb194d606e1f8..67a490e8d737261f8708ffb1fb19a5fe434bec0a 100644 (file)
@@ -46,6 +46,7 @@
 #include "filesystem.h"
 #include "gdb_bfd.h"
 #include "filestuff.h"
+#include "source.h"
 
 /* Architecture-specific operations.  */
 
index 77fd4cdaba492b5ed60d86a5470455c946137c03..a21e919b28bd0c7aaf3fbfe98a656560437378af 100644 (file)
 
 struct symtab;
 
+/* See openp function definition for their description.  */
+
+enum openp_flag
+{
+  OPF_TRY_CWD_FIRST = 0x01,
+  OPF_SEARCH_IN_PATH = 0x02,
+  OPF_RETURN_REALPATH = 0x04,
+};
+
+DEF_ENUM_FLAGS_TYPE(openp_flag, openp_flags);
+
+extern int openp (const char *, openp_flags, const char *, int, char **);
+
+extern int source_full_path_of (const char *, char **);
+
+extern void mod_path (const char *, char **);
+
+extern void add_path (const char *, char **, int);
+
+extern void directory_switch (const char *, int);
+
+extern char *source_path;
+
+extern void init_source_path (void);
+
 /* This function is capable of finding the absolute path to a
    source file, and opening it, provided you give it a FILENAME.  Both the
    DIRNAME and FULLNAME are only added suggestions on where to find the file.
This page took 0.033154 seconds and 4 git commands to generate.