Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Auto-loading on MS-Windows
@ 2020-07-06 17:35 Eli Zaretskii
  2020-07-06 17:55 ` Hannes Domani
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-07-06 17:35 UTC (permalink / raw)
  To: gdb-patches

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?


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-06 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 17:35 Auto-loading on MS-Windows Eli Zaretskii
2020-07-06 17:55 ` Hannes Domani
2020-07-06 18:10   ` Eli Zaretskii
2020-07-06 18:18     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox