aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-11-10 13:21:10 -0700
committerTom Tromey <tom@tromey.com>2018-02-14 08:09:52 -0700
commitb46a8d7c1d50c06e641af99b58301db0499111b9 (patch)
tree2f7d8519a9693067f9fd42ce6c0a978783def518
parent797bc1cb25b9dbdbc663cf711aecb0acc2450276 (diff)
downloadfsf-binutils-gdb-b46a8d7c1d50c06e641af99b58301db0499111b9.zip
fsf-binutils-gdb-b46a8d7c1d50c06e641af99b58301db0499111b9.tar.gz
fsf-binutils-gdb-b46a8d7c1d50c06e641af99b58301db0499111b9.tar.bz2
Move some declarations to source.h
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.
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/defs.h27
-rw-r--r--gdb/exec.c1
-rw-r--r--gdb/infcmd.c1
-rw-r--r--gdb/mi/mi-cmd-env.c1
-rw-r--r--gdb/nto-tdep.c1
-rw-r--r--gdb/solib.c1
-rw-r--r--gdb/source.h25
8 files changed, 44 insertions, 27 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 697ec49..cfab252 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,19 @@
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
unique_xmalloc_ptr.
(solib_bfd_fopen): Take a const char *.
diff --git a/gdb/defs.h b/gdb/defs.h
index 70389ad..c85bf2c 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -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
diff --git a/gdb/exec.c b/gdb/exec.c
index 15f85a2..79baf9c 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -35,6 +35,7 @@
#include "progspace.h"
#include "gdb_bfd.h"
#include "gcore.h"
+#include "source.h"
#include <fcntl.h>
#include "readline/readline.h"
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 3879df3..331fd87 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -59,6 +59,7 @@
#include "top.h"
#include "interps.h"
#include "common/gdb_optional.h"
+#include "source.h"
/* Local functions: */
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index e7c41dd..2f5b803 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -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;
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 03b2d1e..30db99c 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -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"
diff --git a/gdb/solib.c b/gdb/solib.c
index b8f726b..67a490e 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -46,6 +46,7 @@
#include "filesystem.h"
#include "gdb_bfd.h"
#include "filestuff.h"
+#include "source.h"
/* Architecture-specific operations. */
diff --git a/gdb/source.h b/gdb/source.h
index 77fd4cd..a21e919 100644
--- a/gdb/source.h
+++ b/gdb/source.h
@@ -21,6 +21,31 @@
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.