pkgsrc-WIP-changes archive

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

gdb: trying to update gdb in base



Module Name:	pkgsrc-wip
Committed By:	Dr. Thomas Orgis <thomas.orgis%uni-hamburg.de@localhost>
Pushed By:	thor
Date:		Tue Apr 22 23:39:28 2025 +0200
Changeset:	8a9cff22189d2a04271868f93b3f8aac7bb1052b

Modified Files:
	Makefile
Added Files:
	gdb/DESCR
	gdb/Makefile
	gdb/PLIST.Linux
	gdb/PLIST.common
	gdb/distinfo
	gdb/options.mk
	gdb/patches/patch-gdb_ppc-netbsd-tdep.c

Log Message:
gdb: trying to update gdb in base

... to something that is recent enough to work in Debian stable!

Not quite right yet, but builds on some Linux setup with system
gcc 11 at least. Has trouble with custom toolchain based on gcc 13.

Untested on non-Linux, non-x86_64.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8a9cff22189d2a04271868f93b3f8aac7bb1052b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                |  1 +
 gdb/DESCR                               | 17 ++++++
 gdb/Makefile                            | 94 +++++++++++++++++++++++++++++++++
 gdb/PLIST.Linux                         |  2 +
 gdb/PLIST.common                        | 87 ++++++++++++++++++++++++++++++
 gdb/distinfo                            |  6 +++
 gdb/options.mk                          | 15 ++++++
 gdb/patches/patch-gdb_ppc-netbsd-tdep.c | 49 +++++++++++++++++
 8 files changed, 271 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index b9f5f3f144..9359ced7f9 100644
--- a/Makefile
+++ b/Makefile
@@ -1205,6 +1205,7 @@ SUBDIR+=	gconf-cleaner
 SUBDIR+=	gcr4
 SUBDIR+=	gcta
 SUBDIR+=	gdal-docs
+SUBDIR+=	gdb
 SUBDIR+=	gdb-git
 SUBDIR+=	gdb5
 SUBDIR+=	gdb6
diff --git a/gdb/DESCR b/gdb/DESCR
new file mode 100644
index 0000000000..c7c2207693
--- /dev/null
+++ b/gdb/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/gdb/Makefile b/gdb/Makefile
new file mode 100644
index 0000000000..5cb85e2091
--- /dev/null
+++ b/gdb/Makefile
@@ -0,0 +1,94 @@
+# $NetBSD: Makefile,v 1.82 2024/01/27 13:56:37 mef Exp $
+
+# Work in Progress to update from anciend base version.
+# Right now it could work on plain Linux, but gives weird
+# linker error with custom toolchain (maybe also with gcc
+# from pkgsrc?). PLIST might need work, as does the Python
+# part. How much does it care about Python version?
+
+DISTNAME=	gdb-16.2
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GNU:=gdb/}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://sourceware.org/gdb/
+COMMENT=	Symbolic debugger for multiple language frontends
+LICENSE=	gnu-gpl-v3
+
+NOT_FOR_PLATFORM+=	Darwin-*-aarch64
+
+USE_LANGUAGES=		c c++
+USE_CXX_FEATURES+=      c++17
+
+BROKEN_GETTEXT_DETECTION=	yes
+GNU_CONFIGURE=			yes
+GNU_CONFIGURE_STRICT=		no # has sub-configures
+USE_PKGLOCALEDIR=		yes
+USE_LIBTOOL=			yes
+USE_TOOLS+=			gmake msgfmt makeinfo perl:build bash:run
+REPLACE_LOCALEDIR_PATTERNS+=	Make-in
+INSTALL_TARGET=			install-gdb install-gdbsupport
+TEST_TARGET=			check
+INFO_FILES=			yes
+CONFIGURE_ENV+=			CONFIG_LDFLAGS=${LDFLAGS:M*:Q}
+
+# wants ncurses.h
+FAKE_NCURSES=			yes
+
+REPLACE_INTERPRETER+=   envbash
+REPLACE.envbash.old=    '/usr/bin/env\ bash'
+REPLACE.envbash.new=    ${PREFIX}/bin/bash
+REPLACE_FILES.envbash=  gdb/gcore.in gdb/gstack-1.in
+
+# 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 gdbserver/configure
+SUBST_FILES.fix-depcomp+=	gdbsupport/configure
+SUBST_FILES.fix-depcomp+=	gnulib/configure libctf/configure
+SUBST_SED.fix-depcomp+=		-e 's,< ./depcomp,${_OVERRIDE_PATH.depcomp},'
+
+CONFIGURE_ARGS+=	--disable-gprofng
+CONFIGURE_ARGS+=	--disable-gold
+CONFIGURE_ARGS+=	--disable-gas
+CONFIGURE_ARGS+=	--disable-ld
+
+CONFIGURE_ARGS+=	--enable-targets=all
+
+.include "options.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+PLIST_VARS+=	gcore
+.if (${OPSYS} == "SunOS" || ${OPSYS} == "NetBSD" \
+    || ${OPSYS} == "Linux" || ${OPSYS} == "FreeBSD")
+PLIST.gcore=	yes
+.endif
+
+PLIST_VARS+=	gdbserver
+.if ${OPSYS} == "Linux" || \
+	(${OPSYS} == "NetBSD" && ${MACHINE_ARCH} == "x86_64")
+INSTALL_TARGET+=	install-gdbserver
+PLIST.gdbserver=	yes
+.endif
+
+.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_ARGS+=	--with-separate-debug-dir=/usr/libdata/debug
+.endif
+
+CONFIGURE_DIRS=		${WRKDIR}/build
+CONFIGURE_SCRIPT=	${WRKSRC}/configure
+
+post-extract:
+	${MKDIR} ${WRKDIR}/build
+.include "../../math/mpfr/buildlink3.mk"
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../mk/termcap.buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/gdb/PLIST.Linux b/gdb/PLIST.Linux
new file mode 100644
index 0000000000..ed7a153e02
--- /dev/null
+++ b/gdb/PLIST.Linux
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST.Linux,v 1.6 2020/10/24 18:22:08 kamil Exp $
+lib/libinproctrace.so
diff --git a/gdb/PLIST.common b/gdb/PLIST.common
new file mode 100644
index 0000000000..64b515c289
--- /dev/null
+++ b/gdb/PLIST.common
@@ -0,0 +1,87 @@
+@comment $NetBSD$
+${PLIST.gcore}bin/gcore
+bin/gdb
+bin/gdb-add-index
+${PLIST.gdbserver}bin/gdbserver
+bin/gstack
+include/gdb/jit-reader.h
+info/annotate.info
+info/gdb.info
+info/stabs.info
+${PLIST.gcore}man/man1/gcore.1
+man/man1/gdb-add-index.1
+man/man1/gdb.1
+${PLIST.gdbserver}man/man1/gdbserver.1
+man/man1/gstack.1
+man/man5/gdbinit.5
+${PLIST.python}share/gdb/python/gdb/FrameDecorator.py
+${PLIST.python}share/gdb/python/gdb/FrameIterator.py
+${PLIST.python}share/gdb/python/gdb/__init__.py
+${PLIST.python}share/gdb/python/gdb/command/__init__.py
+${PLIST.python}share/gdb/python/gdb/command/explore.py
+${PLIST.python}share/gdb/python/gdb/command/frame_filters.py
+${PLIST.python}share/gdb/python/gdb/command/missing_files.py
+${PLIST.python}share/gdb/python/gdb/command/pretty_printers.py
+${PLIST.python}share/gdb/python/gdb/command/prompt.py
+${PLIST.python}share/gdb/python/gdb/command/type_printers.py
+${PLIST.python}share/gdb/python/gdb/command/unwinders.py
+${PLIST.python}share/gdb/python/gdb/command/xmethods.py
+${PLIST.python}share/gdb/python/gdb/dap/__init__.py
+${PLIST.python}share/gdb/python/gdb/dap/breakpoint.py
+${PLIST.python}share/gdb/python/gdb/dap/bt.py
+${PLIST.python}share/gdb/python/gdb/dap/disassemble.py
+${PLIST.python}share/gdb/python/gdb/dap/evaluate.py
+${PLIST.python}share/gdb/python/gdb/dap/events.py
+${PLIST.python}share/gdb/python/gdb/dap/frames.py
+${PLIST.python}share/gdb/python/gdb/dap/globalvars.py
+${PLIST.python}share/gdb/python/gdb/dap/io.py
+${PLIST.python}share/gdb/python/gdb/dap/launch.py
+${PLIST.python}share/gdb/python/gdb/dap/locations.py
+${PLIST.python}share/gdb/python/gdb/dap/memory.py
+${PLIST.python}share/gdb/python/gdb/dap/modules.py
+${PLIST.python}share/gdb/python/gdb/dap/next.py
+${PLIST.python}share/gdb/python/gdb/dap/pause.py
+${PLIST.python}share/gdb/python/gdb/dap/scopes.py
+${PLIST.python}share/gdb/python/gdb/dap/server.py
+${PLIST.python}share/gdb/python/gdb/dap/sources.py
+${PLIST.python}share/gdb/python/gdb/dap/startup.py
+${PLIST.python}share/gdb/python/gdb/dap/state.py
+${PLIST.python}share/gdb/python/gdb/dap/threads.py
+${PLIST.python}share/gdb/python/gdb/dap/typecheck.py
+${PLIST.python}share/gdb/python/gdb/dap/varref.py
+${PLIST.python}share/gdb/python/gdb/disassembler.py
+${PLIST.python}share/gdb/python/gdb/frames.py
+${PLIST.python}share/gdb/python/gdb/function/__init__.py
+${PLIST.python}share/gdb/python/gdb/function/as_string.py
+${PLIST.python}share/gdb/python/gdb/function/caller_is.py
+${PLIST.python}share/gdb/python/gdb/function/strfns.py
+${PLIST.python}share/gdb/python/gdb/missing_debug.py
+${PLIST.python}share/gdb/python/gdb/missing_files.py
+${PLIST.python}share/gdb/python/gdb/missing_objfile.py
+${PLIST.python}share/gdb/python/gdb/printer/__init__.py
+${PLIST.python}share/gdb/python/gdb/printing.py
+${PLIST.python}share/gdb/python/gdb/prompt.py
+${PLIST.python}share/gdb/python/gdb/ptwrite.py
+${PLIST.python}share/gdb/python/gdb/styling.py
+${PLIST.python}share/gdb/python/gdb/types.py
+${PLIST.python}share/gdb/python/gdb/unwinder.py
+${PLIST.python}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/freebsd.xml
+share/gdb/syscalls/gdb-syscalls.dtd
+share/gdb/syscalls/i386-linux.xml
+share/gdb/syscalls/loongarch-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/netbsd.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
+${PLIST.python}share/gdb/system-gdbinit/elinos.py
+${PLIST.python}share/gdb/system-gdbinit/wrs-linux.py
diff --git a/gdb/distinfo b/gdb/distinfo
new file mode 100644
index 0000000000..8f916f65ad
--- /dev/null
+++ b/gdb/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.41 2022/12/11 03:51:54 mef Exp $
+
+BLAKE2s (gdb-16.2.tar.gz) = 258bcab1f0433adad5e4c27eb2559468b1461f67aea7ea78d7dd23203d4df880
+SHA512 (gdb-16.2.tar.gz) = c44a6cf6cdd6e92f1f4dda7d888ce3e7fdde65ca8736092e2b0a4c369ea09b499824a1d078f668f276fa6d00d311e9ec485231cb7b841479a4fabbfd65778084
+Size (gdb-16.2.tar.gz) = 41593955 bytes
+SHA1 (patch-gdb_ppc-netbsd-tdep.c) = ab66190b2098b3eb2888d602c86abfa8012270fe
diff --git a/gdb/options.mk b/gdb/options.mk
new file mode 100644
index 0000000000..0c584632c5
--- /dev/null
+++ b/gdb/options.mk
@@ -0,0 +1,15 @@
+# $NetBSD: options.mk,v 1.9 2020/10/24 18:22:08 kamil Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.gdb
+PKG_SUPPORTED_OPTIONS=	python
+PKG_SUGGESTED_OPTIONS=	python
+PLIST_VARS+=		python
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mpython)
+CONFIGURE_ARGS+=	--with-python=${PYTHONBIN}
+#PYTHON_VERSIONS_ACCEPTED=	 27 # Newer supported, but needs more tweaking
+.include "../../lang/python/application.mk"
+PLIST.python=	yes
+.endif
diff --git a/gdb/patches/patch-gdb_ppc-netbsd-tdep.c b/gdb/patches/patch-gdb_ppc-netbsd-tdep.c
new file mode 100644
index 0000000000..f74e0469ab
--- /dev/null
+++ b/gdb/patches/patch-gdb_ppc-netbsd-tdep.c
@@ -0,0 +1,49 @@
+$NetBSD$
+
+Blindly adapted for renamed sources on a Linux host. Someone
+please verify on NetBSD/PPC.
+
+Original patch:
+NetBSD: patch-gdb_ppc-nbsd-tdep.c,v 1.2 2022/12/11 03:51:55 mef 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)
+
+
+
+
+--- gdb/ppc-netbsd-tdep.c.orig	2024-12-29 02:50:07.000000000 +0000
++++ gdb/ppc-netbsd-tdep.c
+@@ -174,6 +174,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);
+@@ -195,6 +199,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 ppc-netbsd-nat.c.  */


Home | Main Index | Thread Index | Old Index