gdb: sync patches from cygwin

to make the next update easier

* sync all patches
* change numbering for non-cygwin patches
* remove useless diff from 1006-autoreconf.patch
This commit is contained in:
Christoph Reiter 2024-07-09 07:18:06 +02:00
parent 2165e9e4b1
commit 0a70e5f8f2
10 changed files with 318 additions and 294 deletions

View File

@ -1,129 +0,0 @@
From 67d65c0cf53d1b5ab123386e2c62d8ed22147d34 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Tue, 12 Jan 2016 22:26:26 +0000
Subject: [PATCH 2/6] 7.8-windows-nat-cygwin
Remaining parts of 7.8-windows-nat-cygwin.patch not yet upstream.
Signal changes:
* Replace have_saved_context with signal_thread_id throughout, and store the
thread id in it
* In thread_rec(), only use the signal saved context if we are retrieving the
context for the correct thread.
* Clear ContextFlags in the signal saved context so we never attempt to restore
it to the inferior
Since the signal context is the context which will be restored after any signal
handler has been run, to resume to it skips over the actual signal delivery.
(Unfortunately, this isn't quite right. If GDB decides it needs to single-step
after continuing by setting FLAG_TRACE_BIT, we must alter the inferior state. So
we potentially need to have both the signal saved context, and the actual
context for the thread. Which is not a straightforward change to make.)
Unrelated changes:
* An unclear change for detecting if it's an unexpected Cygwin message. Just
checking for a leading 'cYg' should be enough?
* Cast DWORD thread_id to int before returning it from get_windows_event.
(I don't think this is needed. If DWORD->int is a narrowing conversion, we
have other problems...)
* In one place, clarify that thread_rec()'s second parameter is a bool flag.
(This should be done everywhere, or not)
---
gdb/windows-nat.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 7a139c8d36f..40229478b6f 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -99,8 +99,7 @@ struct windows_per_inferior : public windows_process_info
bool handle_access_violation (const EXCEPTION_RECORD *rec) override;
- int have_saved_context = 0; /* True if we've saved context from a
- cygwin signal. */
+ DWORD signal_thread_id; /* Non-zero if we saved context. */
uintptr_t dr[8] {};
@@ -524,7 +523,7 @@ windows_per_inferior::thread_rec
/* Nothing. */
break;
case INVALIDATE_CONTEXT:
- if (ptid.lwp () != current_event.dwThreadId)
+ if (ptid.lwp () != current_event.dwThreadId && ptid.lwp () != signal_thread_id)
th->suspend ();
th->reload_context = true;
break;
@@ -723,7 +722,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
if (th->reload_context)
{
#ifdef __CYGWIN__
- if (windows_process.have_saved_context)
+ if (windows_process.signal_thread_id)
{
/* Lie about where the program actually is stopped since
cygwin has informed us that we should consider the signal
@@ -731,7 +730,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
"saved_context. */
memcpy (&th->context, &windows_process.saved_context,
__COPY_CONTEXT_SIZE);
- windows_process.have_saved_context = 0;
+ windows_process.signal_thread_id = 0;
}
else
#endif
@@ -1018,7 +1017,11 @@ windows_per_inferior::handle_output_debug_string
else if (!startswith (s.get (), _CYGWIN_SIGNAL_STRING))
{
#ifdef __CYGWIN__
- if (!startswith (s.get (), "cYg"))
+ /* This looks like this is supposed to ignore all other expected Cygwin
+ debug output (e.g. handle and strace output), but isn't quite right as
+ strace output might be indicated by any 8 digit hex address. */
+ if (!startswith (s.get (), "cYg") || (strncmp (s.get () + 3, "FFFFFFFF", 8) != 0
+ && strncmp (s.get () + 3, "std", 3) != 0))
#endif
{
char *p = strchr (s.get (), '\0');
@@ -1056,7 +1059,12 @@ windows_per_inferior::handle_output_debug_string
&saved_context,
__COPY_CONTEXT_SIZE, &n)
&& n == __COPY_CONTEXT_SIZE)
- have_saved_context = 1;
+ {
+ signal_thread_id = retval;
+ saved_context.ContextFlags = 0; /* Don't attempt to call SetContext */
+ }
+ else
+ retval = 0;
}
}
#endif
@@ -1591,7 +1599,6 @@ windows_nat_target::get_windows_debug_event
event_code = windows_process.current_event.dwDebugEventCode;
ourstatus->set_spurious ();
- windows_process.have_saved_context = 0;
switch (event_code)
{
@@ -1808,7 +1815,7 @@ windows_nat_target::get_windows_debug_event
if (thread_id == 0)
return null_ptid;
- return ptid_t (windows_process.current_event.dwProcessId, thread_id, 0);
+ return ptid_t (windows_process.current_event.dwProcessId, (int) thread_id, 0);
}
/* Wait for interesting events to occur in the target process. */
--
2.44.0.windows.1

View File

@ -0,0 +1,38 @@
From ba3adfb8cd8074759432f040b5d4967963035415 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Mon, 14 Sep 2020 14:23:54 +0100
Subject: [PATCH 02/10] Only ignore expected Cygwin OutputDebugStrings()
Rather than ignoring all debug strings starting with 'cYg', just ignore
the expected ones:
- 'cYgSiGw00f' informs the debugger of a Cygwin signal in the debuggee
- 'cYgstd' invites the debugger to alter stdin/out/err fds in the debuggee
- 'cYgFFFFFFFFFF' invites the debugger to activate strace output from the debugee
Any other debug string starting 'cYg' is unexpected, and reported
verbatim.
---
gdb/windows-nat.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index f9172c3a7f8..32e97788942 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -997,7 +997,11 @@ windows_nat::handle_output_debug_string (struct target_waitstatus *ourstatus)
else if (!startswith (s.get (), _CYGWIN_SIGNAL_STRING))
{
#ifdef __CYGWIN__
- if (!startswith (s.get (), "cYg"))
+ /* Ignore calls to OutputDebugString() which start with 'cYg', which are
+ expected to be generated by Cygwin. Except some unclear special cases.
+ */
+ if (!startswith (s.get (), "cYg") || (strncmp (s.get () + 3, "FFFFFFFF", 8) != 0
+ && strncmp (s.get () + 3, "std", 3) != 0))
#endif
{
char *p = strchr (s.get (), '\0');
--
2.28.0

View File

@ -1,37 +0,0 @@
From fe506e4b6be96a1128db4e516f8b57d08767c4cd Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Wed, 13 Jan 2016 18:27:48 +0000
Subject: [PATCH 3/6] Better handling for realpath() failures in
windows_make_so() on Cygwin
Fix a memory leak which would occur in the case when the result of realpath() is
greater than or equal to SO_NAME_MAX_PATH_SIZE.
Distinguish between realpath() failing (returning NULL), and returning a path
longer than SO_NAME_MAX_PATH_SIZE
Warn rather than stopping with an error in those cases.
Original patch from Tim Chick. Memory leak fix by Corinna Vinschen.
---
gdb/windows-nat.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 40229478b6f..d46de87f238 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -894,6 +894,10 @@ windows_make_so (const char *name, LPVOID load_addr)
{
warning (_("dll path for \"%s\" too long or inaccessible"), name);
so->name = so->original_name;
+ if (rname)
+ {
+ free (rname);
+ }
}
}
/* Record cygwin1.dll .text start/end. */
--
2.44.0.windows.1

View File

@ -0,0 +1,48 @@
From a5688ea5d3facd07a15a65dc989ccb4dd027dc5b Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Wed, 13 Jan 2016 18:27:48 +0000
Subject: [PATCH 3/6] Fix potential memory leak after using realpath() on
Cygwin
Currently, free-ing the result of realpath() is skipped over when it
rturns a string with a length greater than or equal to SO_NAME_MAX_PATH_SIZE.
Distinguish between realpath() failing (returning NULL), and that case
to fix a potential memory leak.
Patch originally by Corinna Vinschen.
---
gdb/windows-nat.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index c2d792b7cde..4bd88399f48 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -894,14 +894,20 @@ windows_make_so (const char *name, LPVOID load_addr)
else
{
char *rname = realpath (name, NULL);
- if (rname && strlen (rname) < SO_NAME_MAX_PATH_SIZE)
+ if (rname)
{
- so->name = rname;
+ if (strlen (rname) < SO_NAME_MAX_PATH_SIZE)
+ so->name = rname;
+ else
+ {
+ warning (_("dll path \"%s\" too long"), rname);
+ so->name = so->original_name;
+ }
free (rname);
}
else
{
- warning (_("dll path for \"%s\" too long or inaccessible"), name);
+ warning (_("dll path for \"%s\" can not be evaluated"), name);
so->name = so->original_name;
}
}
--
2.39.0

View File

@ -1,15 +1,15 @@
From 0f951846ce757c0d6974b4af85d409e316064577 Mon Sep 17 00:00:00 2001
From a9f50b60641820dd44819b9ffe54bea49a461bf5 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Sun, 24 Jul 2016 18:18:10 +0100
Subject: [PATCH 4/6] 7.8-symtab-cygwin
Subject: [PATCH 4/6] 7.8-symtab-cygwin.patch
See https://sourceware.org/ml/gdb-patches/2002-03/msg00557.html
---
gdb/symtab.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
gdb/symtab.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e9bc7b2c933..7dbab36e0dd 100644
index e9bc7b2c933..dc92e8ee3c6 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -896,6 +896,10 @@ create_demangled_names_hash (struct objfile_per_bfd_storage *per_bfd)
@ -23,7 +23,7 @@ index e9bc7b2c933..7dbab36e0dd 100644
/* See symtab.h */
gdb::unique_xmalloc_ptr<char>
@@ -905,6 +909,40 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
@@ -905,6 +909,39 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
gdb::unique_xmalloc_ptr<char> demangled;
int i;
@ -46,24 +46,23 @@ index e9bc7b2c933..7dbab36e0dd 100644
+
+ Whatever. But our demangler doesn't like that '@N' suffix, so we
+ need to strip it off. */
+#ifdef LINKER_SYMBOLS_HAVE_WIN32_STDCALL_ARG_SIZES
+ {
+ char *arg_byte_suffix = strchr (mangled, '@');
+ if (arg_byte_suffix)
+ {
+ int prefix_len = arg_byte_suffix - mangled;
+ char *mangled_sans_suffix = (char *)(alloca (prefix_len + 1));
+ memcpy (mangled_sans_suffix, mangled, prefix_len);
+ mangled_sans_suffix[prefix_len] = '\0';
+ if (LINKER_SYMBOLS_HAVE_WIN32_STDCALL_ARG_SIZES)
+ {
+ char *arg_byte_suffix = strchr (mangled, '@');
+ if (arg_byte_suffix)
+ {
+ int prefix_len = arg_byte_suffix - mangled;
+ char *mangled_sans_suffix = (char *)(alloca (prefix_len + 1));
+ memcpy (mangled_sans_suffix, mangled, prefix_len);
+ mangled_sans_suffix[prefix_len] = '\0';
+
+ mangled = mangled_sans_suffix;
+ }
+ }
+#endif
+ mangled = mangled_sans_suffix;
+ }
+ }
+
if (gsymbol->language () != language_unknown)
{
const struct language_defn *lang = language_def (gsymbol->language ());
--
2.44.0.windows.1
2.42.1

View File

@ -0,0 +1,135 @@
From b80dc29e4d307d9e32d257cfc92ce391f0ae26f6 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Tue, 15 Sep 2020 16:38:06 +0100
Subject: [PATCH 5/6] Drop special way of getting inferior context after a
Cygwin signal
Simplify Cygwin signal handling by dropping the special way of getting
inferior context after a Cygwin signal.
I think the reason this existed was because previously we were not able
to unwind through the alternate stack used by _sigfe frames, so without
the hint of the "user" code IP, the backtrace from a signal was
unusable.
Now we can unwind through _sigfe frames, drop all this complexity.
(Restoring this specially obtained context to the inferior (as the code
currently does) skips over the actual signal delivery and handling.
Cygwin has carried for a long time a patch which clears the ContextFlags
in the signal context, so we never attempt to restore it to the
inferior, but that interfers with gdb's ability to modify that context
e.g. if it decides it wants to turn on FLAG_TRACE_BIT)
v2:
Update use of DEBUG_EVENTS, changed in 4ef367bf
v3:
Update for windows_per_inferior struct
---
gdb/windows-nat.c | 50 ++++++++++++-----------------------------------
1 file changed, 13 insertions(+), 37 deletions(-)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 4bd88399f48..063d888768a 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -98,10 +98,6 @@ struct windows_per_inferior : public windows_process_info
void handle_unload_dll () override;
bool handle_access_violation (const EXCEPTION_RECORD *rec) override;
-
- int have_saved_context = 0; /* True if we've saved context from a
- cygwin signal. */
-
uintptr_t dr[8] {};
int windows_initialization_done = 0;
@@ -140,9 +136,6 @@ struct windows_per_inferior : public windows_process_info
std::vector<windows_solib> solibs;
#ifdef __CYGWIN__
- CONTEXT saved_context {}; /* Contains the saved context from a
- cygwin signal. */
-
/* The starting and ending address of the cygwin1.dll text segment. */
CORE_ADDR cygwin_load_start = 0;
CORE_ADDR cygwin_load_end = 0;
@@ -730,19 +723,6 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
if (th->reload_context)
{
-#ifdef __CYGWIN__
- if (windows_process.have_saved_context)
- {
- /* Lie about where the program actually is stopped since
- cygwin has informed us that we should consider the signal
- to have occurred at another location which is stored in
- "saved_context. */
- memcpy (&th->context, &windows_process.saved_context,
- __COPY_CONTEXT_SIZE);
- windows_process.have_saved_context = 0;
- }
- else
-#endif
#ifdef __x86_64__
if (windows_process.wow64_process)
{
@@ -1049,33 +1029,30 @@ windows_per_inferior::handle_output_debug_string
#ifdef __CYGWIN__
else
{
- /* Got a cygwin signal marker. A cygwin signal is followed by
- the signal number itself and then optionally followed by the
- thread id and address to saved context within the DLL. If
- these are supplied, then the given thread is assumed to have
- issued the signal and the context from the thread is assumed
- to be stored at the given address in the inferior. Tell gdb
- to treat this like a real signal. */
+ /* Got a cygwin signal marker. A cygwin signal marker is followed by the
+ signal number itself, and (since Cygwin 1.7) the thread id, and the
+ address of a saved context in the inferior (That context has an IP
+ which is the return address in "user" code of the cygwin internal
+ signal handling code, but is not otherwise usable).
+
+ Tell gdb to treat this like the given thread issued a real signal.
+ */
char *p;
int sig = strtol (s.get () + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0);
gdb_signal gotasig = gdb_signal_from_host (sig);
+ LPCVOID x = 0;
if (gotasig)
{
- LPCVOID x;
- SIZE_T n;
-
ourstatus->set_stopped (gotasig);
retval = strtoul (p, &p, 0);
if (!retval)
retval = current_event.dwThreadId;
- else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
- && ReadProcessMemory (handle, x,
- &saved_context,
- __COPY_CONTEXT_SIZE, &n)
- && n == __COPY_CONTEXT_SIZE)
- have_saved_context = 1;
+ else
+ x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0);
}
+
+ DEBUG_EVENTS ("gdb: cygwin signal %d, thread 0x%x, CONTEXT @ %p", gotasig, retval, x);
}
#endif
@@ -1609,7 +1586,6 @@ windows_nat_target::get_windows_debug_event
event_code = windows_process.current_event.dwDebugEventCode;
ourstatus->set_spurious ();
- windows_process.have_saved_context = 0;
switch (event_code)
{
--
2.39.0

View File

@ -0,0 +1,58 @@
From fd538625ef0453a5858e846df26f6fa58606210d Mon Sep 17 00:00:00 2001
From: Takashi Yano <takashi.yano@nifty.ne.jp>
Date: Thu, 6 May 2021 20:59:14 +0100
Subject: [PATCH 6/7] Use cygwin pgid if inferior is a cygwin process
I have noticed that cygwin gdb has a problem with the terrminal process
group on the inferior. e.g.:
1) Install coreutils-debuginfo package.
2) Run "gdb cat".
3) Enter "start" in gdb.
4) Enter "cont" in gdb.
This results in:
/usr/bin/cat: -: Input/output error
Cygwin gdb uses CreateProcessW() to execute debugging process, rather
than exec(), so gdb has the Windows (rather than cygwin) PID.
If the inferior is a cygwin process, use the cygwin pid. However, if
the inferior is a non-cygwin process, tcsetpgrp() is not meaningful and
there is no appropriate pgid to set.
---
gdb/inflow.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gdb/inflow.c b/gdb/inflow.c
index f9917d6a81c..ade695972ce 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -40,6 +40,10 @@
#include <sys/ioctl.h>
#endif
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#endif
+
#ifndef O_NOCTTY
#define O_NOCTTY 0
#endif
@@ -367,7 +371,13 @@ child_terminal_inferior (struct target_ops *self)
time the inferior was running. See also comments
describing terminal_state::process_group. */
#ifdef HAVE_GETPGID
+#ifdef __CYGWIN__
+ pid_t cygpid = cygwin_internal (CW_WINPID_TO_CYGWIN_PID, inf->pid);
+ if (cygpid <= cygwin_internal (CW_MAX_CYGWIN_PID))
+ result = tcsetpgrp (0, getpgid (cygpid));
+#else
result = tcsetpgrp (0, getpgid (inf->pid));
+#endif
#else
result = tcsetpgrp (0, tinfo->process_group);
#endif
--
2.33.0

View File

@ -166,101 +166,6 @@ diff --git a/configure b/configure
index dd743c58663..51c7d7b0b20 100755
--- a/configure
+++ b/configure
@@ -1534,12 +1534,12 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-as-accelerator-for=ARG
- build as offload target compiler. Specify offload
+ build as offload target compiler. Specify offload
host triple by ARG
--enable-offload-targets=LIST
enable offloading to devices from comma-separated
- LIST of TARGET[=DIR]. Use optional path to find
- offload target compiler during the build
+ LIST of TARGET[=DIR]. Use optional path to find
+ offload target compiler during the build
--enable-offload-defaulted
If enabled, configured but not installed offload compilers and
libgomp plugins are silently ignored. Useful for distribution
@@ -1550,7 +1550,7 @@ Optional Features:
--enable-gprofng[=ARG] build gprofng [ARG={yes,no}]
--enable-compressed-debug-sections={all,gas,gold,ld,none}
Enable compressed debug sections for gas, gold or ld
- by default
+ by default
--enable-default-compressed-debug-sections-algorithm={zlib,zstd}
Default compression algorithm for
--enable-compressed-debug-sections.
@@ -1577,17 +1577,17 @@ Optional Features:
--enable-host-pie build position independent host executables
--enable-host-shared build host code as shared libraries
--enable-stage1-languages[=all]
- choose additional languages to build during stage1.
+ choose additional languages to build during stage1.
Mostly useful for compiler development
- --enable-objc-gc enable use of Boehm's garbage collector with the GNU
- Objective-C runtime
+ --enable-objc-gc enable use of Boehm's garbage collector with the
+ GNU Objective-C runtime
--enable-vtable-verify Enable vtable verification feature
--enable-serial-[{host,target,build}-]configure
- force sequential configuration of sub-packages for
- the host, target or build machine, or all
+ force sequential configuration of sub-packages for
+ the host, target or build machine, or all
sub-packages
--enable-maintainer-mode
- enable make rules and dependencies not useful (and
+ enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--enable-stage1-checking[=all]
choose additional checking for stage1 of the
@@ -1602,19 +1602,20 @@ Optional Packages:
--with-zstd Support zstd compressed debug sections
(default=auto)
--with-mpc=PATH specify prefix directory for installed MPC package.
- Equivalent to --with-mpc-include=PATH/include plus
+ Equivalent to --with-mpc-include=PATH/include plus
--with-mpc-lib=PATH/lib
--with-mpc-include=PATH specify directory for installed MPC include files
--with-mpc-lib=PATH specify directory for the installed MPC library
- --with-mpfr=PATH specify prefix directory for installed MPFR package.
- Equivalent to --with-mpfr-include=PATH/include plus
+ --with-mpfr=PATH specify prefix directory for installed MPFR
+ package. Equivalent to
+ --with-mpfr-include=PATH/include plus
--with-mpfr-lib=PATH/lib
--with-mpfr-include=PATH
specify directory for installed MPFR include files
--with-mpfr-lib=PATH specify directory for the installed MPFR library
--with-gmp=PATH specify prefix directory for the installed GMP
- package. Equivalent to
- --with-gmp-include=PATH/include plus
+ package. Equivalent to
+ --with-gmp-include=PATH/include plus
--with-gmp-lib=PATH/lib
--with-gmp-include=PATH specify directory for installed GMP include files
--with-gmp-lib=PATH specify directory for the installed GMP library
@@ -1628,15 +1629,15 @@ Optional Packages:
--with-boot-ldflags=FLAGS
linker flags for stage2 and later
--with-isl=PATH Specify prefix directory for the installed isl
- package. Equivalent to
- --with-isl-include=PATH/include plus
+ package. Equivalent to
+ --with-isl-include=PATH/include plus
--with-isl-lib=PATH/lib
--with-isl-include=PATH Specify directory for installed isl include files
--with-isl-lib=PATH Specify the directory for the installed isl library
--with-target-bdw-gc=PATHLIST
specify prefix directory for installed bdw-gc
- package. Equivalent to
- --with-target-bdw-gc-include=PATH/include plus
+ package. Equivalent to
+ --with-target-bdw-gc-include=PATH/include plus
--with-target-bdw-gc-lib=PATH/lib
--with-target-bdw-gc-include=PATHLIST
specify directories for installed bdw-gc include
@@ -3179,7 +3180,7 @@ fi
# Configure extra directories which are host specific

View File

@ -4,7 +4,7 @@ pkgname=gdb
pkgname=("gdb"
"gdb-multiarch")
pkgver=14.2
pkgrel=5
pkgrel=6
pkgdesc="GNU Debugger (MSYS2 version)"
arch=('i686' 'x86_64')
license=('spdx:GPL-3.0-or-later')
@ -30,32 +30,39 @@ options=('staticlibs' '!distcc' '!ccache')
source=("https://ftp.gnu.org/gnu/gdb/gdb-${pkgver}.tar.xz"{,.sig}
'gdbinit'
0001-Teach-gdb-how-to-unwind-cygwin-_sigbe-and-sigdelayed.patch
0002-7.8-windows-nat-cygwin.patch
0003-Better-handling-for-realpath-failures-in-windows_mak.patch
0002-Only-ignore-expected-Cygwin-OutputDebugStrings.patch
0003-Fix-potential-memory-leak-after-using-realpath-on-Cy.patch
0004-7.8-symtab-cygwin.patch
0005-msysize.patch
0006-autoreconf.patch)
0005-Drop-special-way-of-getting-inferior-context-after-a.patch
0006-Use-cygwin-pgid-if-inferior-is-a-cygwin-process.patch
1005-msysize.patch
1006-autoreconf.patch)
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3')
sha256sums=('2d4dd8061d8ded12b6c63f55e45344881e8226105f4d2a9b234040efa5ce7772'
'SKIP'
'2bbe7eddb1828c394d0ff99777058df79b1a596172603bb0e30d983fc1ea8785'
'c717af701b421e28dced2f424c1ba91bad37a25d8cd63561d02d3f48f003973a'
'5ef60706d31ee8d8839f7e38a8a3c22c3a84ef541ec884dfe42325a1433b0b5b'
'797860ab5dbac68f127589251906a63ede129fee678a5ce96e28decdc49004d3'
'a05c009801dc5c05fba94f40df31406b8ee6213ee45d54d54ef84218fb6e42e3'
'66cf6b5f9966dd39076ff06b36ecc049f4207abcb9860770d0feb4809495d151'
'f6a89039ba0f41020c0cf0aba868e6808cc19fd24f26f9c3d3fb46f13473efe9'
'15c7397d85b4f43ac22d5e81565de0d8d0a0b6473db2ab9a04fbb72f061fbf4e'
'06f96b9a455344d1cc85b202fb65450fe3097005d39a680cc7945a8178ea9976'
'268c35db936435f1d38c318956fffec14fd90f2bba085537cd5a44183f05a469'
'87a9ffcdc3d0c549efb390c7e59e86e9059ae29946fadcb269ee8b7578293483'
'9f349e441e0d2e10d78327c9a172ee99dfe69eaeb7024a0f370583b3043a47f2')
'5d462b9077543d2728c45b53e470b782a9ec45bf1743fc5ac7d7c4fca1d85668')
prepare() {
cd ${srcdir}/${pkgname}-${pkgver}
patch -p1 -i ${srcdir}/0005-msysize.patch
patch -p1 -i ${srcdir}/0006-autoreconf.patch
patch -p1 -i ${srcdir}/1005-msysize.patch
patch -p1 -i ${srcdir}/1006-autoreconf.patch
# from cygwin
patch -p1 -i ${srcdir}/0001-Teach-gdb-how-to-unwind-cygwin-_sigbe-and-sigdelayed.patch
patch -p1 -i ${srcdir}/0002-7.8-windows-nat-cygwin.patch
patch -p1 -i ${srcdir}/0003-Better-handling-for-realpath-failures-in-windows_mak.patch
patch -p1 -i ${srcdir}/0002-Only-ignore-expected-Cygwin-OutputDebugStrings.patch
patch -p1 -i ${srcdir}/0003-Fix-potential-memory-leak-after-using-realpath-on-Cy.patch
patch -p1 -i ${srcdir}/0004-7.8-symtab-cygwin.patch
patch -p1 -i ${srcdir}/0005-Drop-special-way-of-getting-inferior-context-after-a.patch
patch -p1 -i ${srcdir}/0006-Use-cygwin-pgid-if-inferior-is-a-cygwin-process.patch
}
do_build() {