Merge pull request #2475 from orgads/gdb-10.2

gdb: Update to 10.2
This commit is contained in:
Christoph Reiter
2021-05-03 17:50:42 +02:00
committed by GitHub
8 changed files with 875 additions and 1098 deletions

View File

@@ -1,4 +1,4 @@
From 555f6ed2b933288a8c61417792ba407be667d502 Mon Sep 17 00:00:00 2001
From 1822f7cf064bc795a31e8eeb736e48593abb5af2 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Tue, 12 Jan 2016 22:49:09 +0000
Subject: [PATCH 1/5] Teach gdb how to unwind cygwin _sigbe and sigdelayed
@@ -40,20 +40,21 @@ as we unwind the stack.
[1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/gendef
[2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/how-signals-work.txt
---
gdb/amd64-windows-tdep.c | 57 ++++++++++++
gdb/i386-cygwin-tdep.c | 28 ++++++
gdb/windows-tdep.c | 237 +++++++++++++++++++++++++++++++++++++++++++++++
gdb/windows-tdep.h | 21 +++++
4 files changed, 343 insertions(+)
gdb/amd64-windows-tdep.c | 57 +++++++++-
gdb/i386-windows-tdep.c | 28 +++++
gdb/windows-tdep.c | 237 +++++++++++++++++++++++++++++++++++++++
gdb/windows-tdep.h | 20 ++++
4 files changed, 341 insertions(+), 1 deletion(-)
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index 1a033365a9..6c6a66b9ca 100644
index 3f9cbebc5d3..130d421be7e 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -1206,9 +1206,66 @@ amd64_windows_auto_wide_charset (void)
@@ -1208,11 +1208,66 @@ amd64_windows_auto_wide_charset (void)
return "UTF-16";
}
-/* Common parts for gdbarch initialization for Windows and Cygwin on AMD64. */
+static const struct insn_pattern amd64_sigbe_bytes[] = {
+ /* movq $-8,%r11 */
+ { 0x49, 0xff },
@@ -106,9 +107,9 @@ index 1a033365a9..6c6a66b9ca 100644
+ {
+ amd64_sigdelayed_bytes, COUNT(amd64_sigdelayed_bytes)
+ };
+
static void
amd64_windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_windows_init_abi_common (gdbarch_info info, struct gdbarch *gdbarch)
{
+
+ cygwin_sigwrapper_frame_unwind_set_sigbe_pattern (&amd64_sigbe);
@@ -116,12 +117,12 @@ index 1a033365a9..6c6a66b9ca 100644
+ frame_unwind_append_unwinder (gdbarch, &cygwin_sigwrapper_frame_unwind);
/* The dwarf2 unwinder (appended very early by i386_gdbarch_init) is
preferred over the SEH one. The reasons are:
- binaries without SEH but with dwarf2 debug info are correcly handled
diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c
index f200d39f2d..9ccec6556f 100644
--- a/gdb/i386-cygwin-tdep.c
+++ b/gdb/i386-cygwin-tdep.c
@@ -26,6 +26,7 @@
- binaries without SEH but with dwarf2 debug info are correctly handled
diff --git a/gdb/i386-windows-tdep.c b/gdb/i386-windows-tdep.c
index 4ffaa4562b5..26132f0a800 100644
--- a/gdb/i386-windows-tdep.c
+++ b/gdb/i386-windows-tdep.c
@@ -27,6 +27,7 @@
#include "xml-support.h"
#include "gdbcore.h"
#include "inferior.h"
@@ -129,7 +130,7 @@ index f200d39f2d..9ccec6556f 100644
/* Core file support. */
@@ -204,11 +205,38 @@ i386_cygwin_auto_wide_charset (void)
@@ -199,6 +200,30 @@ i386_windows_auto_wide_charset (void)
return "UTF-16";
}
@@ -157,19 +158,21 @@ index f200d39f2d..9ccec6556f 100644
+ i386_sigbe_bytes, COUNT(i386_sigbe_bytes)
+ };
+
static void
i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* Implement the "push_dummy_call" gdbarch method. */
static CORE_ADDR
@@ -236,6 +261,9 @@ i386_windows_init_abi_common (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ cygwin_sigwrapper_frame_unwind_set_sigbe_pattern (&i386_sigbe);
+ frame_unwind_append_unwinder (gdbarch, &cygwin_sigwrapper_frame_unwind);
+
windows_init_abi (info, gdbarch);
set_gdbarch_skip_trampoline_code (gdbarch, i386_windows_skip_trampoline_code);
set_gdbarch_skip_trampoline_code (gdbarch, i386_cygwin_skip_trampoline_code);
set_gdbarch_skip_main_prologue (gdbarch, i386_skip_main_prologue);
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index e77996f797..3e035ec765 100644
index 019d4d18b64..a2c7a1efa97 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -33,6 +33,7 @@
@@ -178,9 +181,9 @@ index e77996f797..3e035ec765 100644
#include "solib-target.h"
+#include "frame-unwind.h"
#include "gdbcore.h"
struct cmd_list_element *info_w32_cmdlist;
@@ -518,3 +519,239 @@ even if their meaning is unknown."),
#include "coff/internal.h"
#include "libcoff.h"
@@ -1120,3 +1121,239 @@ even if their meaning is unknown."),
isn't another convenience variable of the same name. */
create_internalvar_type_lazy ("_tlb", &tlb_funcs, NULL);
}
@@ -421,14 +424,13 @@ index e77996f797..3e035ec765 100644
+ &cygwin_sigwrapper_frame_sniffer
+};
diff --git a/gdb/windows-tdep.h b/gdb/windows-tdep.h
index 38242cfd22..51ed98bbcf 100644
index 00ae7a6258e..9c2efcc0516 100644
--- a/gdb/windows-tdep.h
+++ b/gdb/windows-tdep.h
@@ -32,4 +32,25 @@ extern void windows_xfer_shared_library (const char* so_name,
@@ -48,4 +48,24 @@ extern void cygwin_init_abi (struct gdbarch_info info,
extern bool is_linked_with_cygwin_dll (bfd *abfd);
extern void windows_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch);
+
+extern const struct frame_unwind cygwin_sigwrapper_frame_unwind;
+
+/* An instruction to match. */
@@ -451,5 +453,5 @@ index 38242cfd22..51ed98bbcf 100644
+
#endif
--
2.14.2
2.31.1.windows.1

View File

@@ -1,7 +1,7 @@
From ef91df5ca767096015bedd6a81ef1008161d96d2 Mon Sep 17 00:00:00 2001
From 78a3fc32338171cb791512076e3696e62d08c33a 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/5] 7.8-windows-nat-cygwin.patch
Subject: [PATCH 2/5] 7.8-windows-nat-cygwin
Remaining parts of 7.8-windows-nat-cygwin.patch not yet upstream.
@@ -36,14 +36,14 @@ 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 | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
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 3add8e63f9..0e366c3162 100644
index 108e1e32edc..a0faa058be7 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -154,8 +154,7 @@ static GetConsoleFontSize_ftype *GetConsoleFontSize;
@@ -176,8 +176,7 @@ static Wow64GetThreadSelectorEntry_ftype *Wow64GetThreadSelectorEntry;
# define bad_GetModuleFileNameEx bad_GetModuleFileNameExW
#endif
@@ -51,19 +51,18 @@ index 3add8e63f9..0e366c3162 100644
- cygwin signal. */
+static DWORD signal_thread_id; /* Non-zero if we saved context. */
#ifdef __CYGWIN__
static CONTEXT saved_context; /* Containes the saved context from a
static CONTEXT saved_context; /* Contains the saved context from a
cygwin signal. */
@@ -403,7 +402,8 @@ thread_rec (DWORD id, int get_context)
{
if (!th->suspended && get_context)
{
- if (get_context > 0 && id != current_event.dwThreadId)
+ if (get_context > 0 && id != current_event.dwThreadId
+ && id != signal_thread_id)
{
if (SuspendThread (th->h) == (DWORD) -1)
{
@@ -612,7 +612,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
@@ -403,7 +402,7 @@ windows_nat::thread_rec (ptid_t ptid, thread_disposition_type disposition)
/* 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;
@@ -644,7 +643,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
if (th->reload_context)
{
#ifdef __CYGWIN__
@@ -72,7 +71,7 @@ index 3add8e63f9..0e366c3162 100644
{
/* Lie about where the program actually is stopped since
cygwin has informed us that we should consider the signal
@@ -620,7 +620,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
@@ -652,7 +651,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
"saved_context. */
memcpy (&th->context, &saved_context,
__COPY_CONTEXT_SIZE);
@@ -81,7 +80,7 @@ index 3add8e63f9..0e366c3162 100644
}
else
#endif
@@ -1007,7 +1007,11 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
@@ -997,7 +996,11 @@ windows_nat::handle_output_debug_string (struct target_waitstatus *ourstatus)
else if (!startswith (s.get (), _CYGWIN_SIGNAL_STRING))
{
#ifdef __CYGWIN__
@@ -94,7 +93,7 @@ index 3add8e63f9..0e366c3162 100644
#endif
{
char *p = strchr (s.get (), '\0');
@@ -1046,7 +1050,12 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
@@ -1036,7 +1039,12 @@ windows_nat::handle_output_debug_string (struct target_waitstatus *ourstatus)
&saved_context,
__COPY_CONTEXT_SIZE, &n)
&& n == __COPY_CONTEXT_SIZE)
@@ -108,15 +107,15 @@ index 3add8e63f9..0e366c3162 100644
}
}
#endif
@@ -1563,7 +1572,6 @@ get_windows_debug_event (struct target_ops *ops,
@@ -1563,7 +1571,6 @@ windows_nat_target::get_windows_debug_event (int pid,
event_code = current_event.dwDebugEventCode;
ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
th = NULL;
- have_saved_context = 0;
switch (event_code)
{
@@ -1736,7 +1744,7 @@ get_windows_debug_event (struct target_ops *ops,
@@ -1765,7 +1772,7 @@ windows_nat_target::get_windows_debug_event (int pid,
}
out:
@@ -125,15 +124,6 @@ index 3add8e63f9..0e366c3162 100644
}
/* Wait for interesting events to occur in the target process. */
@@ -3041,7 +3049,7 @@ windows_nat_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
{
windows_thread_info *th;
- th = thread_rec (ptid.tid (), 0);
+ th = thread_rec (ptid.tid (), FALSE);
if (th == NULL)
return false;
--
2.21.0
2.31.1.windows.1

View File

@@ -1,4 +1,4 @@
From 814d76c4c887b9fd920ee655da79fce7c58b5398 Mon Sep 17 00:00:00 2001
From 4e5eaa702d02a7c6170f2d534b323996f1afe06c 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/5] Better handling for realpath() failures in
@@ -14,14 +14,14 @@ 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 | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
gdb/windows-nat.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 69b9559605..3bd191aa96 100644
index a0faa058be7..8329e3d0235 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -643,13 +643,22 @@ windows_make_so (const char *name, LPVOID load_addr)
@@ -817,9 +817,15 @@ windows_make_so (const char *name, LPVOID load_addr)
else
{
char *rname = realpath (name, NULL);
@@ -39,14 +39,6 @@ index 69b9559605..3bd191aa96 100644
free (rname);
}
else
- error (_("dll path too long"));
+ {
+ warning (_("dll path for \"%s\" can not be evaluated"), name);
+ strcpy (so->so_name, so->so_original_name);
+ }
}
/* Record cygwin1.dll .text start/end. */
p = strchr (so->so_name, '\0') - (sizeof ("/cygwin1.dll") - 1);
--
2.14.2
2.31.1.windows.1

View File

@@ -1,7 +1,7 @@
From e9c7d4386fb7ce9bff02c249a2473e1d639080b9 Mon Sep 17 00:00:00 2001
From 0114ce5b4d8383abc6bbfa034c92ee9a29cb7e2c 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/5] 7.8-symtab-cygwin.patch
Subject: [PATCH 4/5] 7.8-symtab-cygwin
See https://sourceware.org/ml/gdb-patches/2002-03/msg00557.html
---
@@ -9,10 +9,10 @@ See https://sourceware.org/ml/gdb-patches/2002-03/msg00557.html
1 file changed, 37 insertions(+)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index a897a6a29a7..689c1803bbb 100644
index b519499f262..a051f4a7ea4 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -810,6 +810,10 @@ create_demangled_names_hash (struct objfile_per_bfd_storage *per_bfd)
@@ -791,6 +791,10 @@ create_demangled_names_hash (struct objfile_per_bfd_storage *per_bfd)
free_demangled_name_entry, xcalloc, xfree));
}
@@ -23,7 +23,7 @@ index a897a6a29a7..689c1803bbb 100644
/* See symtab.h */
char *
@@ -819,6 +823,39 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
@@ -800,6 +804,39 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
char *demangled = NULL;
int i;
@@ -60,9 +60,9 @@ index a897a6a29a7..689c1803bbb 100644
+ }
+ }
+
if (gsymbol->language == language_unknown)
gsymbol->language = language_auto;
if (gsymbol->language () == language_unknown)
gsymbol->m_language = language_auto;
--
2.21.0
2.31.1.windows.1

View File

@@ -1,25 +0,0 @@
From f9bbaaab6e48d670d2c854479f96b12d6d19d1e7 Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Sun, 29 Dec 2019 22:26:41 +0000
Subject: [PATCH 5/5] Enable CLI styling by default on Cygwin
---
gdb/cli/cli-style.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index 7e20c1b4826..f3d98ae4091 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -25,7 +25,7 @@
/* True if styling is enabled. */
-#if defined (__MSDOS__) || defined (__CYGWIN__)
+#if defined (__MSDOS__)
bool cli_styling = false;
#else
bool cli_styling = true;
--
2.21.0

File diff suppressed because it is too large Load Diff

View File

@@ -1,103 +0,0 @@
From de63ee3bb106cfc54a7155ebc3ba7b656209e8ad Mon Sep 17 00:00:00 2001
From: Jon Turney <jon.turney@dronecode.org.uk>
Date: Mon, 6 Jan 2020 18:11:38 +0000
Subject: [PATCH 6/6] Move thread_local_segv_handler definition
Move thread_local_segv_handler definition, to work around a problem on
Cygwin/x86_64 with referencing thread_local variables from a different
TU.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64697
---
gdb/cp-support.c | 17 +++++++++++++++++
gdb/event-top.c | 19 +------------------
gdb/event-top.h | 8 +++-----
3 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index c1d62f1711e..e69012b25d0 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1485,6 +1485,23 @@ static thread_local SIGJMP_BUF *gdb_demangle_jmp_buf;
static std::atomic<bool> gdb_demangle_attempt_core_dump;
+/* The SIGSEGV handler for this thread, or NULL if there is none. GDB
+ always installs a global SIGSEGV handler, and then lets threads
+ indicate their interest in handling the signal by setting this
+ thread-local variable. */
+
+thread_local void (*thread_local_segv_handler) (int);
+
+void
+handle_sigsegv (int sig)
+{
+ install_handle_sigsegv ();
+
+ if (thread_local_segv_handler == nullptr)
+ abort (); /* ARI: abort */
+ thread_local_segv_handler (sig);
+}
+
/* Signal handler for gdb_demangle. */
static void
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 8ac6965f388..9e501ea7152 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -847,15 +847,8 @@ gdb_readline_no_editing_callback (gdb_client_data client_data)
ui->input_handler (gdb::unique_xmalloc_ptr<char> (result));
}
-
-/* See event-top.h. */
-
-thread_local void (*thread_local_segv_handler) (int);
-
-static void handle_sigsegv (int sig);
-
/* Install the SIGSEGV handler. */
-static void
+void
install_handle_sigsegv ()
{
#if defined (HAVE_SIGACTION)
@@ -875,16 +868,6 @@ install_handle_sigsegv ()
/* Handler for SIGSEGV. */
-static void
-handle_sigsegv (int sig)
-{
- install_handle_sigsegv ();
-
- if (thread_local_segv_handler == nullptr)
- abort ();
- thread_local_segv_handler (sig);
-}
-
/* The serial event associated with the QUIT flag. set_quit_flag sets
diff --git a/gdb/event-top.h b/gdb/event-top.h
index f858626dd53..f0c9a4f8b0f 100644
--- a/gdb/event-top.h
+++ b/gdb/event-top.h
@@ -70,10 +70,8 @@ extern void gdb_rl_callback_handler_install (const char *prompt);
currently installed. */
extern void gdb_rl_callback_handler_reinstall (void);
-/* The SIGSEGV handler for this thread, or NULL if there is none. GDB
- always installs a global SIGSEGV handler, and then lets threads
- indicate their interest in handling the signal by setting this
- thread-local variable. */
-extern thread_local void (*thread_local_segv_handler) (int);
+void handle_sigsegv (int sig);
+
+void install_handle_sigsegv ();
#endif
--
2.21.0

View File

@@ -1,15 +1,15 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=gdb
pkgver=9.2
pkgrel=3
_gcc_ver=9.3.0
pkgver=10.2
pkgrel=1
_gcc_ver=10.2.0
pkgdesc="GNU Debugger (MSYS2 version)"
arch=('i686' 'x86_64')
license=('GPL3')
url="https://www.gnu.org/software/gdb/"
groups=('base-devel')
depends=("libiconv" "zlib" "expat" "python" "libexpat" "libreadline" "mpfr")
depends=("libiconv" "zlib" "expat" "python" "libexpat" "libreadline" "mpfr" "xxhash")
#checkdepends=('dejagnu' 'bc')
makedepends=("libiconv-devel" "zlib-devel" "ncurses-devel" "liblzma-devel" "mpfr-devel" "libexpat-devel" "libreadline-devel" "python-devel")
options=('staticlibs' '!distcc' '!ccache')
@@ -19,20 +19,16 @@ source=("https://ftp.gnu.org/gnu/gdb/gdb-${pkgver}.tar.xz"{,.sig}
0002-7.8-windows-nat-cygwin.patch
0003-Better-handling-for-realpath-failures-in-windows_mak.patch
0004-7.8-symtab-cygwin.patch
0005-Enable-CLI-styling-by-default-on-Cygwin.patch
0006-Move-thread_local_segv_handler-definition.patch
'gdb-9.1-msysize.patch')
0005-msysize.patch)
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3')
sha256sums=('360cd7ae79b776988e89d8f9a01c985d0b1fa21c767a4295e5f88cb49175c555'
sha256sums=('aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29'
'SKIP'
'2bbe7eddb1828c394d0ff99777058df79b1a596172603bb0e30d983fc1ea8785'
'2bdd02d6dc46d1186a3fa4485922d277686ca9ff827dde6b9fa1a90e9345c953'
'295fa28ad89e7e8bde2dd846644e3a9dc92485c4b87c6d17244fb02b19e09ccb'
'91994d62047bb76688a785c9a911f8deda6e7b7aa258aade0a6b29904a9e9b58'
'6d368418cb7654d7054996b4bc3d7a24ef440028fd1007b204b1429aa7e97b11'
'2156ad9e4b0ab528ec7ed4edf36ac2cbb6ef3092c71964edba16560d62a79878'
'aac0a21993be88a5414e231ead1a81b318e821869bccb73dd863dc5aab357769'
'85d6e7f728f103b6e87ad7fc240ed5e31469bedff7a05e361462b433344b1338')
'bebb9adc23867939e4fb04639ef0da4c63aa09faad221f20c1d5fc810317f198'
'cbb6162bb222161906f1425e76f630b724bdfe807d11748803e887e2f6ec3b13'
'cdf8e29386848652069754d95089c6fd3f93cad939a8eed6e6a9875550eac3e0'
'caa97f691e22e10c0b57251f31ca79a17a25bb77a351dbb80ec47a95fa577d49'
'cd13a9b84472399e2ae41efc74e9cc0c85bad0d8769a76ab1ea769e8de7e83d2')
prepare() {
cd ${srcdir}/${pkgname}-${pkgver}
@@ -41,9 +37,7 @@ prepare() {
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}/0004-7.8-symtab-cygwin.patch
patch -p1 -i ${srcdir}/0005-Enable-CLI-styling-by-default-on-Cygwin.patch
patch -p1 -i ${srcdir}/0006-Move-thread_local_segv_handler-definition.patch
patch -p1 -i ${srcdir}/gdb-9.1-msysize.patch
patch -p1 -i ${srcdir}/0005-msysize.patch
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure