aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/main.c8
2 files changed, 10 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1be7f4b..7285515 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2019-10-01 Philippe Waroquiers <philippe.waroquiers@skynet.be>
+
+ * main.c (relocate_gdbinit_path_maybe_in_datadir): Remove std::string
+ conversion of gdb_datadir.
+ (captured_main_1): Remove xstrdup when assigning to gdb_datadir,
+ remove not needed c_str ().
+
2019-09-30 Ali Tamur <tamur@google.com>
* dwarf2read.c (skip_one_die): Handle DW_FORM_strx forms.
diff --git a/gdb/main.c b/gdb/main.c
index 7fab8ff..14d9e79 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -214,8 +214,7 @@ relocate_gdbinit_path_maybe_in_datadir (const std::string& file)
size_t start = datadir_len;
for (; IS_DIR_SEPARATOR (file[start]); ++start)
;
- relocated_path = (std::string (gdb_datadir) + SLASH_STRING
- + file.substr (start));
+ relocated_path = gdb_datadir + SLASH_STRING + file.substr (start);
}
else
{
@@ -549,9 +548,8 @@ captured_main_1 (struct captured_main_args *context)
= xstrdup (relocate_gdb_directory (DEBUGDIR,
DEBUGDIR_RELOCATABLE).c_str ());
- gdb_datadir
- = xstrdup (relocate_gdb_directory (GDB_DATADIR,
- GDB_DATADIR_RELOCATABLE).c_str ());
+ gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
+ GDB_DATADIR_RELOCATABLE);
#ifdef WITH_PYTHON_PATH
{