Correct __FreeBSD_version to use?

Steve Kargl sgk at troutmask.apl.washington.edu
Thu Oct 15 17:49:54 UTC 2009


I use FreeBSD mainline for my normal use and I don't have
access to a system with the upcoming FreeBSD 8.0.  It appears
the changes to sys/amd64/include/pcb.h to remove the
pcb_{fs,ds,es,gs} members of the pcb struct breaks at least
gdb-6.8.x and gdb-7.0.  I've sent a patch to the gdb developers
to get gdb-7.0 building on FreeBSD mainline.

--- amd64fbsd-nat.c.orig	2009-10-12 14:38:56.000000000 -0700
+++ amd64fbsd-nat.c	2009-10-12 14:40:13.000000000 -0700
@@ -95,6 +95,7 @@
 
 #include <sys/types.h>
 #include <machine/pcb.h>
+#include <osreldate.h>
 
 #include "bsd-kvm.h"
 
@@ -123,10 +124,12 @@
   regcache_raw_supply (regcache, 13, &pcb->pcb_r13);
   regcache_raw_supply (regcache, 14, &pcb->pcb_r14);
   regcache_raw_supply (regcache, 15, &pcb->pcb_r15);
+#if (__FreeBSD_version <  900000)
   regcache_raw_supply (regcache, AMD64_DS_REGNUM, &pcb->pcb_ds);
   regcache_raw_supply (regcache, AMD64_ES_REGNUM, &pcb->pcb_es);
   regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs);
   regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs);
+#endif
 
   return 1;
 }

My question is what __FreeBSD_version number should I use
to have gdb working on FreeBSD 8.0 or greater?  To be clear,
this is the commit to the 8.0 branch that breaks anything
that uses pcb on the amd64 target.

http://svn.freebsd.org/viewvc/base/stable/8/sys/amd64/include/pcb.h?view=log

Revision 190620 - (view) (annotate) - [select for diffs]
Modified Wed Apr 1 13:09:26 2009 UTC (6 months, 2 weeks ago) by kib
Original Path: head/sys/amd64/include/pcb.h
File length: 3319 byte(s)
Diff to previous 189903

-- 
Steve


More information about the freebsd-ports mailing list