Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Mar 2016 16:19:35 +0000 (UTC)
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r411099 - in head/devel/gdb: . files files/kgdb
Message-ID:  <201603141619.u2EGJZX0041223@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tijl
Date: Mon Mar 14 16:19:34 2016
New Revision: 411099
URL: https://svnweb.freebsd.org/changeset/ports/411099

Log:
  Update devel/gdb to 7.11 which includes new thread support implemented
  by jhb.  Special thanks to jhb for the amazing work on gdb!
  
  PR:		207972
  Submitted by:	luca.pizzamiglio@gmail.com (maintainer)

Added:
  head/devel/gdb/files/patch-gdb-fbsd-nat.c   (contents, props changed)
Deleted:
  head/devel/gdb/files/extrapatch-kgdb-configure.tgt-plain
  head/devel/gdb/files/extrapatch-kgdb-configure.tgt-threads
  head/devel/gdb/files/extrapatch-threads
  head/devel/gdb/files/fbsd-threads.c
  head/devel/gdb/files/patch-gdb_common_common-defs.h
Modified:
  head/devel/gdb/Makefile
  head/devel/gdb/distinfo
  head/devel/gdb/files/extrapatch-kgdb
  head/devel/gdb/files/kgdb/fbsd-kvm.c
  head/devel/gdb/files/patch-armfbsd
  head/devel/gdb/files/patch-gdb-amd64bsd-nat.c
  head/devel/gdb/files/patch-gdb-configure

Modified: head/devel/gdb/Makefile
==============================================================================
--- head/devel/gdb/Makefile	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/Makefile	Mon Mar 14 16:19:34 2016	(r411099)
@@ -2,8 +2,8 @@
 # $FreeBSD$
 
 PORTNAME=	gdb
-PORTVERSION=	7.10
-PORTREVISION=	5
+PORTVERSION=	7.11
+#PORTREVISION=
 CATEGORIES=	devel
 MASTER_SITES=	GNU
 
@@ -36,9 +36,9 @@ PLIST_SUB=	VER=${VER}
 
 ONLY_FOR_ARCHS=	i386 amd64 powerpc powerpc64 armv6	# untested elsewhere, might work
 
-OPTIONS_DEFINE=	DEBUG EXPAT GDB_LINK GUILE KGDB PYTHON THREADS TUI
+OPTIONS_DEFINE=	DEBUG EXPAT GDB_LINK GUILE KGDB PYTHON TUI
 
-OPTIONS_DEFAULT=	GDB_LINK KGDB THREADS TUI PORT_READLINE
+OPTIONS_DEFAULT=	GDB_LINK KGDB TUI PORT_READLINE
 
 OPTIONS_SINGLE=	READLINE
 OPTIONS_SINGLE_READLINE=	BASE_READLINE BUNDLED_READLINE PORT_READLINE
@@ -80,21 +80,10 @@ CONFIGURE_TARGET=	x86_64-portbld-freebsd
 post-patch:
 	@${REINPLACE_CMD} -e 's|$$| [GDB v${PORTVERSION} for FreeBSD]|' \
 		${WRKSRC}/gdb/version.in
-.if ${PORT_OPTIONS:MTHREADS}
-	@${CP} ${FILESDIR}/fbsd-threads.c ${WRKSRC}/gdb/
-	@${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-threads
-.endif
-.if ${PORT_OPTIONS:MKGDB}
+
+post-patch-KGDB-on:
 	@${CP} -r ${FILESDIR}/kgdb/*.[ch] ${WRKSRC}/gdb/
 	@${PATCH} ${PATCH_ARGS} < ${FILESDIR}/extrapatch-kgdb
-.if ${PORT_OPTIONS:MTHREADS}
-	@${PATCH} ${PATCH_ARGS} < \
-	    ${FILESDIR}/extrapatch-kgdb-configure.tgt-threads
-.else
-	@${PATCH} ${PATCH_ARGS} < \
-	    ${FILESDIR}/extrapatch-kgdb-configure.tgt-plain
-.endif
-.endif
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb \
@@ -119,7 +108,7 @@ do-install-PYTHON-on:
 	(cd ${WRKSRC}/gdb; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python )
 	(cd ${WRKSRC}/gdb/data-directory ; \
 		${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} install-python )
-. for f in gdb gdb/command gdb/function
+. for f in gdb gdb/command gdb/function gdb/printer
 	@(cd ${STAGEDIR}${PREFIX}/share/gdb${VER}/python/${f} ; ${CHMOD} 644 *.py* )
 . endfor
 

Modified: head/devel/gdb/distinfo
==============================================================================
--- head/devel/gdb/distinfo	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/distinfo	Mon Mar 14 16:19:34 2016	(r411099)
@@ -1,2 +1,2 @@
-SHA256 (gdb-7.10.tar.xz) = 7ebdaa44f9786ce0c142da4e36797d2020c55fa091905ac5af1846b5756208a8
-SIZE (gdb-7.10.tar.xz) = 18540820
+SHA256 (gdb-7.11.tar.xz) = 7a434116cb630d77bb40776e8f5d3937bed11dea56bafebb4d2bc5dd389fe5c1
+SIZE (gdb-7.11.tar.xz) = 18934392

Modified: head/devel/gdb/files/extrapatch-kgdb
==============================================================================
--- head/devel/gdb/files/extrapatch-kgdb	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/files/extrapatch-kgdb	Mon Mar 14 16:19:34 2016	(r411099)
@@ -71,6 +71,15 @@ index dfaa8a3..182d875 100644
  	fbsd-nat.c \
  	fbsd-tdep.c \
  	fork-child.c \
+@@ -2740,7 +2752,7 @@
+ 
+ # A list of all the objects we might care about in this build, for
+ # dependency tracking.
+-all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \
++all_object_files = kgdb-main.o gdb.o $(LIBGDB_OBS) gdbtk-main.o \
+ 	test-cp-name-parser.o
+ 
+ # Ensure that generated files are created early.  Use order-only
 diff --git gdb/config.in gdb/config.in
 index 9ef53b3..c55c01b 100644
 --- gdb/config.in
@@ -234,3 +243,53 @@ index a9fb44b..a156918 100644
  extern void regcache_raw_collect (const struct regcache *regcache,
  				  int regnum, void *buf);
  
+diff --git gdb/configure.tgt gdb/configure.tgt
+index 4e4d6a9..57e4b3a 100644
+--- gdb/configure.tgt
++++ gdb/configure.tgt
+@@ -185,7 +185,13 @@ i[34567]86-*-dicos*)
+ i[34567]86-*-freebsd* | i[34567]86-*-kfreebsd*-gnu)
+ 	# Target: FreeBSD/i386
+ 	gdb_target_obs="i386-tdep.o i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
+-			bsd-uthread.o fbsd-tdep.o solib-svr4.o"
++			bsd-uthread.o fbsd-tdep.o solib-svr4.o \
++			fbsd-kld.o fbsd-kthr.o fbsd-kvm.o i386fbsd-kern.o"
++	if test "x$enable_64_bit_bfd" = "xyes"; then
++	    # Target: FreeBSD amd64
++	    gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o amd64fbsd-kern.o \
++			    ${gdb_target_obs}"
++	fi
+ 	;;
+ i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
+ 	# Target: NetBSD/i386
+@@ -405,7 +411,8 @@ powerpc*-*-freebsd*)
+ 	# Target: FreeBSD/powerpc
+ 	gdb_target_obs="rs6000-tdep.o ppc-sysv-tdep.o ppc64-tdep.o \
+ 		        ppcfbsd-tdep.o fbsd-tdep.o solib-svr4.o \
+-			ravenscar-thread.o ppc-ravenscar-thread.o"
++			ravenscar-thread.o ppc-ravenscar-thread.o \
++			fbsd-kld.o fbsd-kthr.o fbsd-kvm.o ppcfbsd-kern.o"
+ 	;;
+ 
+ powerpc-*-netbsd* | powerpc-*-knetbsd*-gnu)
+@@ -534,7 +541,8 @@ sparc*-*-freebsd* | sparc*-*-kfreebsd*-gnu)
+ 	# Target: FreeBSD/sparc64
+ 	gdb_target_obs="sparc-tdep.o sparc64-tdep.o sparc64fbsd-tdep.o \
+ 			fbsd-tdep.o solib-svr4.o \
+-			ravenscar-thread.o sparc-ravenscar-thread.o"
++			ravenscar-thread.o sparc-ravenscar-thread.o \
++			fbsd-kld.o fbsd-kthr.o fbsd-kvm.o sparc64fbsd-kern.o"
+ 	;;
+ sparc-*-netbsd* | sparc-*-knetbsd*-gnu)
+ 	# Target: NetBSD/sparc
+@@ -662,7 +670,9 @@ x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
+ 	# Target: FreeBSD/amd64
+ 	gdb_target_obs="amd64-tdep.o amd64fbsd-tdep.o i386-tdep.o \
+ 			i387-tdep.o i386bsd-tdep.o i386fbsd-tdep.o \
+-			bsd-uthread.o fbsd-tdep.o solib-svr4.o"
++			bsd-uthread.o fbsd-tdep.o solib-svr4.o \
++			fbsd-kld.o fbsd-kthr.o fbsd-kvm.o amd64fbsd-kern.o \
++			i386fbsd-kern.o"
+ 	;;
+ x86_64-*-mingw* | x86_64-*-cygwin*)
+         # Target: MingW/amd64

Modified: head/devel/gdb/files/kgdb/fbsd-kvm.c
==============================================================================
--- head/devel/gdb/files/kgdb/fbsd-kvm.c	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/files/kgdb/fbsd-kvm.c	Mon Mar 14 16:19:34 2016	(r411099)
@@ -478,7 +478,7 @@ kgdb_switch_to_thread(int tid)
 	char buf[16];
 	int thread_id;
 
-	thread_id = pid_to_thread_id(fbsd_vmcore_ptid(tid));
+	thread_id = ptid_to_global_thread_id(fbsd_vmcore_ptid(tid));
 	if (thread_id == 0)
 		error ("invalid tid");
 	snprintf(buf, sizeof(buf), "%d", thread_id);

Modified: head/devel/gdb/files/patch-armfbsd
==============================================================================
--- head/devel/gdb/files/patch-armfbsd	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/files/patch-armfbsd	Mon Mar 14 16:19:34 2016	(r411099)
@@ -347,20 +347,21 @@ diff --git gdb/Makefile.in gdb/Makefile.
 index dfaa8a3..ddad28d 100644
 --- gdb/Makefile.in
 +++ gdb/Makefile.in
-@@ -655,7 +655,7 @@ ALL_64_TARGET_OBS = \
- # All other target-dependent objects files (used with --enable-targets=all).
+@@ -659,7 +659,7 @@
  ALL_TARGET_OBS = \
- 	armbsd-tdep.o arm-linux-tdep.o arm-symbian-tdep.o \
+ 	armbsd-tdep.o arm.o arm-linux.o arm-linux-tdep.o \
+ 	arm-get-next-pcs.o arm-symbian-tdep.o \
 -	armnbsd-tdep.o armobsd-tdep.o \
 +	armnbsd-tdep.o armobsd-tdep.o armfbsd-tdep.o \
  	arm-tdep.o arm-wince-tdep.o \
  	avr-tdep.o \
  	bfin-linux-tdep.o bfin-tdep.o \
-@@ -1660,6 +1660,6 @@ ALLDEPFILES = \
- 	amd64-linux-nat.c amd64-linux-tdep.c \
- 	amd64-sol2-tdep.c \
- 	arm-linux-nat.c arm-linux-tdep.c arm-symbian-tdep.c arm-tdep.c \
+@@ -1666,7 +1666,7 @@
+ 	arm.c arm-get-next-pcs.c \
+ 	arm-linux.c arm-linux-nat.c arm-linux-tdep.c \
+ 	arm-symbian-tdep.c arm-tdep.c \
 -	armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c \
 +	armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c armfbsd-tdep.c \
  	avr-tdep.c \
  	bfin-linux-tdep.c bfin-tdep.c \
+ 	bsd-uthread.c bsd-kvm.c \

Modified: head/devel/gdb/files/patch-gdb-amd64bsd-nat.c
==============================================================================
--- head/devel/gdb/files/patch-gdb-amd64bsd-nat.c	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/files/patch-gdb-amd64bsd-nat.c	Mon Mar 14 16:19:34 2016	(r411099)
@@ -1,7 +1,5 @@
-diff --git gdb/amd64bsd-nat.c gdb/amd64bsd-nat.c
-index 66d4289..b1d4a0e 100644
---- gdb/amd64bsd-nat.c
-+++ gdb/amd64bsd-nat.c
+--- gdb/amd64bsd-nat.c.orig	2016-02-10 04:19:39.000000000 +0100
++++ gdb/amd64bsd-nat.c	2016-03-04 11:17:58.581638025 +0100
 @@ -28,6 +28,7 @@
  #include <sys/types.h>
  #include <sys/ptrace.h>
@@ -10,7 +8,7 @@ index 66d4289..b1d4a0e 100644
  
  #include "amd64-tdep.h"
  #include "amd64-nat.h"
-@@ -98,14 +99,24 @@ amd64bsd_store_inferior_registers (struct target_ops *ops,
+@@ -98,14 +99,25 @@
  
    if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
      {
@@ -19,20 +17,21 @@ index 66d4289..b1d4a0e 100644
  
 +      memset( &regs, 0, sizeof(struct reg));
 +      memset( &oldregs, 0, sizeof(struct reg));
-       if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid),
+       if (ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid),
                    (PTRACE_TYPE_ARG3) &regs, 0) == -1)
          perror_with_name (_("Couldn't get registers"));
  
-+      ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid),
-+                  (PTRACE_TYPE_ARG3) &oldregs, 0);
++      ptrace (PT_GETREGS, get_ptrace_pid (inferior_ptid),
++		  (PTRACE_TYPE_ARG3) &oldregs, 0);
        amd64_collect_native_gregset (regcache, &regs, regnum);
  
-+      if( (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE) {
-+        //printf("regs.r_rflags = 0x%8.8lX\n", regs.r_rflags );
-+        //printf("oldregs.r_rflags = 0x%8.8lX\n", oldregs.r_rflags );
-+        regs.r_rflags ^= (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE;
-+        //printf("    allowed regs.r_rflags = 0x%8.8X\n", regs.r_rflags );
-+      }
-       if (ptrace (PT_SETREGS, ptid_get_pid (inferior_ptid),
++      if( (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE)
++        {
++          //printf("regs.r_rflags = 0x%8.8lX\n", regs.r_rflags );
++          //printf("oldregs.r_rflags = 0x%8.8lX\n", oldregs.r_rflags );
++          regs.r_rflags ^= (regs.r_rflags ^ oldregs.r_rflags ) & ~PSL_USERCHANGE;
++          //printf("    allowed regs.r_rflags = 0x%8.8X\n", regs.r_rflags );
++        }
+       if (ptrace (PT_SETREGS, get_ptrace_pid (inferior_ptid),
  	          (PTRACE_TYPE_ARG3) &regs, 0) == -1)
          perror_with_name (_("Couldn't write registers"));

Modified: head/devel/gdb/files/patch-gdb-configure
==============================================================================
--- head/devel/gdb/files/patch-gdb-configure	Mon Mar 14 16:10:26 2016	(r411098)
+++ head/devel/gdb/files/patch-gdb-configure	Mon Mar 14 16:19:34 2016	(r411099)
@@ -1,24 +1,12 @@
-diff --git gdb/configure gdb/configure
-index 355f190..9c60e01 100755
---- gdb/configure
-+++ gdb/configure
-@@ -11423,7 +11423,8 @@ fi
- 
- # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
- # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
--ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include <machine/reg.h>
-+ac_fn_c_check_member "$LINENO" "struct reg" "r_fs" "ac_cv_member_struct_reg_r_fs" "#include <sys/types.h>
-+#include <machine/reg.h>
- "
- if test "x$ac_cv_member_struct_reg_r_fs" = x""yes; then :
- 
-@@ -11433,7 +11434,8 @@ _ACEOF
- 
- 
+--- gdb/configure.orig	2016-03-07 10:33:02.757803766 +0100
++++ gdb/configure	2016-03-07 10:32:39.480804873 +0100
+@@ -14297,8 +14297,7 @@
+ -Wno-narrowing"
+ else
+    build_warnings="$build_warnings -Wpointer-sign -Wmissing-prototypes \
+--Wdeclaration-after-statement -Wmissing-parameter-type \
+--Wold-style-declaration -Wold-style-definition"
++-Wdeclaration-after-statement -Wold-style-definition"
  fi
--ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include <machine/reg.h>
-+ac_fn_c_check_member "$LINENO" "struct reg" "r_gs" "ac_cv_member_struct_reg_r_gs" "#include <sys/types.h>
-+#include <machine/reg.h>
- "
- if test "x$ac_cv_member_struct_reg_r_gs" = x""yes; then :
  
+ # Enable -Wno-format by default when using gcc on mingw since many

Added: head/devel/gdb/files/patch-gdb-fbsd-nat.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/gdb/files/patch-gdb-fbsd-nat.c	Mon Mar 14 16:19:34 2016	(r411099)
@@ -0,0 +1,17 @@
+--- gdb/fbsd-nat.c.orig	2016-03-14 00:00:11.831889802 +0100
++++ gdb/fbsd-nat.c	2016-03-14 00:04:35.906871361 +0100
+@@ -471,6 +471,14 @@
+ 			ptid_get_tid (ptid));
+   if (ptid_lwp_p (ptid))
+     {
++#ifndef PT_LWP_EVENTS
++      /* When LWP events are not supported, a new thread might already be
++	 running that has not yet reported an event when GDB wishes to
++         only run a single thread.  Force an update of the thread list
++	 to ensure that any such threads are suspended before the process
++	 is resumed.  */
++      fbsd_add_threads (ptid_get_pid (ptid));
++#endif
+       /* If ptid is a specific LWP, suspend all other LWPs in the process.  */
+       iterate_over_threads (resume_one_thread_cb, &ptid);
+     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603141619.u2EGJZX0041223>