aboutsummaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorChristian Biesinger <cbiesinger@google.com>2019-09-09 12:55:39 -0500
committerChristian Biesinger <cbiesinger@google.com>2019-09-11 16:31:36 -0500
commitf2aec7f6d149c8a534e8246b0d3a50038864fa2d (patch)
tree66de5d6e1111cd053eade24c57ecc45283406f7c /gdb/defs.h
parent9224a01377868604ce4a7eb9c0d97736f7349dcd (diff)
downloadgdb-f2aec7f6d149c8a534e8246b0d3a50038864fa2d.zip
gdb-f2aec7f6d149c8a534e8246b0d3a50038864fa2d.tar.gz
gdb-f2aec7f6d149c8a534e8246b0d3a50038864fa2d.tar.bz2
Make relocate_{path,gdb_directory} return std::string
This simplifies memory management. I've also changed some global variables to std::string accordingly (which store the result of these functions), but not all because some are used with add_setshow_optional_filename_cmd which requires a char*. gdb/ChangeLog: 2019-09-11 Christian Biesinger <cbiesinger@google.com> * auto-load.c (auto_load_expand_dir_vars): Update. * defs.h (gdb_datadir): Change to std::string. (python_libdir): Likewise. (relocate_gdb_directory): Change return type to std::string. * guile/guile.c (gdbscm_data_directory): Update. (initialize_scheme_side): Update. * jit.c (jit_reader_dir): Change to std::string. (jit_reader_load_command): Update. * main.c (gdb_datadir): Change to std::string. (python_libdir): Likewise. (set_gdb_data_directory): Update. (relocate_path): Change to return std::string. (relocate_gdb_directory): Change to return std::string. (relocate_gdbinit_path_maybe_in_datadir): Update. (captured_main_1): Update. * python/python.c (do_start_initialization): Update. * top.c (show_gdb_datadir): Update. * xml-syscall.c (xml_init_syscalls_info): Update. (init_syscalls_info): Update.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index 14e0a3e..c9a38b6 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -115,11 +115,11 @@ extern int dbx_commands;
extern char *gdb_sysroot;
/* * GDB datadir, used to store data files. */
-extern char *gdb_datadir;
+extern std::string gdb_datadir;
-/* * If non-NULL, the possibly relocated path to python's "lib" directory
+/* * If not empty, the possibly relocated path to python's "lib" directory
specified with --with-python. */
-extern char *python_libdir;
+extern std::string python_libdir;
/* * Search path for separate debug files. */
extern char *debug_file_directory;
@@ -282,7 +282,7 @@ struct value;
/* This really belong in utils.c (path-utils.c?), but it references some
globals that are currently only available to main.c. */
-extern char *relocate_gdb_directory (const char *initial, bool relocatable);
+extern std::string relocate_gdb_directory (const char *initial, bool relocatable);
/* Annotation stuff. */