Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2012 08:17:09 GMT
From:      Luca Pizzammiglio <luca.pizzamiglio@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/170913: [MAINTAINER] Upgrade gdb to 7.5
Message-ID:  <201208230817.q7N8H9Pv080636@red.freebsd.org>
Resent-Message-ID: <201208230820.q7N8KI68066270@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         170913
>Category:       ports
>Synopsis:       [MAINTAINER] Upgrade gdb to 7.5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 23 08:20:17 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Luca Pizzammiglio
>Release:        8-STABLE
>Organization:
>Environment:
FreeBSD pizzamig.bally.de 8.3-STABLE FreeBSD 8.3-STABLE #7: Wed Jun 20 14:56:08 CEST 2012     root@pizzamig.xxx.xx:/usr/obj/usr/src/sys/PIZZAMIG  i386
>Description:
Upgrade gdb port to the last version, removing also several patches integrated in the mainstream.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -uNr devel/gdb.orig/Makefile devel/gdb/Makefile
--- devel/gdb.orig/Makefile	2012-08-09 18:47:32.000000000 +0200
+++ devel/gdb/Makefile	2012-08-23 10:07:11.000000000 +0200
@@ -2,12 +2,11 @@
 # Date created:				16 November 2010
 # Whom:					Steven Kreuzer <skreuzer@FreeBSD.org>
 #
-# $FreeBSD: ports/devel/gdb/Makefile,v 1.22 2012/08/09 16:47:32 bdrewery Exp $
+# $FreeBSD$
 #
 
 PORTNAME=	gdb
-PORTVERSION=	7.4.1
-PORTREVISION=	4
+PORTVERSION=	7.5
 CATEGORIES=	devel
 MASTER_SITES=	GNU
 
@@ -95,7 +94,6 @@
 .if ${PORT_OPTIONS:MTHREADS}
 	@${CP} ${FILESDIR}/fbsd-threads.c ${WRKSRC}/gdb/
 .endif
-	@${CP} ${FILESDIR}/amd64bsd-nat.h ${WRKSRC}/gdb
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/gdb/gdb ${PREFIX}/bin/gdb${VER}
diff -uNr devel/gdb.orig/distinfo devel/gdb/distinfo
--- devel/gdb.orig/distinfo	2012-05-01 17:53:46.000000000 +0200
+++ devel/gdb/distinfo	2012-08-22 16:17:22.000000000 +0200
@@ -1,2 +1,2 @@
-SHA256 (gdb-7.4.1.tar.bz2) = a081343c017732ab4dd30a4730da83667aa01b0b37d1ad3700c3f05a5da0f9f6
-SIZE (gdb-7.4.1.tar.bz2) = 20619200
+SHA256 (gdb-7.5.tar.bz2) = d178c45c328369ae4f24f9a0ec53b7d009e2bfa1d41b7027280b24f58ae61932
+SIZE (gdb-7.5.tar.bz2) = 21327195
diff -uNr devel/gdb.orig/files/amd64bsd-nat.h devel/gdb/files/amd64bsd-nat.h
--- devel/gdb.orig/files/amd64bsd-nat.h	2012-02-25 12:57:56.000000000 +0100
+++ devel/gdb/files/amd64bsd-nat.h	1970-01-01 01:00:00.000000000 +0100
@@ -1,38 +0,0 @@
-/* Native-dependent code for amd64 BSD's.
-
-   Copyright (C) 2011 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef AMD64BSD_NAT_H
-#define AMD64BSD_NAT_H
-
-/* Create a prototype *BSD/amd64 target.  The client can override it
-   with local methods.  */
-
-extern struct target_ops *amd64bsd_target (void);
-
-/* low level amd64 debug register functions used in amd64fbsd-nat.c.  */
-
-extern void amd64bsd_dr_set_control (unsigned long control);
-
-extern void amd64bsd_dr_set_addr (int regnum, CORE_ADDR addr);
-
-extern void amd64bsd_dr_reset_addr (int regnum);
-
-extern unsigned long amd64bsd_dr_get_status (void);
-
-#endif /* amd64bsd-nat.h */
diff -uNr devel/gdb.orig/files/extrapatch-gdb-Makefile.in devel/gdb/files/extrapatch-gdb-Makefile.in
--- devel/gdb.orig/files/extrapatch-gdb-Makefile.in	2012-07-27 09:05:23.000000000 +0200
+++ devel/gdb/files/extrapatch-gdb-Makefile.in	2012-08-22 16:54:54.000000000 +0200
@@ -1,6 +1,6 @@
---- gdb/Makefile.in.orig	2011-03-30 07:55:39.000000000 +0100
-+++ gdb/Makefile.in	2011-10-29 08:02:29.600973609 +0100
-@@ -571,7 +571,7 @@
+--- gdb/Makefile.in.orig	2012-07-02 17:29:33.000000000 +0200
++++ gdb/Makefile.in	2012-08-22 16:50:26.000000000 +0200
+@@ -572,7 +572,7 @@
  	xstormy16-tdep.o \
  	xtensa-config.o xtensa-tdep.o xtensa-linux-tdep.o \
  	glibc-tdep.o \
@@ -8,9 +8,9 @@
 +	fbsd-threads.o \
  	nbsd-tdep.o obsd-tdep.o \
  	sol2-tdep.o \
- 	solib-frv.o solib-irix.o solib-svr4.o solib-target.o \
-@@ -782,7 +782,7 @@
- gnulib/stdint.in.h remote.h gdb.h sparc-nat.h \
+ 	solib-frv.o solib-irix.o solib-svr4.o \
+@@ -779,7 +779,7 @@
+ gnulib/import/stdint.in.h remote.h gdb.h sparc-nat.h \
  gdbthread.h dwarf2-frame.h dwarf2-frame-tailcall.h nbsd-nat.h dcache.h \
  amd64-nat.h s390-tdep.h arm-linux-tdep.h exceptions.h macroscope.h \
 -gdbarch.h bsd-uthread.h gdb_stat.h memory-map.h	memrange.h \
@@ -18,12 +18,12 @@
  mdebugread.h m88k-tdep.h stabsread.h hppa-linux-offsets.h linux-fork.h \
  ser-unix.h inf-ptrace.h terminal.h ui-out.h frame-base.h \
  f-lang.h dwarf2loc.h value.h sparc-tdep.h defs.h target-descriptions.h \
-@@ -1452,7 +1452,7 @@
+@@ -1429,7 +1429,7 @@
  	armnbsd-nat.c armbsd-tdep.c armnbsd-tdep.c armobsd-tdep.c \
  	avr-tdep.c \
  	bfin-linux-tdep.c bfin-tdep.c \
 -	bsd-uthread.c bsd-kvm.c \
 +	fbsd-threads.c bsd-kvm.c \
- 	core-regset.c corelow.c \
+ 	core-regset.c \
  	dcache.c dicos-tdep.c darwin-nat.c \
  	exec.c \
diff -uNr devel/gdb.orig/files/extrapatch-gdb-configure.tgt devel/gdb/files/extrapatch-gdb-configure.tgt
--- devel/gdb.orig/files/extrapatch-gdb-configure.tgt	2012-07-27 09:05:23.000000000 +0200
+++ devel/gdb/files/extrapatch-gdb-configure.tgt	2012-08-22 16:48:15.000000000 +0200
@@ -1,20 +1,20 @@
---- gdb/configure.tgt.orig	2010-09-30 13:38:12.841406000 -0400
-+++ gdb/configure.tgt	2010-09-30 13:38:49.131127000 -0400
-@@ -169,7 +169,7 @@
+--- gdb/configure.tgt.orig	2012-08-01 21:48:44.000000000 +0200
++++ gdb/configure.tgt	2012-08-22 16:47:02.000000000 +0200
+@@ -176,7 +176,7 @@
  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 corelow.o solib.o solib-svr4.o"
-+			fbsd-threads.o corelow.o solib.o solib-svr4.o"
+-			bsd-uthread.o solib-svr4.o"
++			fbsd-threads.o solib-svr4.o"
  	;;
  i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
  	# Target: NetBSD/i386
-@@ -579,7 +579,7 @@
+@@ -606,7 +606,7 @@
  	# 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 corelow.o solib.o solib-svr4.o"
-+			fbsd-threads.o corelow.o solib.o solib-svr4.o"
+-			bsd-uthread.o solib-svr4.o"
++			fbsd-threads.o solib-svr4.o"
  	;;
  x86_64-*-mingw*)
          # Target: MingW/amd64
diff -uNr devel/gdb.orig/files/fbsd-threads.c devel/gdb/files/fbsd-threads.c
--- devel/gdb.orig/files/fbsd-threads.c	2012-08-03 04:00:58.000000000 +0200
+++ devel/gdb/files/fbsd-threads.c	2012-08-22 17:15:10.000000000 +0200
@@ -529,7 +529,7 @@
 
 static void
 fbsd_thread_resume (struct target_ops *ops,
-		    ptid_t ptid, int step, enum target_signal signo)
+		    ptid_t ptid, int step, enum gdb_signal signo)
 {
   struct target_ops *beneath = find_target_beneath (ops);
   td_thrhandle_t th;
@@ -584,7 +584,7 @@
   if (lwp)
     {
       int req = step ? PT_SETSTEP : PT_CLEARSTEP;
-      if (ptrace (req, (pid_t) lwp, (caddr_t) 1, target_signal_to_host(signo)))
+      if (ptrace (req, (pid_t) lwp, (caddr_t) 1, gdb_signal_to_host(signo)))
         perror_with_name ("PT_SETSTEP/PT_CLEARSTEP");
     }
 
@@ -623,7 +623,7 @@
 
   /* now continue the process, suspended thread wont run */
   if (ptrace (PT_CONTINUE, proc_handle.pid , (caddr_t)1,
-	      target_signal_to_host(signo)))
+	      gdb_signal_to_host(signo)))
     perror_with_name ("PT_CONTINUE");
 }
 
@@ -734,7 +734,7 @@
 	 */
         attach_thread(ret, &th, &ti, 1);
       }
-      if (ourstatus->value.sig == TARGET_SIGNAL_TRAP)
+      if (ourstatus->value.sig == GDB_SIGNAL_TRAP)
         check_event(ret);
       /* this is a hack, if an event won't cause gdb to stop, for example,
          SIGALRM, gdb resumes the process immediatly without setting
diff -uNr devel/gdb.orig/files/patch-gdb-Makefile.in devel/gdb/files/patch-gdb-Makefile.in
--- devel/gdb.orig/files/patch-gdb-Makefile.in	2012-07-27 09:05:23.000000000 +0200
+++ devel/gdb/files/patch-gdb-Makefile.in	1970-01-01 01:00:00.000000000 +0100
@@ -1,20 +0,0 @@
---- gdb/Makefile.in.orig	2011-03-30 07:55:39.000000000 +0100
-+++ gdb/Makefile.in	2011-10-29 08:02:29.600973609 +0100
-@@ -758,7 +758,7 @@
- osf-share/cma_deb_core.h osf-share/AT386/cma_thread_io.h \
- osf-share/cma_sched.h proc-utils.h arm-tdep.h ax-gdb.h ppcnbsd-tdep.h \
- cli-out.h gdb_expat.h breakpoint.h infcall.h obsd-tdep.h \
--exec.h m32r-tdep.h osabi.h gdbcore.h solib-som.h \
-+exec.h m32r-tdep.h osabi.h gdbcore.h solib-som.h amd64bsd-nat.h \
- i386bsd-nat.h xml-support.h xml-tdesc.h alphabsd-tdep.h gdb_obstack.h \
- ia64-tdep.h ada-lang.h varobj.h frv-tdep.h nto-tdep.h serial.h \
- c-lang.h d-lang.h frame.h event-loop.h block.h cli/cli-setshow.h	\
-@@ -1161,7 +1161,7 @@
- # Removing the old gdb first works better if it is running, at least on SunOS.
- gdb$(EXEEXT): gdb.o libgdb.a $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
- 	rm -f gdb$(EXEEXT)
--	$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-+	$(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -Wl,-E \
- 		-o gdb$(EXEEXT) gdb.o libgdb.a \
- 		$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
- 
diff -uNr devel/gdb.orig/files/patch-gdb-amd64bsd-nat.c devel/gdb/files/patch-gdb-amd64bsd-nat.c
--- devel/gdb.orig/files/patch-gdb-amd64bsd-nat.c	2012-02-25 12:57:56.000000000 +0100
+++ devel/gdb/files/patch-gdb-amd64bsd-nat.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,91 +0,0 @@
---- gdb/amd64bsd-nat.c.orig	2011-09-23 01:35:24.211306143 +0100
-+++ gdb/amd64bsd-nat.c	2011-09-23 01:28:28.444487431 +0100
-@@ -33,6 +33,7 @@
- 
- #include "amd64-tdep.h"
- #include "amd64-nat.h"
-+#include "amd64bsd-nat.h"
- #include "inf-ptrace.h"
- 
- 
-@@ -126,3 +127,80 @@
-   t->to_store_registers = amd64bsd_store_inferior_registers;
-   return t;
- }
-+
-+
-+/* Support for debug registers.  */
-+
-+#ifdef HAVE_PT_GETDBREGS
-+
-+/* Not all versions of FreeBSD/i386 that support the debug registers
-+   have this macro.  */
-+#ifndef DBREG_DRX
-+#define DBREG_DRX(d, x) ((&d->dr0)[x])
-+#endif
-+
-+static void
-+amd64bsd_dr_set (int regnum, unsigned long value)
-+{
-+  struct dbreg dbregs;
-+
-+  if (ptrace (PT_GETDBREGS, PIDGET (inferior_ptid),
-+              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
-+    perror_with_name (_("Couldn't get debug registers"));
-+
-+  /* For some mysterious reason, some of the reserved bits in the
-+     debug control register get set.  Mask these off, otherwise the
-+     ptrace call below will fail.  */
-+  DBREG_DRX ((&dbregs), 7) &= ~(0x0000fc00);
-+
-+  DBREG_DRX ((&dbregs), regnum) = value;
-+
-+  if (ptrace (PT_SETDBREGS, PIDGET (inferior_ptid),
-+              (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
-+    perror_with_name (_("Couldn't write debug registers"));
-+}
-+
-+void
-+amd64bsd_dr_set_control (unsigned long control)
-+{
-+  amd64bsd_dr_set (7, control);
-+}
-+
-+void
-+amd64bsd_dr_set_addr (int regnum, CORE_ADDR addr)
-+{
-+  gdb_assert (regnum >= 0 && regnum <= 4);
-+
-+  amd64bsd_dr_set (regnum, addr);
-+}
-+
-+void
-+amd64bsd_dr_reset_addr (int regnum)
-+{
-+  gdb_assert (regnum >= 0 && regnum <= 4);
-+
-+  amd64bsd_dr_set (regnum, 0);
-+}
-+
-+unsigned long
-+amd64bsd_dr_get_status (void)
-+{
-+  struct dbreg dbregs;
-+
-+  /* FIXME: kettenis/2001-03-31: Calling perror_with_name if the
-+     ptrace call fails breaks debugging remote targets.  The correct
-+     way to fix this is to add the hardware breakpoint and watchpoint
-+     stuff to the target vector.  For now, just return zero if the
-+     ptrace call fails.  */
-+  if (ptrace (PT_GETDBREGS, PIDGET (inferior_ptid),
-+	      (PTRACE_TYPE_ARG3) &dbregs, 0) == -1)
-+#if 0
-+    perror_with_name (_("Couldn't read debug registers"));
-+#else
-+    return 0;
-+#endif
-+
-+  return DBREG_DRX ((&dbregs), 6);
-+}
-+
-+#endif /* PT_GETDBREGS */
diff -uNr devel/gdb.orig/files/patch-gdb-amd64fbsd-nat.c devel/gdb/files/patch-gdb-amd64fbsd-nat.c
--- devel/gdb.orig/files/patch-gdb-amd64fbsd-nat.c	2012-02-25 12:57:56.000000000 +0100
+++ devel/gdb/files/patch-gdb-amd64fbsd-nat.c	2012-08-23 09:25:18.000000000 +0200
@@ -1,6 +1,6 @@
---- gdb/amd64fbsd-nat.c.orig	2010-02-03 15:30:25.000000000 +0000
-+++ gdb/amd64fbsd-nat.c	2011-09-23 03:08:51.942111416 +0100
-@@ -27,6 +27,7 @@
+--- gdb/amd64fbsd-nat.c.orig	2012-02-09 17:06:44.000000000 +0100
++++ gdb/amd64fbsd-nat.c	2012-08-22 23:51:38.000000000 +0200
+@@ -26,6 +26,7 @@
  #include <signal.h>
  #include <stddef.h>
  #include <sys/types.h>
@@ -8,16 +8,7 @@
  #include <sys/ptrace.h>
  #include <sys/sysctl.h>
  #include <machine/reg.h>
-@@ -34,6 +35,8 @@
- #include "fbsd-nat.h"
- #include "amd64-tdep.h"
- #include "amd64-nat.h"
-+#include "amd64bsd-nat.h"
-+#include "i386-nat.h"
- 
- 
- /* Offset in `struct reg' where MEMBER is stored.  */
-@@ -92,6 +95,47 @@
+@@ -93,6 +94,47 @@
  };
  
  
@@ -65,23 +56,3 @@
  /* Support for debugging kernel virtual memory images.  */
  
  #include <sys/types.h>
-@@ -155,6 +199,19 @@
- 
-   /* Add some extra features to the common *BSD/i386 target.  */
-   t = amd64bsd_target ();
-+
-+#ifdef HAVE_PT_GETDBREGS
-+
-+  i386_use_watchpoints (t);
-+
-+  i386_dr_low.set_control = amd64bsd_dr_set_control;
-+  i386_dr_low.set_addr = amd64bsd_dr_set_addr;
-+  i386_dr_low.reset_addr = amd64bsd_dr_reset_addr;
-+  i386_dr_low.get_status = amd64bsd_dr_get_status;
-+  i386_set_debug_register_length (8);
-+
-+#endif /* HAVE_PT_GETDBREGS */
-+
-   t->to_pid_to_exec_file = fbsd_pid_to_exec_file;
-   t->to_find_memory_regions = fbsd_find_memory_regions;
-   t->to_make_corefile_notes = fbsd_make_corefile_notes;
diff -uNr devel/gdb.orig/files/patch-gdb-config-i386-fbsd64.mh devel/gdb/files/patch-gdb-config-i386-fbsd64.mh
--- devel/gdb.orig/files/patch-gdb-config-i386-fbsd64.mh	2012-02-25 12:57:56.000000000 +0100
+++ devel/gdb/files/patch-gdb-config-i386-fbsd64.mh	1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
---- gdb/config/i386/fbsd64.mh.orig	2011-09-23 03:15:43.254648862 +0100
-+++ gdb/config/i386/fbsd64.mh	2011-09-23 03:14:06.843804785 +0100
-@@ -1,6 +1,6 @@
- # Host: FreeBSD/amd64
- NATDEPFILES= fork-child.o inf-ptrace.o \
--	fbsd-nat.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
-+	fbsd-nat.o i386-nat.o amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
- 	bsd-kvm.o
- 
- LOADLIBES= -lkvm
diff -uNr devel/gdb.orig/files/patch-gdb-configure devel/gdb/files/patch-gdb-configure
--- devel/gdb.orig/files/patch-gdb-configure	2012-02-25 12:57:56.000000000 +0100
+++ devel/gdb/files/patch-gdb-configure	1970-01-01 01:00:00.000000000 +0100
@@ -1,11 +0,0 @@
---- gdb/configure.orig	2012-01-24 16:59:13.000000000 +0100
-+++ gdb/configure	2012-01-24 16:59:40.000000000 +0100
-@@ -15294,7 +15294,7 @@
- OLD_LDFLAGS=$LDFLAGS
- OLD_LIBS=$LIBS
- CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
--LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
-+LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
- intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
- # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
- if test "$plugins" = "yes"; then
diff -uNr devel/gdb.orig/pkg-plist devel/gdb/pkg-plist
--- devel/gdb.orig/pkg-plist	2012-04-19 21:05:03.000000000 +0200
+++ devel/gdb/pkg-plist	2012-08-22 17:37:33.000000000 +0200
@@ -8,6 +8,7 @@
 %%PYTHON%%share/gdb%%VER%%/python/gdb/command/__init__.py
 %%PYTHON%%share/gdb%%VER%%/python/gdb/command/pretty_printers.py
 %%PYTHON%%share/gdb%%VER%%/python/gdb/command/prompt.py
+%%PYTHON%%share/gdb%%VER%%/python/gdb/command/explore.py
 %%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb/command
 %%PYTHON%%@dirrm share/gdb%%VER%%/python/gdb
 %%PYTHON%%@dirrm share/gdb%%VER%%/python


>Release-Note:
>Audit-Trail:
>Unformatted:



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