From 71d2211a1b0d9bccabb6c7d1b3d3aa62e3fccaa6 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 22 Nov 2018 10:38:02 +0000
Subject: [PATCH] main/gdb: upgrade to 8.2

---
 main/gdb/APKBUILD                           |  8 ++---
 main/gdb/s390x-use-elf-gdb_fpregset_t.patch | 36 +++++++++------------
 2 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/main/gdb/APKBUILD b/main/gdb/APKBUILD
index d586def2a876..5e179d049d3f 100644
--- a/main/gdb/APKBUILD
+++ b/main/gdb/APKBUILD
@@ -1,7 +1,7 @@
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=gdb
-pkgver=8.0.1
-pkgrel=6
+pkgver=8.2
+pkgrel=0
 pkgdesc="The GNU Debugger"
 url="https://www.sourceware.org/gdb/"
 arch="all"
@@ -59,7 +59,7 @@ package() {
 	rm -rf "$pkgdir"/usr/lib
 }
 
-sha512sums="5eb328910033f0918058be2f92caebf1e8dfc6caa3c730d99d621627e53de3c1b43761c2f683d53555893253c2f06768cbf56cdea051a3d291ffb6cfae87b5e1  gdb-8.0.1.tar.xz
-c3872eb51b3a42c5a33f8b7542c37fab7b0548560202e5eda740a2176cdfadff9bf73c6d26bceb225829dcb509c823acae2ccc796237ac97ebe552b82582bdf5  s390x-use-elf-gdb_fpregset_t.patch
+sha512sums="11cc481bebc51eb6db73249ecb62b8c07455cf3db169f4860b3a83114849fbd2b5860a2db64488ba6c5909cf07b255c04770f1e36059eae6bee16d2a3581be90  gdb-8.2.tar.xz
+70e7d04e4d72461436da503b5bfa370c5779e03245c521f30e9779d5ff37dbb2d708b05f2afb27f43ad9defc44df4bd979d72f777e744851fdbf156295e1cc9f  s390x-use-elf-gdb_fpregset_t.patch
 04911f87904b62dd7662435f9182b20485afb29ddb3d6398a9d31fef13495f7b70639c77fdae3a40e2775e270d7cd40d0cfd7ddf832372b506808d33c8301e01  ppc-musl.patch
 b75e1c1ee503a1948a7d5b8d90427b5c7d38ded69978056cee0adca222771a5c95ed1ac73127fcae7b795ea94296344eee5fca47e4cd04b418c164a756fb0933  ppc-ptregs.patch"
diff --git a/main/gdb/s390x-use-elf-gdb_fpregset_t.patch b/main/gdb/s390x-use-elf-gdb_fpregset_t.patch
index 2b3f318da725..669021f0cbce 100644
--- a/main/gdb/s390x-use-elf-gdb_fpregset_t.patch
+++ b/main/gdb/s390x-use-elf-gdb_fpregset_t.patch
@@ -12,14 +12,12 @@ gdb/ChangeLog:
 Credit to Andreas Arnez at IBM
 
 ---
- gdb/s390-linux-nat.c | 34 ++++++++++++++++++----------------
- 1 file changed, 18 insertions(+), 16 deletions(-)
 
 diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
-index 55a3899..84c304f 100644
+index 2c60562..c48a35a 100644
 --- a/gdb/s390-linux-nat.c
 +++ b/gdb/s390-linux-nat.c
-@@ -100,7 +100,7 @@ static const struct regset s390_64_gregset =
+@@ -153,7 +153,7 @@ static s390_linux_nat_target the_s390_linux_nat_target;
     make them look like 32-bit registers.  */
  
  void
@@ -27,8 +25,8 @@ index 55a3899..84c304f 100644
 +supply_gregset (struct regcache *regcache, const gdb_gregset_t *regp)
  {
  #ifdef __s390x__
-   struct gdbarch *gdbarch = get_regcache_arch (regcache);
-@@ -111,7 +111,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
+   struct gdbarch *gdbarch = regcache->arch ();
+@@ -164,7 +164,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
        gdb_byte buf[4];
  
        regcache_supply_regset (&s390_64_gregset, regcache, -1,
@@ -37,7 +35,7 @@ index 55a3899..84c304f 100644
        pswm = extract_unsigned_integer ((const gdb_byte *) regp
  				       + S390_PSWM_OFFSET, 8, byte_order);
        pswa = extract_unsigned_integer ((const gdb_byte *) regp
-@@ -126,7 +126,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
+@@ -179,7 +179,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
  #endif
  
    regcache_supply_regset (&s390_gregset, regcache, -1, regp,
@@ -46,16 +44,15 @@ index 55a3899..84c304f 100644
  }
  
  /* Fill register REGNO (if it is a general-purpose register) in
-@@ -134,14 +134,15 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
+@@ -187,14 +187,14 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
     do this for all registers.  */
  
  void
 -fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
-+fill_gregset (const struct regcache *regcache, gdb_gregset_t *regp,
-+	      int regno)
++fill_gregset (const struct regcache *regcache, gdb_gregset_t *regp, int regno)
  {
  #ifdef __s390x__
-   struct gdbarch *gdbarch = get_regcache_arch (regcache);
+   struct gdbarch *gdbarch = regcache->arch ();
    if (gdbarch_ptr_bit (gdbarch) == 32)
      {
        regcache_collect_regset (&s390_64_gregset, regcache, regno,
@@ -64,7 +61,7 @@ index 55a3899..84c304f 100644
  
        if (regno == -1
  	  || regno == S390_PSWM_REGNUM || regno == S390_PSWA_REGNUM)
-@@ -178,26 +179,27 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
+@@ -231,26 +231,27 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
  #endif
  
    regcache_collect_regset (&s390_gregset, regcache, regno, regp,
@@ -97,7 +94,7 @@ index 55a3899..84c304f 100644
  }
  
  /* Find the TID for the current inferior thread to use with ptrace.  */
-@@ -217,7 +219,7 @@ s390_inferior_tid (void)
+@@ -270,7 +271,7 @@ s390_inferior_tid (void)
  static void
  fetch_regs (struct regcache *regcache, int tid)
  {
@@ -106,7 +103,7 @@ index 55a3899..84c304f 100644
    ptrace_area parea;
  
    parea.len = sizeof (regs);
-@@ -226,7 +228,7 @@ fetch_regs (struct regcache *regcache, int tid)
+@@ -279,7 +280,7 @@ fetch_regs (struct regcache *regcache, int tid)
    if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
      perror_with_name (_("Couldn't get registers"));
  
@@ -115,7 +112,7 @@ index 55a3899..84c304f 100644
  }
  
  /* Store all valid general-purpose registers in GDB's register cache
-@@ -234,7 +236,7 @@ fetch_regs (struct regcache *regcache, int tid)
+@@ -287,7 +288,7 @@ fetch_regs (struct regcache *regcache, int tid)
  static void
  store_regs (const struct regcache *regcache, int tid, int regnum)
  {
@@ -124,7 +121,7 @@ index 55a3899..84c304f 100644
    ptrace_area parea;
  
    parea.len = sizeof (regs);
-@@ -254,7 +256,7 @@ store_regs (const struct regcache *regcache, int tid, int regnum)
+@@ -307,7 +308,7 @@ store_regs (const struct regcache *regcache, int tid, int regnum)
  static void
  fetch_fpregs (struct regcache *regcache, int tid)
  {
@@ -133,7 +130,7 @@ index 55a3899..84c304f 100644
    ptrace_area parea;
  
    parea.len = sizeof (fpregs);
-@@ -263,7 +265,7 @@ fetch_fpregs (struct regcache *regcache, int tid)
+@@ -316,7 +317,7 @@ fetch_fpregs (struct regcache *regcache, int tid)
    if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0)
      perror_with_name (_("Couldn't get floating point status"));
  
@@ -142,7 +139,7 @@ index 55a3899..84c304f 100644
  }
  
  /* Store all valid floating-point registers in GDB's register cache
-@@ -271,7 +273,7 @@ fetch_fpregs (struct regcache *regcache, int tid)
+@@ -324,7 +325,7 @@ fetch_fpregs (struct regcache *regcache, int tid)
  static void
  store_fpregs (const struct regcache *regcache, int tid, int regnum)
  {
@@ -151,6 +148,3 @@ index 55a3899..84c304f 100644
    ptrace_area parea;
  
    parea.len = sizeof (fpregs);
--- 
-1.8.5.6
-
-- 
GitLab