Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sourceware.org
Subject: Auto-loading on MS-Windows
Date: Mon, 06 Jul 2020 20:35:12 +0300	[thread overview]
Message-ID: <83imf0sg1b.fsf@gnu.org> (raw)

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?


             reply	other threads:[~2020-07-06 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06 17:35 Eli Zaretskii [this message]
2020-07-06 17:55 ` Hannes Domani
2020-07-06 18:10   ` Eli Zaretskii
2020-07-06 18:18     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83imf0sg1b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox