From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Alexander Fedotov <alfedotov@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/gdbsupport: Use LOCALAPPDATA for index cache on windows
Date: Tue, 8 Dec 2020 10:10:08 -0500 [thread overview]
Message-ID: <5e687f84-b012-f69d-e3f4-e01eea9d01dd@polymtl.ca> (raw)
In-Reply-To: <CAN8C2CodjXCv8T1eB2VojAqg5XCmh9wARTo2CcPi5Ad9GGoF0Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 407 bytes --]
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
[-- Attachment #2: 0001-gdbsupport-Use-LOCALAPPDATA-to-determine-cache-dir.patch --]
[-- Type: text/x-patch, Size: 1684 bytes --]
From 60a7223fdd196d540f87504833166f558c95c035 Mon Sep 17 00:00:00 2001
From: Alexander Fedotov <alfedotov@gmail.com>
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 <alfedotov@gmail.com>
+
+ * pathstuff.cc (get_standard_cache_dir): Use LOCALAPPDATA environment
+ variable when running on Windows.
+
2020-12-01 Andrew Burgess <andrew.burgess@embecosm.com>
* 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<char> abs (gdb_abspath (win_home));
+ return string_printf ("%s/gdb", abs.get ());
+ }
+#endif
+
return {};
}
--
2.29.2
next prev parent reply other threads:[~2020-12-08 15:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 10:16 Alexander Fedotov via Gdb-patches
2020-12-08 14:46 ` Simon Marchi via Gdb-patches
2020-12-08 14:48 ` Simon Marchi via Gdb-patches
2020-12-08 14:51 ` Alexander Fedotov via Gdb-patches
2020-12-08 15:10 ` Simon Marchi via Gdb-patches [this message]
2020-12-08 15:12 ` Alexander Fedotov via Gdb-patches
2020-12-08 15:16 ` Simon Marchi via Gdb-patches
2020-12-08 15:31 ` Eli Zaretskii via Gdb-patches
2020-12-09 9:15 ` Alexander Fedotov via Gdb-patches
2020-12-09 12:45 ` Christian Biesinger via Gdb-patches
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=5e687f84-b012-f69d-e3f4-e01eea9d01dd@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=alfedotov@gmail.com \
--cc=simon.marchi@polymtl.ca \
/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