From nobody@FreeBSD.org  Fri Aug 27 00:07:44 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7492B16A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Aug 2004 00:07:44 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4AF3D43D39
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Aug 2004 00:07:44 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7R07ioF072697
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Aug 2004 00:07:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i7R07hIs072686;
	Fri, 27 Aug 2004 00:07:43 GMT
	(envelope-from nobody)
Message-Id: <200408270007.i7R07hIs072686@www.freebsd.org>
Date: Fri, 27 Aug 2004 00:07:43 GMT
From: Douglas Thrift <douglas@douglasthrift.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Update port: devel/gdb6 made it work on 4.x again
X-Send-Pr-Version: www-2.3

>Number:         71011
>Category:       ports
>Synopsis:       Update port: devel/gdb6 made it work on 4.x again
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 27 00:10:24 GMT 2004
>Closed-Date:    Fri Aug 27 15:43:18 GMT 2004
>Last-Modified:  Fri Aug 27 15:43:18 GMT 2004
>Originator:     Douglas Thrift
>Release:        4.10-STABLE
>Organization:
>Environment:
FreeBSD daemon.local.douglasthrift.net 4.10-STABLE FreeBSD 4.10-STABLE #1: Thu May 27 01:42:28 PDT 2004     douglas@daemon.local.douglasthrift.net:/usr/obj/usr/src/sys/DAEMONIC  i386
>Description:
On FreeBSD 4.x GDB 6 needs the newer version of Readline provided by devel/readline and a newer GCC such as 3.4. Also kvm-fbsd.c conditionally redefined the function fbsd_kern_frame_saved_pc, but the didn't headers didn't hide the previous definition.
>How-To-Repeat:
      
>Fix:
diff -ruN /usr/ports/devel/gdb6/Makefile gdb6/Makefile
--- /usr/ports/devel/gdb6/Makefile	Sun Aug 22 23:34:48 2004
+++ gdb6/Makefile	Thu Aug 26 16:38:33 2004
@@ -35,7 +35,9 @@
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} < 500000
-BROKEN=		"Does not compile on 4.x"
+LIB_DEPENDS=	readline.4:${PORTSDIR}/devel/readline
+USE_GCC?=3.4
+CFLAGS+=	-Wl,--rpath -Wl,${PREFIX}/lib
 .endif
 
 .if ${ARCH} == "amd64"
diff -ruN /usr/ports/devel/gdb6/files/kvm-fbsd-alpha.h gdb6/files/kvm-fbsd-alpha.h
--- /usr/ports/devel/gdb6/files/kvm-fbsd-alpha.h	Sun Jun 20 15:22:02 2004
+++ gdb6/files/kvm-fbsd-alpha.h	Thu Aug 26 16:16:01 2004
@@ -50,7 +50,7 @@
   deprecated_registers_fetched ();
 }
 
-
+#if __FreeBSD_version >= 500032
 CORE_ADDR
 fbsd_kern_frame_saved_pc (struct frame_info *fi)
 {
@@ -77,3 +77,4 @@
       return (this_saved_pc);
     }
 }
+#endif
diff -ruN /usr/ports/devel/gdb6/files/kvm-fbsd-amd64.h gdb6/files/kvm-fbsd-amd64.h
--- /usr/ports/devel/gdb6/files/kvm-fbsd-amd64.h	Mon Aug 23 16:12:31 2004
+++ gdb6/files/kvm-fbsd-amd64.h	Thu Aug 26 16:16:54 2004
@@ -55,6 +55,7 @@
    but we don't think that's too important right now.  */
 enum frametype { tf_normal, tf_trap, tf_interrupt, tf_syscall };
 
+#if __FreeBSD_version >= 500032
 CORE_ADDR
 fbsd_kern_frame_saved_pc (struct frame_info *fi)
 {
@@ -98,6 +99,7 @@
 #undef oEIP
     }
 }
+#endif
 
 static void
 fetch_kcore_registers (struct pcb *pcb)
diff -ruN /usr/ports/devel/gdb6/files/kvm-fbsd-i386.h gdb6/files/kvm-fbsd-i386.h
--- /usr/ports/devel/gdb6/files/kvm-fbsd-i386.h	Mon Aug 23 16:12:31 2004
+++ gdb6/files/kvm-fbsd-i386.h	Thu Aug 26 16:06:52 2004
@@ -56,6 +56,7 @@
    but we don't think that's too important right now.  */
 enum frametype { tf_normal, tf_trap, tf_interrupt, tf_syscall };
 
+#if __FreeBSD_version >= 500032
 CORE_ADDR
 fbsd_kern_frame_saved_pc (struct frame_info *fi)
 {
@@ -99,6 +100,7 @@
 #undef oEIP
     }
 }
+#endif
 
 static void
 fetch_kcore_registers (struct pcb *pcb)
diff -ruN /usr/ports/devel/gdb6/files/kvm-fbsd-sparc64.h gdb6/files/kvm-fbsd-sparc64.h
--- /usr/ports/devel/gdb6/files/kvm-fbsd-sparc64.h	Mon Aug 23 16:12:31 2004
+++ gdb6/files/kvm-fbsd-sparc64.h	Thu Aug 26 16:17:36 2004
@@ -51,6 +51,7 @@
     regcache_raw_supply (current_regcache, i + SPARC_I0_REGNUM, &top.fr_in[i]);
 }
 
+#if __FreeBSD_version >= 500032
 CORE_ADDR
 fbsd_kern_frame_saved_pc (struct frame_info *fi)
 {
@@ -96,3 +97,4 @@
     }
   return (pc);
 }
+#endif

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->obrien 
Responsible-Changed-By: vs 
Responsible-Changed-When: Fri Aug 27 07:49:21 GMT 2004 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71011 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Fri Aug 27 15:42:05 GMT 2004 
State-Changed-Why:  
Acutally gdb6 never supported being run on FreeBSD 4.x as the port was to 
be a vehicle to upgrade the gdb in the 5.x base /usr/src. 

Anyway, I've committed the patch as it didn't break the build on 5.x. 
Note, that I didn't commit the sparc64 or amd64 parts since there aren't 
any 4.x systems of those platforms. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71011 
>Unformatted:
