From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic304-22.consmr.mail.ir2.yahoo.com (sonic304-22.consmr.mail.ir2.yahoo.com [77.238.179.147]) by sourceware.org (Postfix) with ESMTPS id E0F743858D34 for ; Wed, 8 Jul 2020 17:20:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0F743858D34 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ssbssa@yahoo.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1594228819; bh=L0Re5d6IZS+4p6N0L9MiFXW1g6kXgLJ59PVCuplDE3E=; h=From:To:Subject:Date:References:From:Subject; b=XweE+jmE3czZoTXg8Yj2CT6e2QmQR7RMsIpN1mUdZeOwpDrkY3HvXrXvuTDCXoRSkkK/G6Z2IGgHsHC0HfVRhso1lNZcmIwrff/bhjEgqkrEO01zL4pWCBkUpLQaGKamQZEx8ZpLVhgFessGa9er69IytqMIWy4iYCM2bh7tGgIxCl6jpvBPtHI8KPIiaDpE6bwibOGYFHY7t+hACgRacSkZRkmOFXOenRqunW/GOWa2ZQLxeyH4v7MgYwV6Ejx17rXDf1efdqFHAoYehNP0i66XmSaaY6cXBFxY8svZ2RaW3v/Acq2TwJCnI6N3TZhD5hwZr73mvd/mjGY4Jyexww== X-YMail-OSG: 2TFJCJEVM1mXSOQ6tYSJFI31dASAvllNAWXiXMHmK3iF9JdnfLELJFWG6nraAvr 6wxPooXxEPuJH2HxYaiPE0IaG0rgjs28xocFSQRAt0sjip9jE6UiQH5FtcjHEkDa08Y12kwdGOie wTdCS2zxmOmMwv.nD9wjkesvgwDXOh.LLHq5Ov0a_B0irjo9lYDhuXS9rCb6fv9LZ1gW0TLhN1QI u_vYeOQWCQjUHCStde3Iz6f5CBvblPi_TTzzhyOhOxqTQ5GUBEuQi3tGQuXG0KT5WmB_v3no4G_2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LL4oEV7UzeB5E0jYt5VVQVI1fmpz7VUNAYuzkZjDOxzxVCvI7QJK4ayCLl_05uZH EvAcq2JBuH5XI.b9f1VQ8EQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ir2.yahoo.com with HTTP; Wed, 8 Jul 2020 17:20:19 +0000 Received: by smtp421.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 8ac30a0092608bf4b0d04756913ec0ab; Wed, 08 Jul 2020 17:20:15 +0000 (UTC) From: Hannes Domani To: gdb-patches@sourceware.org Subject: [PATCH v3] Handle Windows drives in auto-load script paths Date: Wed, 8 Jul 2020 19:19:57 +0200 Message-Id: <20200708171957.15720-1-ssbssa@yahoo.de> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Antivirus: Avast (VPS 200708-4, 07/08/2020), Outbound message X-Antivirus-Status: Clean References: <20200708171957.15720-1-ssbssa.ref@yahoo.de> X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: Wed, 08 Jul 2020 17:20:40 -0000 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 * auto-load.c (auto_load_objfile_script_1): Convert drive part of debugfile path on Windows. gdb/doc/ChangeLog: 2020-07-08 Hannes Domani * gdb.texinfo: Document Windows drive conversion of 'set auto-load scripts-directory'. --- v2: - Document Windows drive conversion of 'set auto-load scripts-directory'. v3: - Change path to file name. --- gdb/auto-load.c | 7 +++++++ gdb/doc/gdb.texinfo | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 99bd96b971..75013c2283 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 &dir : vec) { /* FILENAME is absolute, so we don't need a "/" here. */ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index db0ec421dd..1ce9ec78e9 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -27356,6 +27356,10 @@ script in the specified extension language. If this file does not exist, then @value{GDBN} will look for @var{script-name} file in all of the directories as specified below. +(On MS-Windows/MS-DOS, the drive letter of the executable's leading +directories is converted to a one-letter subdirectory, i.e.@: +@file{d:/usr/bin/} is converted to @file{/d/usr/bin/}, because Windows +filesystems disallow colons in file names.) Note that loading of these files requires an accordingly configured @code{auto-load safe-path} (@pxref{Auto-loading safe path}). -- 2.27.0