From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ajKkJlyXz18WcAAAWB0awg (envelope-from ) for ; Tue, 08 Dec 2020 10:10:20 -0500 Received: by simark.ca (Postfix, from userid 112) id 915AF1F096; Tue, 8 Dec 2020 10:10:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1B4FC1E552 for ; Tue, 8 Dec 2020 10:10:20 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0229385800D; Tue, 8 Dec 2020 15:10:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0229385800D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607440219; bh=aGGjV6eEWrUT7o6IdwI0wavVUkssQdrcZ8x7TZVTtMY=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=DcTPB18lG9+b5msZ57mnBmC0u9gCouiqzIOdLzdlZOdHCx0o9SWsgKc6K2e4B3Gui GFDDAYuU3wPF26EEIFYbr5+0xf3Fe6J4gDA9QLUIGtNnoAUFRpSL3ruUlzsWEZKKtu o+Z3XmhTrt3uB9iJj/27Nwypv8cgRlLTmitDMIec= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 40A60385800D for ; Tue, 8 Dec 2020 15:10:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 40A60385800D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 0B8FA9LB015178 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 8 Dec 2020 10:10:13 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0B8FA9LB015178 Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id DF4311E552; Tue, 8 Dec 2020 10:10:08 -0500 (EST) Subject: Re: [PATCH] gdb/gdbsupport: Use LOCALAPPDATA for index cache on windows To: Alexander Fedotov References: <93d41b96-d11e-ed21-2a63-6a8270b5fbfe@polymtl.ca> Message-ID: <5e687f84-b012-f69d-e3f4-e01eea9d01dd@polymtl.ca> Date: Tue, 8 Dec 2020 10:10:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------9B12AC6B6E5B3DFF462CF02B" Content-Language: en-US X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 8 Dec 2020 15:10:09 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------9B12AC6B6E5B3DFF462CF02B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2020-12-08 9:51 a.m., Alexander Fedotov wrote: > Well, I don't know if other GDB parts depend on the final name. I just > followed common convention. If there are no such dependencies so I > don't mind using your suggestion:) GDB doesn't depend on a particular directory, I think it's better to follow the standards of the platform as much as possible. Does the attached patch look ok to you? Simon --------------9B12AC6B6E5B3DFF462CF02B Content-Type: text/x-patch; charset=UTF-8; name="0001-gdbsupport-Use-LOCALAPPDATA-to-determine-cache-dir.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-gdbsupport-Use-LOCALAPPDATA-to-determine-cache-dir.patc"; filename*1="h" >From 60a7223fdd196d540f87504833166f558c95c035 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Tue, 8 Dec 2020 13:07:23 +0300 Subject: [PATCH] gdbsupport: Use LOCALAPPDATA to determine cache dir Use the LOCALAPPDATA environment variable to determine the cache dir when running on Windows with native command line, otherwise nasty warning "Couldn't determine a path for index cached directory" appears. Change-Id: I77903f9f0cb4743555866b8aea892cef55132589 --- gdbsupport/ChangeLog | 5 +++++ gdbsupport/pathstuff.cc | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gdbsupport/ChangeLog b/gdbsupport/ChangeLog index 88a0413e8b9f..417e44aff31d 100644 --- a/gdbsupport/ChangeLog +++ b/gdbsupport/ChangeLog @@ -1,3 +1,8 @@ +2020-12-08 Alexander Fedotov + + * pathstuff.cc (get_standard_cache_dir): Use LOCALAPPDATA environment + variable when running on Windows. + 2020-12-01 Andrew Burgess * tdesc.cc (print_xml_feature::visit): Print enum fields using diff --git a/gdbsupport/pathstuff.cc b/gdbsupport/pathstuff.cc index 311456720e4a..b23e6ed064cf 100644 --- a/gdbsupport/pathstuff.cc +++ b/gdbsupport/pathstuff.cc @@ -238,6 +238,16 @@ get_standard_cache_dir () return string_printf ("%s/" HOME_CACHE_DIR "/gdb", abs.get ()); } +#ifdef WIN32 + const char *win_home = getenv ("LOCALAPPDATA"); + if (win_home != NULL) + { + /* Make sure the path is absolute and tilde-expanded. */ + gdb::unique_xmalloc_ptr abs (gdb_abspath (win_home)); + return string_printf ("%s/gdb", abs.get ()); + } +#endif + return {}; } -- 2.29.2 --------------9B12AC6B6E5B3DFF462CF02B--