/* Native-dependent code for FreeBSD/amd64.
- Copyright 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
+ 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 2 of the License, or
+ 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,
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, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
#include "inferior.h"
#include <sys/types.h>
#include <machine/pcb.h>
+#include <osreldate.h>
#include "bsd-kvm.h"
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 < 800075)
+ /* struct pcb provides the pcb_ds/pcb_es/pcb_fs/pcb_gs fields only
+ up until __FreeBSD_version 800074: The removal of these fields
+ occurred on 2009-04-01 while the __FreeBSD_version number was
+ bumped to 800075 on 2009-04-06. So 800075 is the closest version
+ number where we should not try to access these fields. */
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;
}