Auto-loading on MS-Windows
Hannes Domani
ssbssa@yahoo.de
Mon Jul 6 17:55:06 GMT 2020
Am Montag, 6. Juli 2020, 19:35:12 MESZ hat Eli Zaretskii <eliz@gnu.org> Folgendes geschrieben:
> I turned on "debug auto-load" today and saw this:
>
> auto-load: Attempted file "D:\gnu\gdb-10.0.50.20200629\gdb\gdb.exe-gdb.py" does not exist.
> auto-load: Expanded $-variables to "d:\usr\lib\debug;d:\usr\share\gdb\9.1/../auto-load".
> auto-load: Searching 'set auto-load scripts-directory' path "$debugdir;$datadir/../auto-load".
> auto-load: Attempted file "d:\usr\lib\debugD:\gnu\gdb-10.0.50.20200629\gdb\gdb.exe-gdb.py" does not exist.
> auto-load: Attempted file "d:\usr\share\gdb\9.1/../auto-loadD:\gnu\gdb-10.0.50.20200629\gdb\gdb.exe-gdb.py" does not exist.
> ^^^^^^^^^^^^^^^^^^^^^^
>
> Note the underlined part: we are concatenating the auto-load directory
> with an absolute Windows file name, and the result is an invalid file
> name. The code in auto_load_objfile_script_1 which does that:
>
> if (debug_auto_load)
> fprintf_unfiltered (gdb_stdlog, _("auto-load: Searching 'set auto-load "
> "scripts-directory' path \"%s\".\n"),
> auto_load_dir);
>
> for (const gdb::unique_xmalloc_ptr<char> &dir : vec)
> {
> /* FILENAME is absolute, so we don't need a "/" here. */
> debugfile_holder = dir.get () + filename;
> debugfile = debugfile_holder.c_str ();
>
> input = gdb_fopen_cloexec (debugfile, "r");
>
> evidently assumes the absolute file names start with a slash.
>
> I guess on Windows we need to convert "D:\foo\bar" into "\D\foo\bar"
> before appending it to the auto-load directory?
I've sent this patch not too long ago:
https://sourceware.org/pipermail/gdb-patches/2020-May/169125.html
And I've kinda missed to ping it.
Hannes
More information about the Gdb-patches
mailing list