From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic307-54.consmr.mail.ir2.yahoo.com (sonic307-54.consmr.mail.ir2.yahoo.com [87.248.110.31]) by sourceware.org (Postfix) with ESMTPS id 705643840C25 for ; Fri, 29 May 2020 15:08:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 705643840C25 X-YMail-OSG: 9JQ33iYVM1m6cjIQXb3blLbYzRfYDqrLov5HrKI2AHxUt8hgzAiMDO.qvvWcpKk mBhXg73tJJiy6vTuW_nqe6Yo4Gq4Gw7Mv8S6aVuGN3dDsu3bfxKmM6rSvMfZLB25pSEdcap35_Vx .G06RH4XlEsoF3r6JpCQJiQpsHKEtRlsT7dl4Pdmk_EHS6iCjnBJ3upu_musm1oop_g5lb4wdas6 B8pdBH0l13a8B2KUzno7lG8JgI7.8gMqPFp1txNmSGFXHMR6quKC0.JOL_8jaK4XOnGOUwXtcKrZ 34csuGBH8wOuYB7ztXUwMsw3f_oduwwoeP.mzTSBIFgLjoQFql4FyCT7hVMz7NVDHfLg5q3Q07HJ Li1.0MSwqLOFYaGjoj3zhVGoa4yma_6mn0TaImr6dv4xBeDa_Vbmt9zTXDl3Ifq9_bf3ZOnGD9a7 Iot3.BYEzUpjZkRBlXTmaGfpBVIDm6D6o_YzAFrk3taqo2Jb0O0kJaNuERx6Mm_dNHARKUTX6bqW NIdSETJTZhquBn4IiNKbmonJGCOcBaIqs0M9dgORhZ4Qfe4YiRVlMiEyUYyw2avwByW.HsgXH2WA HAHs2klH7qIjrKwAw.LbubDBoLoCuQcfiX1Un4ZA3mKexMa89U6o3Ueq0xxoDJEMDSY0n9ca5OcL EWv2r43Am3a83Le70VgQFmIorAe9ZVPnDe6Bv723eG2AxxCHeLpUpUJn5pYgo_Y19MCUlPA_L7_g jvcxYJv4xh5VvfFqszQFT8S4pIiWytqhcEOuNVNmFMKKtw2EH5LcdhqmzYc5kPBhA4dT3rWwgMob zfG0FzUpzu5AAopT5wau3m1sY7wgjFR_Y692yZ9STjhYl7Mntf4a9k3y4kcvoSCKkYgNooy8g.Xd F9b4st5qdAlijGbrtrl1b1PRirzPVUr6Z.nrWMgukAm0lIerBIwfQrAgvk766ZVQ21KvAKwAeDYy jbWVKdRYyLJMT.th0pDTJTf5nxmUhjohV7CV.lHdId_9Q6o6glZclYurj_2MPur_FpfcK8tTO9zq ilKlqExlpaRl4vxPB7C0orKZtYLH2Z4kCgYF4CJ2it5LRgp2SxZPzXiYBISkhi2JknQg1WzH59lj VQTUcDr4ZAaDTGhiC1juPse1730SWyJ5umZyyj3S3Es5Lp2vDVBBMZ.Wx5ldV_r2eel6G3FtBib1 j93oB6d6XzcOo2xyTIyRskczAIhz3gZiR5IbtgZlSChJYWXIrOGWrdWAqn1.Sf0GguCYSfXD4j13 ptzbivaNer97MUn86tBAzxdXPcUh6UnMywDl08ZAVIzq.Esm5xFDyu70QhTXrjptupS5Jjsc_m5h uEfzEPNQUhHcXCutVV6O9XLgMjjbN6_gD2BrA_6gj5ufezDReQzXeSA5DMG3EYK9XyOz2srC60vk BBdR5PuBxKgEXfSHcw_W3ScJuzo9MmA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Fri, 29 May 2020 15:08:39 +0000 Received: by smtp422.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 1046120115d170935a2d82f1b1c0585f; Fri, 29 May 2020 15:08:37 +0000 (UTC) From: Hannes Domani To: gdb-patches@sourceware.org Subject: [PATCH 2/2] Handle Windows drives in auto-load script paths Date: Fri, 29 May 2020 17:08:00 +0200 Message-Id: <20200529150800.2013-2-ssbssa@yahoo.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200529150800.2013-1-ssbssa@yahoo.de> References: <20200529150800.2013-1-ssbssa@yahoo.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Antivirus: Avast (VPS 200528-0, 05/28/2020), Outbound message X-Antivirus-Status: Clean X-Spam-Status: No, score=-11.1 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: Fri, 29 May 2020 15:08:42 -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-05-29 Hannes Domani * auto-load.c (auto_load_objfile_script_1): Convert drive part of debugfile path on Windows. gdb/doc/ChangeLog: 2020-05-29 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'. --- 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..88221d9f3d 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 debugfile path 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 292fd4d14e..f31d7013b9 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -27266,6 +27266,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.26.2