diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 57e8cc7b2d4..39a2cf35229 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-10-05 Simon Marchi + + * auto-load.c (auto_load_objfile_script_1): Don't use + debugfile_holder as temporary variable when stripping drive + letter. + 2020-10-05 Hannes Domani * amd64-windows-tdep.c (amd64_windows_passed_by_integer_register): diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 9a51d2f3dc6..43d007ca5b0 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -777,10 +777,8 @@ auto_load_objfile_script_1 (struct objfile *objfile, const char *realname, /* Convert Windows file name from c:/dir/file to /c/dir/file. */ if (HAS_DRIVE_SPEC (debugfile)) - { - debugfile_holder = STRIP_DRIVE_SPEC (debugfile); - filename = std::string("\\") + debugfile[0] + debugfile_holder; - } + filename = (std::string("\\") + debugfile[0] + + STRIP_DRIVE_SPEC (debugfile)); for (const gdb::unique_xmalloc_ptr &dir : vec) {