summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaya <maya@pkgsrc.org>2017-06-05 10:41:28 +0000
committermaya <maya@pkgsrc.org>2017-06-05 10:41:28 +0000
commitf9363e11929da72c52fb40a8f0ac12ac82b5418a (patch)
tree7be1807eb347b0f559348aa424c9afca17d0f98e
parent5320258e192ae4c47efd93193024637fa21548bb (diff)
downloadpkgsrc-f9363e11929da72c52fb40a8f0ac12ac82b5418a.tar.gz
Add gdb7. it's currently identical to devel/gdb, but not for long.
-rw-r--r--devel/gdb7/DESCR17
-rw-r--r--devel/gdb7/Makefile81
-rw-r--r--devel/gdb7/PLIST.DragonFly3
-rw-r--r--devel/gdb7/PLIST.Linux5
-rw-r--r--devel/gdb7/PLIST.SunOS3
-rw-r--r--devel/gdb7/PLIST.common47
-rw-r--r--devel/gdb7/distinfo13
-rw-r--r--devel/gdb7/options.mk13
-rw-r--r--devel/gdb7/patches/patch-Makefile.in32
-rw-r--r--devel/gdb7/patches/patch-ao16
-rw-r--r--devel/gdb7/patches/patch-gdb_amd64bsd-nat.c15
-rw-r--r--devel/gdb7/patches/patch-gdb_bsd-kvm.c33
-rw-r--r--devel/gdb7/patches/patch-gdb_ppcnbsd-nat.c38
-rw-r--r--devel/gdb7/patches/patch-opcodes_i386-dis_c13
-rw-r--r--devel/gdb7/patches/patch-sim_ppc_emul_netbsd.c39
15 files changed, 368 insertions, 0 deletions
diff --git a/devel/gdb7/DESCR b/devel/gdb7/DESCR
new file mode 100644
index 00000000000..c7c22076938
--- /dev/null
+++ b/devel/gdb7/DESCR
@@ -0,0 +1,17 @@
+ The purpose of a debugger such as GDB is to allow you to see what
+is going on "inside" another program while it executes--or what
+another program was doing at the moment it crashed.
+
+ GDB can do four main kinds of things (plus other things in support
+of these) to help you catch bugs in the act:
+
+ * Start your program, specifying anything that might affect its
+ behavior.
+
+ * Make your program stop on specified conditions.
+
+ * Examine what has happened, when your program has stopped.
+
+ * Change things in your program, so you can experiment with
+ correcting the effects of one bug and go on to learn about
+ another.
diff --git a/devel/gdb7/Makefile b/devel/gdb7/Makefile
new file mode 100644
index 00000000000..ec68012d0c2
--- /dev/null
+++ b/devel/gdb7/Makefile
@@ -0,0 +1,81 @@
+# $NetBSD: Makefile,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+DISTNAME= gdb-7.11
+PKGREVISION= 3
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GNU:=gdb/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.gnu.org/software/gdb/gdb.html
+COMMENT= Symbolic debugger for multiple language frontends
+LICENSE= gnu-gpl-v3
+
+BROKEN_GETTEXT_DETECTION= yes
+GNU_CONFIGURE= YES
+USE_PKGLOCALEDIR= YES
+USE_LIBTOOL= YES
+USE_TOOLS+= gmake msgfmt makeinfo perl:build
+REPLACE_LOCALEDIR_PATTERNS+= Make-in
+INSTALL_TARGET= install install-info
+TEST_TARGET= check
+INFO_FILES= yes
+CONFIGURE_ENV+= CONFIG_LDFLAGS=${LDFLAGS:M*:Q}
+
+# In gdb/configure, depcomp is parsed with sed.
+SUBST_CLASSES+= fix-depcomp
+SUBST_STAGE.fix-depcomp+= pre-configure
+SUBST_MESSAGE.fix-depcomp+= Read depcomp directly
+SUBST_FILES.fix-depcomp+= gdb/configure
+SUBST_SED.fix-depcomp+= -e 's,< ./depcomp,${_OVERRIDE_PATH.depcomp},'
+
+AUTO_MKDIRS= yes
+
+.include "options.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+# Work around a bug in gdb's configure
+CONFIGURE_ENV+= ac_cv_header_curses_h=yes
+.elif ${OPSYS} == "NetBSD"
+.include "../../mk/curses.buildlink3.mk"
+CONFIGURE_ARGS+= -with-curses
+CONFIGURE_ENV+= gdb_cv_var_elf=yes
+MAKE_ENV+= gdb_cv_var_elf=yes
+CONFIGURE_ENV+= gdb_cv_struct_lwp=yes
+MAKE_ENV+= gdb_cv_struct_lwp=yes
+
+.elif ${OPSYS} == "DragonFly"
+TARGET_STR= ${MACHINE_ARCH}--dragonfly
+BUILD_DEFS+= ${TARGET_STR}
+## Remove "-pc" string, without this, getting following message:
+## *** Gdb does not support native target i386-pc-dragonfly"
+CONFIGURE_ARGS+= --target=${TARGET_STR}
+TEST_ENV= DEJAGNU=${WRKDIR}/../files/dragonfly-default.exp
+.endif
+
+post-install:
+.if ${OPSYS} == "DragonFly"
+# Following are installed by binutils
+#. for f in ansidecl.h bfdlink.h dis-asm.h symcat.h
+# (cd ${WRKSRC}/include; ${INSTALL_DATA} ${f} ${DESTDIR}${PREFIX}/include)
+#. endfor
+ (cd ${DESTDIR}${PREFIX}/bin; ${LN} ${TARGET_STR}-gdb gdb)
+ (cd ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; ${LN} ${TARGET_STR}-gdb.1 gdb.1)
+.endif
+#
+# PATH of libiberty.a differs between clang and gcc: (and conflicts to other toolchain)
+# Rename to avoid conflict to native and other toolchain
+# and clang differs its path so, (the same as avr-binutils).
+
+ (cd ${DESTDIR}${PREFIX}; \
+ for d in ${MACHINE_ARCH}/libiberty.a libiberty.a; \
+ do if [ -f lib/$$d ]; then \
+ ${MV} lib/$$d lib/gdb/libiberty.a; \
+ break; \
+ fi; \
+ done; )
+
+.include "../../mk/termcap.buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/gdb7/PLIST.DragonFly b/devel/gdb7/PLIST.DragonFly
new file mode 100644
index 00000000000..46a858e029c
--- /dev/null
+++ b/devel/gdb7/PLIST.DragonFly
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.DragonFly,v 1.1 2017/06/05 10:41:28 maya Exp $
+bin/i386--dragonfly-gdb
+man/man1/i386--dragonfly-gdb.1
diff --git a/devel/gdb7/PLIST.Linux b/devel/gdb7/PLIST.Linux
new file mode 100644
index 00000000000..5ca6f07d588
--- /dev/null
+++ b/devel/gdb7/PLIST.Linux
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST.Linux,v 1.1 2017/06/05 10:41:28 maya Exp $
+bin/gdbserver
+bin/gcore
+lib/libinproctrace.so
+man/man1/gcore.1
diff --git a/devel/gdb7/PLIST.SunOS b/devel/gdb7/PLIST.SunOS
new file mode 100644
index 00000000000..99a78ffc97a
--- /dev/null
+++ b/devel/gdb7/PLIST.SunOS
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST.SunOS,v 1.1 2017/06/05 10:41:28 maya Exp $
+bin/gcore
+man/man1/gcore.1
diff --git a/devel/gdb7/PLIST.common b/devel/gdb7/PLIST.common
new file mode 100644
index 00000000000..a9efa34e7c4
--- /dev/null
+++ b/devel/gdb7/PLIST.common
@@ -0,0 +1,47 @@
+@comment $NetBSD: PLIST.common,v 1.1 2017/06/05 10:41:28 maya Exp $
+bin/gdb
+include/gdb/jit-reader.h
+info/annotate.info
+info/gdb.info
+info/stabs.info
+man/man1/gdb.1
+man/man1/gdbserver.1
+man/man5/gdbinit.5
+share/gdb/python/gdb/FrameDecorator.py
+share/gdb/python/gdb/FrameIterator.py
+share/gdb/python/gdb/__init__.py
+share/gdb/python/gdb/command/__init__.py
+share/gdb/python/gdb/command/explore.py
+share/gdb/python/gdb/command/frame_filters.py
+share/gdb/python/gdb/command/pretty_printers.py
+share/gdb/python/gdb/command/prompt.py
+share/gdb/python/gdb/command/type_printers.py
+share/gdb/python/gdb/command/unwinders.py
+share/gdb/python/gdb/command/xmethods.py
+share/gdb/python/gdb/frames.py
+share/gdb/python/gdb/function/__init__.py
+share/gdb/python/gdb/function/caller_is.py
+share/gdb/python/gdb/function/strfns.py
+share/gdb/python/gdb/printer/__init__.py
+share/gdb/python/gdb/printer/bound_registers.py
+share/gdb/python/gdb/printing.py
+share/gdb/python/gdb/prompt.py
+share/gdb/python/gdb/types.py
+share/gdb/python/gdb/unwinder.py
+share/gdb/python/gdb/xmethod.py
+share/gdb/syscalls/aarch64-linux.xml
+share/gdb/syscalls/amd64-linux.xml
+share/gdb/syscalls/arm-linux.xml
+share/gdb/syscalls/gdb-syscalls.dtd
+share/gdb/syscalls/i386-linux.xml
+share/gdb/syscalls/mips-n32-linux.xml
+share/gdb/syscalls/mips-n64-linux.xml
+share/gdb/syscalls/mips-o32-linux.xml
+share/gdb/syscalls/ppc-linux.xml
+share/gdb/syscalls/ppc64-linux.xml
+share/gdb/syscalls/s390-linux.xml
+share/gdb/syscalls/s390x-linux.xml
+share/gdb/syscalls/sparc-linux.xml
+share/gdb/syscalls/sparc64-linux.xml
+share/gdb/system-gdbinit/elinos.py
+share/gdb/system-gdbinit/wrs-linux.py
diff --git a/devel/gdb7/distinfo b/devel/gdb7/distinfo
new file mode 100644
index 00000000000..f55e4e9b02f
--- /dev/null
+++ b/devel/gdb7/distinfo
@@ -0,0 +1,13 @@
+$NetBSD: distinfo,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+SHA1 (gdb-7.11.tar.gz) = 99f5795cf670e00a623266cb4ce59cc76ec6e5a2
+RMD160 (gdb-7.11.tar.gz) = 9181c3a79dc676d36e58162567051cf9f68d354d
+SHA512 (gdb-7.11.tar.gz) = 6854774bba73ecf02c4d8bb4e194b8fd8fd3c6c661cbead0b3b816b9d9f736df1b85f331a669808700b0ad0f945b58483fffb77d49f5b690e828a00f65c04893
+Size (gdb-7.11.tar.gz) = 35215975 bytes
+SHA1 (patch-Makefile.in) = 48f65798f96fdda2a35eb8b18a7cc2993023bcc7
+SHA1 (patch-ao) = fe55dc7245f438fccb7965ceb220be951f85a535
+SHA1 (patch-gdb_amd64bsd-nat.c) = ce3a52c090bb83b91e87d0fff301ddb2eb2d3dfb
+SHA1 (patch-gdb_bsd-kvm.c) = 837614b107181f79fd5c018ebd76a9010e5ab602
+SHA1 (patch-gdb_ppcnbsd-nat.c) = 94c9f552fd00e3641e7a0fa8372de538b4571d0b
+SHA1 (patch-opcodes_i386-dis_c) = 57b2b2ce85567faf112ec9f435b9aed0ffc943fb
+SHA1 (patch-sim_ppc_emul_netbsd.c) = 34fcb884c3c82e8eae6cd6f8c87ce42e9354c347
diff --git a/devel/gdb7/options.mk b/devel/gdb7/options.mk
new file mode 100644
index 00000000000..0f2f3e4cbec
--- /dev/null
+++ b/devel/gdb7/options.mk
@@ -0,0 +1,13 @@
+# $NetBSD: options.mk,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.gdb
+PKG_SUPPORTED_OPTIONS= python
+PKG_SUGGESTED_OPTIONS= python
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mpython)
+CONFIGURE_ARGS+= --with-python=${PYTHONBIN}
+PYTHON_VERSIONS_INCOMPATIBLE= 34 35 36
+.include "../../lang/python/application.mk"
+.endif
diff --git a/devel/gdb7/patches/patch-Makefile.in b/devel/gdb7/patches/patch-Makefile.in
new file mode 100644
index 00000000000..3382b09a3ad
--- /dev/null
+++ b/devel/gdb7/patches/patch-Makefile.in
@@ -0,0 +1,32 @@
+$NetBSD: patch-Makefile.in,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+Do not install bfd and opcodes. Conflicts with devel/binutils.
+
+--- Makefile.in.orig 2016-02-24 09:57:08.000000000 +0000
++++ Makefile.in
+@@ -1596,7 +1596,6 @@ do-install-info:
+
+ .PHONY: install-info-host
+
+-install-info-host: maybe-install-info-bfd
+ install-info-host: maybe-install-info-opcodes
+ install-info-host: maybe-install-info-binutils
+ install-info-host: maybe-install-info-bison
+@@ -2482,8 +2481,6 @@ install:
+
+ .PHONY: install-host-nogcc
+ install-host-nogcc: \
+- maybe-install-bfd \
+- maybe-install-opcodes \
+ maybe-install-binutils \
+ maybe-install-bison \
+ maybe-install-cgen \
+@@ -2530,8 +2527,6 @@ install-host-nogcc: \
+
+ .PHONY: install-host
+ install-host: \
+- maybe-install-bfd \
+- maybe-install-opcodes \
+ maybe-install-binutils \
+ maybe-install-bison \
+ maybe-install-cgen \
diff --git a/devel/gdb7/patches/patch-ao b/devel/gdb7/patches/patch-ao
new file mode 100644
index 00000000000..0331609b1e0
--- /dev/null
+++ b/devel/gdb7/patches/patch-ao
@@ -0,0 +1,16 @@
+$NetBSD: patch-ao,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+Avoid following ERROR:
+ERROR: [check-portability.awk] gdb/config/djgpp/djconfig.sh: if test "`pwd`" == "${srcdir}" ; then
+
+--- gdb/config/djgpp/djconfig.sh.orig 2015-02-19 11:58:07.000000000 +0000
++++ gdb/config/djgpp/djconfig.sh
+@@ -92,7 +92,7 @@ TMPFILE="${TMPDIR-.}/cfg.tmp"
+
+ # We need to skip the build directory if it is a subdirectory of $srcdir,
+ # otherwise we will have an infinite recursion on our hands...
+-if test "`pwd`" == "${srcdir}" ; then
++if test "`pwd`" = "${srcdir}" ; then
+ SKIPDIR=""
+ SKIPFILES=""
+ else
diff --git a/devel/gdb7/patches/patch-gdb_amd64bsd-nat.c b/devel/gdb7/patches/patch-gdb_amd64bsd-nat.c
new file mode 100644
index 00000000000..0b5d456f87f
--- /dev/null
+++ b/devel/gdb7/patches/patch-gdb_amd64bsd-nat.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-gdb_amd64bsd-nat.c,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+--- gdb/amd64bsd-nat.c.orig 2016-02-10 03:19:39.000000000 +0000
++++ gdb/amd64bsd-nat.c
+@@ -167,6 +167,10 @@ amd64bsd_target (void)
+
+ #ifdef HAVE_PT_GETDBREGS
+
++#ifndef DBREG_DRX
++#define DBREG_DRX(d,x) ((d)->dr[(x)])
++#endif
++
+ static unsigned long
+ amd64bsd_dr_get (ptid_t ptid, int regnum)
+ {
diff --git a/devel/gdb7/patches/patch-gdb_bsd-kvm.c b/devel/gdb7/patches/patch-gdb_bsd-kvm.c
new file mode 100644
index 00000000000..ed1e89e6366
--- /dev/null
+++ b/devel/gdb7/patches/patch-gdb_bsd-kvm.c
@@ -0,0 +1,33 @@
+$NetBSD: patch-gdb_bsd-kvm.c,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+(1) (unknown yet)
+(2) +#include <sys/signal.h> part:
+NetBSD/i386 5.2 has following problem without sys/signal.h
+from bsd-kvm.c:36:
+/usr/include/sys/signalvar.h:56: error: field 'sd_sigact' has incomplete type
+/usr/include/sys/signalvar.h:59: error: 'NSIG' undeclared here (not in a function)
+gmake[2]: *** [bsd-kvm.o] Error 1
+
+--- gdb/bsd-kvm.c.orig 2015-02-19 11:58:07.000000000 +0000
++++ gdb/bsd-kvm.c
+@@ -28,7 +28,12 @@
+ #include "gdbthread.h"
+
+ #include <fcntl.h>
++#include <stddef.h>
+ #include <kvm.h>
++#define _KMEMUSER 1
++#include <sys/signal.h>
++#include <lwp.h>
++#include <sys/lwp.h>
+ #ifdef HAVE_NLIST_H
+ #include <nlist.h>
+ #endif
+@@ -36,6 +41,7 @@
+ #include "readline/readline.h"
+ #include <sys/param.h>
+ #include <sys/proc.h>
++#include <sys/types.h>
+ #include <sys/user.h>
+
+ #include "bsd-kvm.h"
diff --git a/devel/gdb7/patches/patch-gdb_ppcnbsd-nat.c b/devel/gdb7/patches/patch-gdb_ppcnbsd-nat.c
new file mode 100644
index 00000000000..e83ea19b102
--- /dev/null
+++ b/devel/gdb7/patches/patch-gdb_ppcnbsd-nat.c
@@ -0,0 +1,38 @@
+$NetBSD: patch-gdb_ppcnbsd-nat.c,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+Absorb membername difference.
+
+--- gdb/ppcnbsd-nat.c.orig 2015-02-19 11:58:07.000000000 +0000
++++ gdb/ppcnbsd-nat.c
+@@ -160,20 +160,20 @@ ppcnbsd_supply_pcb (struct regcache *reg
+ return 0;
+
+ read_memory (pcb->pcb_sp, (gdb_byte *)&sf, sizeof sf);
+- regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &sf.cr);
+- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
++ regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &sf.sf_cr);
++ regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 2, &sf.sf_fixreg2);
+ for (i = 0 ; i < 19 ; i++)
+ regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 13 + i,
+- &sf.fixreg[i]);
++ &sf.sf_fixreg[i]);
+
+- read_memory(sf.sp, (gdb_byte *)&cf, sizeof(cf));
+- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 30, &cf.r30);
+- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 31, &cf.r31);
+- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 1, &cf.sp);
+-
+- read_memory(cf.sp, (gdb_byte *)&cf, sizeof(cf));
+- regcache_raw_supply (regcache, tdep->ppc_lr_regnum, &cf.lr);
+- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch), &cf.lr);
++ read_memory(sf.sf_sp, (gdb_byte *)&cf, sizeof(cf));
++ regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 30, &cf.cf_r30);
++ regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 31, &cf.cf_r31);
++ regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 1, &cf.cf_sp);
++
++ read_memory(cf.cf_sp, (gdb_byte *)&cf, sizeof(cf));
++ regcache_raw_supply (regcache, tdep->ppc_lr_regnum, &cf.cf_lr);
++ regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch), &cf.cf_lr);
+
+ return 1;
+ }
diff --git a/devel/gdb7/patches/patch-opcodes_i386-dis_c b/devel/gdb7/patches/patch-opcodes_i386-dis_c
new file mode 100644
index 00000000000..c9e91a2b81d
--- /dev/null
+++ b/devel/gdb7/patches/patch-opcodes_i386-dis_c
@@ -0,0 +1,13 @@
+$NetBSD: patch-opcodes_i386-dis_c,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+--- opcodes/i386-dis.c.orig 2015-02-19 11:58:08.000000000 +0000
++++ opcodes/i386-dis.c
+@@ -13586,7 +13586,7 @@ dofloat (int sizeflag)
+ static void
+ oappend_maybe_intel (const char *s)
+ {
+- oappend (s + intel_syntax);
++ oappend (s[(short)intel_syntax]);
+ }
+
+ static void
diff --git a/devel/gdb7/patches/patch-sim_ppc_emul_netbsd.c b/devel/gdb7/patches/patch-sim_ppc_emul_netbsd.c
new file mode 100644
index 00000000000..01682d24d0c
--- /dev/null
+++ b/devel/gdb7/patches/patch-sim_ppc_emul_netbsd.c
@@ -0,0 +1,39 @@
+$NetBSD: patch-sim_ppc_emul_netbsd.c,v 1.1 2017/06/05 10:41:28 maya Exp $
+
+time_t conversion compatibility, experimental.
+Please correct the naming, thank you.
+
+--- sim/ppc/emul_netbsd.c.orig 2014-06-11 16:34:42.000000000 +0000
++++ sim/ppc/emul_netbsd.c
+@@ -118,6 +118,7 @@ extern int errno;
+
+ #if WITH_NetBSD_HOST
+ #define SYS(X) ASSERT(call == (SYS_##X))
++#define SYSSYS(X) ASSERT(call == (SYS___##X50))
+ #else
+ #define SYS(X)
+ #endif
+@@ -737,7 +738,11 @@ 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);
+
++#if 0
+ SYS(gettimeofday);
++#else
++ SYS___gettimeofday50;
++#endif
+ emul_write_status(processor, status, err);
+ if (status == 0) {
+ if (t_addr != 0)
+@@ -767,7 +772,11 @@ do_getrusage(os_emul_data *emul,
+ if (WITH_TRACE && ppc_trace[trace_os_emul])
+ printf_filtered ("%d, 0x%lx", who, (long)rusage_addr);
+
++#if 0
+ SYS(getrusage);
++#else
++ SYS___getrusage50;
++#endif
+ emul_write_status(processor, status, err);
+ if (status == 0) {
+ if (rusage_addr != 0)