From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id CDA1A3858D35 for ; Mon, 6 Jul 2020 17:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CDA1A3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eliz@gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]:59314) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsV1F-0004UT-Op for gdb-patches@sourceware.org; Mon, 06 Jul 2020 13:35:05 -0400 Received: from [176.228.60.248] (port=2355 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jsV1F-00025K-13 for gdb-patches@sourceware.org; Mon, 06 Jul 2020 13:35:05 -0400 Date: Mon, 06 Jul 2020 20:35:12 +0300 Message-Id: <83imf0sg1b.fsf@gnu.org> From: Eli Zaretskii To: gdb-patches@sourceware.org Subject: Auto-loading on MS-Windows X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 17:35:07 -0000 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 &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?