Merge pull request #5461 from orgads/gdb-cache-dir

gdb: Fix cache dir resolving
This commit is contained in:
Алексей
2019-06-03 08:53:21 +03:00
committed by GitHub
2 changed files with 34 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
# Until https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62279 is
# fixed, we will stick with 7.6.2 which hasn't got this bug..
pkgver=8.3
pkgrel=5
pkgrel=6
pkgdesc="GNU Debugger (mingw-w64)"
arch=('any')
url="https://www.gnu.org/software/gdb/"
@@ -34,7 +34,8 @@ source=(https://ftp.gnu.org/gnu/gdb/${_realname}-${pkgver}.tar.xz{,.sig}
'gdb-py3-fixes.patch'
'python-configure-path-fixes.patch'
'gdb-fix-tui-with-pdcurses.patch'
'gdb-8.3-lib-order.patch')
'gdb-8.3-lib-order.patch'
'gdb-8.3-cache-dir.patch')
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3')
sha256sums=('802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e'
'SKIP'
@@ -47,7 +48,8 @@ sha256sums=('802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e'
'bfe8985e806200e5a1007c4565bd60de0a297369d17d4a0178512f2df29b34fc'
'bdf6c2b51d6c8c84b7b20abb9d1702f110c0c0e06e3d68eb6aba817664354450'
'4d6b2b8ab03cea1c47e882ed17ddc3c528e22c92e3538ab261d9bb629626d50b'
'd92e2135e6f1bed51128f702a0630a961c0eaf241bb35fdafd0fe0d67cd0fb48')
'd92e2135e6f1bed51128f702a0630a961c0eaf241bb35fdafd0fe0d67cd0fb48'
'26604e9495554561f06684e3078eaaac75f83535138a1ac80b6d7ab45188b5ff')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
@@ -70,6 +72,7 @@ prepare() {
patch -p1 -i ${srcdir}/gdb-fix-tui-with-pdcurses.patch
patch -p1 -i ${srcdir}/gdb-8.3-lib-order.patch
patch -p1 -i ${srcdir}/gdb-8.3-cache-dir.patch
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure

View File

@@ -0,0 +1,28 @@
From d493bf96fec9ec55c45f24de7b296142ffa0ccff Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgads@gmail.com>
Date: Mon, 3 Jun 2019 08:37:40 +0300
Subject: [PATCH] Fix cache dir resolving on Windows
... when not running from MSYS environment, and HOME is not set.
---
gdb/common/pathstuff.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/common/pathstuff.c b/gdb/common/pathstuff.c
index 2b1669a5b9..edb8a1fcda 100644
--- a/gdb/common/pathstuff.c
+++ b/gdb/common/pathstuff.c
@@ -231,6 +231,10 @@ get_standard_cache_dir ()
#endif
const char *home = getenv ("HOME");
+#ifdef _WIN32
+ if (home == nullptr)
+ home = getenv ("USERPROFILE");
+#endif
if (home != NULL)
{
/* Make sure the path is absolute and tilde-expanded. */
--
2.22.0.rc0.windows.1