diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2020-05-13 12:35:51 +0200 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2020-07-08 20:50:43 +0200 |
commit | 6e2469ff7afa5134cb55154212e10f25b9e7b2dd (patch) | |
tree | 3e5d15ae2606efebf9343eb31c1001dbb87fb0cc /gdb/auto-load.c | |
parent | d1076c4151af8e8d4a343906d2ed1e26cb7809eb (diff) | |
download | gdb-6e2469ff7afa5134cb55154212e10f25b9e7b2dd.zip gdb-6e2469ff7afa5134cb55154212e10f25b9e7b2dd.tar.gz gdb-6e2469ff7afa5134cb55154212e10f25b9e7b2dd.tar.bz2 |
Handle Windows drives in auto-load script paths
Fixes this testsuite fail on Windows:
FAIL: gdb.base/auto-load.exp: print $script_loaded
Converts the debugfile path from c:/dir/file to /c/dir/file, so it can be
appended to the auto-load path.
gdb/ChangeLog:
2020-07-08 Hannes Domani <ssbssa@yahoo.de>
* auto-load.c (auto_load_objfile_script_1): Convert drive part
of debugfile path on Windows.
gdb/doc/ChangeLog:
2020-07-08 Hannes Domani <ssbssa@yahoo.de>
* gdb.texinfo: Document Windows drive conversion of
'set auto-load scripts-directory'.
Diffstat (limited to 'gdb/auto-load.c')
-rw-r--r-- | gdb/auto-load.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 99bd96b..c967261 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -784,6 +784,13 @@ auto_load_objfile_script_1 (struct objfile *objfile, const char *realname, "scripts-directory' path \"%s\".\n"), auto_load_dir); + /* 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; + } + for (const gdb::unique_xmalloc_ptr<char> &dir : vec) { /* FILENAME is absolute, so we don't need a "/" here. */ |