pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/gdb devel/gdb: make this build on NetBSD/macppc.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0014ba9ae9fe
branches:  trunk
changeset: 389569:0014ba9ae9fe
user:      he <he%pkgsrc.org@localhost>
date:      Tue Dec 06 09:45:51 2022 +0000

description:
devel/gdb: make this build on NetBSD/macppc.

* Follow up struct member renames in callframe and stackframe.
* Import fixes to ppc-nbsd-tdep.c from our in-tree gdb.
* Fix up sim/ppc/emul_netbsd.c to use the versioned syscall names
  for gettimeofday and getrusage.

Bump PKGREVISION.

diffstat:

 devel/gdb/Makefile                             |   4 +-
 devel/gdb/distinfo                             |   6 ++-
 devel/gdb/patches/patch-gdb_ppc-nbsd-nat.c     |  37 +++++++++++++++++++
 devel/gdb/patches/patch-gdb_ppc-nbsd-tdep.c    |  49 ++++++++++++++++++++++++++
 devel/gdb/patches/patch-sim_ppc_emul__netbsd.c |  24 ++++++++++++
 5 files changed, 117 insertions(+), 3 deletions(-)

diffs (150 lines):

diff -r d1596ed5c9d9 -r 0014ba9ae9fe devel/gdb/Makefile
--- a/devel/gdb/Makefile        Tue Dec 06 08:54:36 2022 +0000
+++ b/devel/gdb/Makefile        Tue Dec 06 09:45:51 2022 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.78 2022/06/28 11:31:43 wiz Exp $
+# $NetBSD: Makefile,v 1.79 2022/12/06 09:45:51 he Exp $
 
 DISTNAME=      gdb-10.1
-PKGREVISION=   4
+PKGREVISION=   5
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GNU:=gdb/}
 
diff -r d1596ed5c9d9 -r 0014ba9ae9fe devel/gdb/distinfo
--- a/devel/gdb/distinfo        Tue Dec 06 08:54:36 2022 +0000
+++ b/devel/gdb/distinfo        Tue Dec 06 09:45:51 2022 +0000
@@ -1,6 +1,10 @@
-$NetBSD: distinfo,v 1.39 2021/10/26 10:14:40 nia Exp $
+$NetBSD: distinfo,v 1.40 2022/12/06 09:45:51 he Exp $
 
 BLAKE2s (gdb-10.1.tar.gz) = 441e0dde405c688ecea3c63f9f3ce4284d1f261b40b4f680f8ed868e6df49dad
 SHA512 (gdb-10.1.tar.gz) = 41b50955f82780a1935294669a14eca40e58574ad4aa6d476903b729605f09930e5bb651b4de0c49b948d65fdf521a4b7f22c5d3b1f83dd6c9a15957c9d52370
 Size (gdb-10.1.tar.gz) = 40245323 bytes
+SHA1 (patch-gdb_configure.nat) = 11b1ba9a482bca9d7dc6b543e1ea820eb7ebf193
 SHA1 (patch-gdb_doc_Makefile.in) = f7205fe715779e8aed05d230d43320286f74fdd0
+SHA1 (patch-gdb_ppc-nbsd-nat.c) = e5ffda09347140242e8c2f98da26bf6efe74ec4a
+SHA1 (patch-gdb_ppc-nbsd-tdep.c) = 65c35fdf6c7aecb1de4b4ae7d329fb4a5e51829c
+SHA1 (patch-sim_ppc_emul__netbsd.c) = e002283a52142fef74efd54e9a8b920b79838d1c
diff -r d1596ed5c9d9 -r 0014ba9ae9fe devel/gdb/patches/patch-gdb_ppc-nbsd-nat.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/gdb/patches/patch-gdb_ppc-nbsd-nat.c        Tue Dec 06 09:45:51 2022 +0000
@@ -0,0 +1,37 @@
+$NetBSD: patch-gdb_ppc-nbsd-nat.c,v 1.1 2022/12/06 09:45:51 he Exp $
+
+Use the updated / correct struct member names.
+
+--- gdb/ppc-nbsd-nat.c.orig    2020-10-24 04:23:02.000000000 +0000
++++ gdb/ppc-nbsd-nat.c
+@@ -167,19 +167,19 @@ ppcnbsd_supply_pcb (struct regcache *reg
+     return 0;
+ 
+   read_memory (pcb->pcb_sp, (gdb_byte *)&sf, sizeof sf);
+-  regcache->raw_supply (tdep->ppc_cr_regnum, &sf.cr);
+-  regcache->raw_supply (tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
++  regcache->raw_supply (tdep->ppc_cr_regnum, &sf.sf_cr);
++  regcache->raw_supply (tdep->ppc_gp0_regnum + 2, &sf.sf_fixreg2);
+   for (i = 0 ; i < 19 ; i++)
+-    regcache->raw_supply (tdep->ppc_gp0_regnum + 13 + i, &sf.fixreg[i]);
++    regcache->raw_supply (tdep->ppc_gp0_regnum + 13 + i, &sf.sf_fixreg[i]);
+ 
+-  read_memory(sf.sp, (gdb_byte *)&cf, sizeof(cf));
+-  regcache->raw_supply (tdep->ppc_gp0_regnum + 30, &cf.r30);
+-  regcache->raw_supply (tdep->ppc_gp0_regnum + 31, &cf.r31);
+-  regcache->raw_supply (tdep->ppc_gp0_regnum + 1, &cf.sp);
+-
+-  read_memory(cf.sp, (gdb_byte *)&cf, sizeof(cf));
+-  regcache->raw_supply (tdep->ppc_lr_regnum, &cf.lr);
+-  regcache->raw_supply (gdbarch_pc_regnum (gdbarch), &cf.lr);
++  read_memory(sf.sf_sp, (gdb_byte *)&cf, sizeof(cf));
++  regcache->raw_supply (tdep->ppc_gp0_regnum + 30, &cf.cf_r30);
++  regcache->raw_supply (tdep->ppc_gp0_regnum + 31, &cf.cf_r31);
++  regcache->raw_supply (tdep->ppc_gp0_regnum + 1, &cf.cf_sp);
++
++  read_memory(cf.cf_sp, (gdb_byte *)&cf, sizeof(cf));
++  regcache->raw_supply (tdep->ppc_lr_regnum, &cf.cf_lr);
++  regcache->raw_supply (gdbarch_pc_regnum (gdbarch), &cf.cf_lr);
+ 
+   return 1;
+ }
diff -r d1596ed5c9d9 -r 0014ba9ae9fe devel/gdb/patches/patch-gdb_ppc-nbsd-tdep.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/gdb/patches/patch-gdb_ppc-nbsd-tdep.c       Tue Dec 06 09:45:51 2022 +0000
@@ -0,0 +1,49 @@
+$NetBSD: patch-gdb_ppc-nbsd-tdep.c,v 1.1 2022/12/06 09:45:51 he Exp $
+
+Incorporate changes from r1.7 to r1.9 of in-tree gdb:
+
+1.9:
+PR port-powerpc/56899
+
+Disable 128-bit long double for NetBSD/powerpc.
+
+1.8:
+PR port-powerpc/56899
+
+In addition to ``powerpc'', register NetBSD OS ABI also for ``rs6000'',
+which is default target for powerpc.
+
+1.7:
+fix powerpc (by including ppc-nbsd-tdep.h)
+
+
+--- work/gdb-10.1/gdb/ppc-nbsd-tdep.c.orig     2020-10-24 04:23:02.000000000 +0000
++++ work/gdb-10.1/gdb/ppc-nbsd-tdep.c
+@@ -29,6 +29,7 @@
+ 
+ #include "ppc-tdep.h"
+ #include "nbsd-tdep.h"
++#include "ppc-nbsd-tdep.h"
+ #include "ppc-tdep.h"
+ #include "solib-svr4.h"
+ 
+@@ -176,6 +177,10 @@ ppcnbsd_init_abi (struct gdbarch_info in
+ {
+   nbsd_init_abi (info, gdbarch);
+ 
++  /* NetBSD doesn't support the 128-bit `long double' from the psABI.  */
++  set_gdbarch_long_double_bit (gdbarch, 64);
++  set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
++
+   /* For NetBSD, this is an on again, off again thing.  Some systems
+      do use the broken struct convention, and some don't.  */
+   set_gdbarch_return_value (gdbarch, ppcnbsd_return_value);
+@@ -197,6 +202,8 @@ _initialize_ppcnbsd_tdep ()
+ {
+   gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD,
+                         ppcnbsd_init_abi);
++  gdbarch_register_osabi (bfd_arch_rs6000, 0, GDB_OSABI_NETBSD,
++                        ppcnbsd_init_abi);
+ 
+   /* Avoid initializing the register offsets again if they were
+      already initialized by ppcnbsd-nat.c.  */
diff -r d1596ed5c9d9 -r 0014ba9ae9fe devel/gdb/patches/patch-sim_ppc_emul__netbsd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/gdb/patches/patch-sim_ppc_emul__netbsd.c    Tue Dec 06 09:45:51 2022 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-sim_ppc_emul__netbsd.c,v 1.1 2022/12/06 09:45:51 he Exp $
+
+Use the correctly named versioned syscalls.
+
+--- sim/ppc/emul_netbsd.c.orig 2020-10-24 04:23:02.000000000 +0000
++++ sim/ppc/emul_netbsd.c
+@@ -783,7 +783,7 @@ do_gettimeofday(os_emul_data *emul,
+   if (WITH_TRACE && ppc_trace[trace_os_emul])
+     printf_filtered ("0x%lx, 0x%lx", (long)t_addr, (long)tz_addr);
+ 
+-  SYS(gettimeofday);
++  SYS(__gettimeofday50);
+   emul_write_status(processor, status, err);
+   if (status == 0) {
+     if (t_addr != 0)
+@@ -813,7 +813,7 @@ do_getrusage(os_emul_data *emul,
+   if (WITH_TRACE && ppc_trace[trace_os_emul])
+     printf_filtered ("%d, 0x%lx", who, (long)rusage_addr);
+ 
+-  SYS(getrusage);
++  SYS(__getrusage50);
+   emul_write_status(processor, status, err);
+   if (status == 0) {
+     if (rusage_addr != 0)



Home | Main Index | Thread Index | Old Index