head	1.5;
access;
symbols
	RELEASE_6_0_0:1.4
	RELEASE_5_4_0:1.4
	RELEASE_4_11_0:1.4
	RELEASE_5_3_0:1.3
	RELEASE_4_10_0:1.2
	RELEASE_5_2_1:1.2
	RELEASE_5_2_0:1.2
	RELEASE_4_9_0:1.2
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.2
	RELEASE_4_7_0:1.2
	RELEASE_4_6_2:1.2
	RELEASE_4_6_1:1.2
	RELEASE_4_6_0:1.2
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1
	RELEASE_4_2_0:1.1
	RELEASE_4_1_1:1.1
	RELEASE_4_1_0:1.1
	RELEASE_3_5_0:1.1
	RELEASE_4_0_0:1.1
	RELEASE_3_4_0:1.1
	RELEASE_3_3_0:1.1;
locks; strict;
comment	@# @;


1.5
date	2006.02.03.17.27.41;	author vs;	state dead;
branches;
next	1.4;

1.4
date	2004.11.03.03.10.39;	author jdp;	state Exp;
branches;
next	1.3;

1.3
date	2004.09.21.17.18.56;	author leeym;	state Exp;
branches;
next	1.2;

1.2
date	2002.05.24.04.42.51;	author jdp;	state Exp;
branches;
next	1.1;

1.1
date	99.09.08.18.02.33;	author jdp;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Remove expired port
@
text
@--- src/gnu/usr.bin/gdb/gdb/freebsd-nat.c.orig	Tue Sep 15 06:49:02 1998
+++ src/gnu/usr.bin/gdb/gdb/freebsd-nat.c	Sat Sep 18 10:54:57 2004
@@@@ -108,17 +108,23 @@@@
    * First get virtual address of user structure. Then calculate offset.
    */
   memcpy(&tmp_uaddr,
+#if defined(__FreeBSD__) && __FreeBSD__ >= 5
+	 &((struct user *) core_reg_sect)->u_kproc.ki_addr,
+#else
	 &((struct user *) core_reg_sect)->u_kproc.kp_proc.p_addr,
+#endif
 	 sizeof(tmp_uaddr));
   offset = -reg_addr - (int) tmp_uaddr;
   
   for (regno = 0; regno < NUM_REGS; regno++)
     {
       cregno = tregmap[regno];
-      if (cregno == tFS)
-        addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_fs);
-      else if (cregno == tGS)
-        addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
+      if (cregno == tGS)
+#if defined(__FreeBSD__) && __FreeBSD__ >= 5
+        addr = offsetof (struct user, u_kproc) + offsetof (struct kinfo_proc, ki_pcb) + offsetof (struct pcb, pcb_gs);
+#else
+        addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
+#endif
       else
         addr = offset + 4 * cregno;
       if (addr < 0 || addr >= core_reg_size)
@@@@ -136,7 +134,11 @@@@
       error ("Register %s not found in core file.", reg_names[bad_reg]);
     }
 
-  addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_savefpu);
+#if defined(__FreeBSD__) && __FreeBSD__ >= 5
+  addr = offsetof (struct user, u_kproc) + offsetof (struct kinfo_proc, ki_pcb) + offsetof (struct pcb, pcb_save);
+#else
+  addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_save);
+#endif
   memcpy (&pcb_savefpu, core_reg_sect + addr, sizeof pcb_savefpu);
 }
 
@@@@ -166,7 +164,6 @@@@
 extern void print_387_status_word ();
 
 #define	fpstate		save87
-#define	U_FPSTATE(u)	u.u_pcb.pcb_savefpu
 
 static void
 i387_to_double (from, to)
@@@@ -331,41 +328,19 @@@@
 void
 i386_float_info ()
 {
-  struct user u; /* just for address computations */
-  int i;
-  /* fpstate defined in <sys/user.h> */
+  struct fpstate fps;
   struct fpstate *fpstatep;
-  char buf[sizeof (struct fpstate) + 2 * sizeof (int)];
-  unsigned int uaddr;
-  char fpvalid;
-  unsigned int rounded_addr;
-  unsigned int rounded_size;
-  /*extern int corechan;*/
-  int skip;
   extern int inferior_pid;
   
-  uaddr = (char *)&U_FPSTATE(u) - (char *)&u;
   if (inferior_pid != 0 && core_bfd == NULL) 
     {
-      int *ip;
-      
-      rounded_addr = uaddr & -sizeof (int);
-      rounded_size = (((uaddr + sizeof (struct fpstate)) - uaddr) +
-		      sizeof (int) - 1) / sizeof (int);
-      skip = uaddr - rounded_addr;
-      
-      ip = (int *)buf;
-      for (i = 0; i < rounded_size; i++) 
-	{
-	  *ip++ = ptrace (PT_READ_U, inferior_pid, (caddr_t)rounded_addr, 0);
-	  rounded_addr += sizeof (int);
-	}
-      fpstatep = (struct fpstate *)(buf + skip);
+      ptrace(PT_GETFPREGS, inferior_pid, (caddr_t)&fps, 0);
+      fpstatep = &fps;
     } 
   else 
     fpstatep = &pcb_savefpu;
 
-  print_387_status (fpstatep->sv_ex_sw, (struct env387 *)fpstatep);
+  print_387_status (0, (struct env387 *)fpstatep);
 }
 #endif /* FLOAT_INFO */
 
@


1.4
log
@Fix the build on 5.x.  The 80387 status word from the last exception
is no longer saved.  It seems to be optional to pass this to
print_387_status(), so just pass 0 instead for now.
@
text
@@


1.3
log
@- unbreak this port on 5.x
- utilize PORTNAME and PORTVERSION

PR:		71839
Submitted by:	leeym
Approved by:	portmgr (marcus), jdp (maintainer)
@
text
@d94 1
a94 1
+  print_387_status (fpstatep->sv_env, (struct env387 *)fpstatep);
@


1.2
log
@Make this port compile again, and remove the BROKEN annotation.
@
text
@d1 14
a14 3
--- src/gnu/usr.bin/gdb/gdb/freebsd-nat.c.orig	Mon Sep 14 15:49:02 1998
+++ src/gnu/usr.bin/gdb/gdb/freebsd-nat.c	Thu May 23 21:36:56 2002
@@@@ -115,9 +115,7 @@@@
d21 1
d23 5
a27 1
         addr = offsetof (struct user, u_pcb) + offsetof (struct pcb, pcb_gs);
d30 2
a31 1
@@@@ -136,7 +134,7 @@@@
d36 3
d40 1
d52 1
a52 1
@@@@ -331,36 +328,14 @@@@
d92 6
@


1.1
log
@Make this port build again under both 3.x-stable and 4.x-current.
It used to depend on a bunch of files from the FreeBSD source tree.
But the import of gdb-4.18 and the restructuring connected with
that broke the port.  I have created a second distfile containing
the needed files, and this port now gets them from there.

Also mark this port broken for everything except i386/elf.  I don't
have time to fix the other platforms before the 3.3-RELEASE ports
freeze.
@
text
@d2 1
a2 1
+++ src/gnu/usr.bin/gdb/gdb/freebsd-nat.c	Wed Sep  8 10:33:06 1999
d14 57
@

