Also check for gregset_t and fpregset_t types.
* configure: Regenerate.
* core-regset.c (sys/procfs.h): Only include if HAVE_SYS_PROCFS_H
is defined.
(fetch_core_registers): Turn into stub unless both HAVE_GREGSET_T
and HAVE_FPREGSET_T are defined. These changes allow systems
like linux that are migrating to /proc support to use a single
configuration for both new and old versions.
* config/i386/linux.mt: Note that this is now for both a.out and
ELF systems.
* config/i386/linux.mh (NATDEPFILES): Add solib.o, core-regset.o,
i386v4-nat.o
* config/i386/tm-linux.h (tm-sysv4.h): Include.
* config/i386/xm-linux.h (solib.h): Include
(SVR4_SHARED_LIBS): Define.
* i386v4-nat.c: Only compile if HAVE_SYS_PROCFS_H is defined.
(supply_gregset, fill_gregset): Compile if HAVE_GREGSET_T defined.
(supply_fpregset, fill_fpregset): Compile if HAVE_FPREGSET_T defined.
+Sat Jan 27 10:34:05 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (AC_CHECK_HEADERS): Check for sys/procfs.h.
+ Also check for gregset_t and fpregset_t types.
+ * configure: Regenerate.
+ * core-regset.c (sys/procfs.h): Only include if HAVE_SYS_PROCFS_H
+ is defined.
+ (fetch_core_registers): Turn into stub unless both HAVE_GREGSET_T
+ and HAVE_FPREGSET_T are defined. These changes allow systems
+ like linux that are migrating to /proc support to use a single
+ configuration for both new and old versions.
+
+ * config/i386/linux.mt: Note that this is now for both a.out and
+ ELF systems.
+ * config/i386/linux.mh (NATDEPFILES): Add solib.o, core-regset.o,
+ i386v4-nat.o
+ * config/i386/tm-linux.h (tm-sysv4.h): Include.
+ * config/i386/xm-linux.h (solib.h): Include
+ (SVR4_SHARED_LIBS): Define.
+ * i386v4-nat.c: Only compile if HAVE_SYS_PROCFS_H is defined.
+ (supply_gregset, fill_gregset): Compile if HAVE_GREGSET_T defined.
+ (supply_fpregset, fill_fpregset): Compile if HAVE_FPREGSET_T defined.
+
Fri Jan 26 13:48:14 1996 Stan Shebs <shebs@andros.cygnus.com>
* config/sparc/xm-sparc.h (NEW_SUN_CORE): Remove, never used.
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#ifndef XM_LINUX_H
+#define XM_LINUX_H
+
#define HOST_BYTE_ORDER LITTLE_ENDIAN
#define HAVE_TERMIOS
/* Need R_OK etc, but USG isn't defined. */
#include <unistd.h>
+
+
+/*
+ * We define this because with ELF we use SVR4 style shared libraries.
+ */
+
+#include "solib.h" /* Support for shared libraries. */
+
+#define SVR4_SHARED_LIBS
+
+#endif /* #ifndef XM_LINUX_H */
fi
-for ac_hdr in memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h
+for ac_hdr in memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h
do
ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
fi
+echo $ac_n "checking for gregset_t type""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'gdb_have_gregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1240 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() { return 0; }
+int t() {
+gregset_t *gregsetp = 0
+; return 0; }
+EOF
+if eval $ac_link; then
+ rm -rf conftest*
+ gdb_have_gregset_t=yes
+else
+ rm -rf conftest*
+ gdb_have_gregset_t=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gdb_have_gregset_t" 1>&6
+if test $gdb_have_gregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GREGSET_T 1
+EOF
+
+fi
+
+echo $ac_n "checking for fpregset_t type""... $ac_c" 1>&6
+if eval "test \"`echo '$''{'gdb_have_fpregset_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1272 "configure"
+#include "confdefs.h"
+#include <sys/procfs.h>
+int main() { return 0; }
+int t() {
+fpregset_t *fpregsetp = 0
+; return 0; }
+EOF
+if eval $ac_link; then
+ rm -rf conftest*
+ gdb_have_fpregset_t=yes
+else
+ rm -rf conftest*
+ gdb_have_fpregset_t=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$gdb_have_fpregset_t" 1>&6
+if test $gdb_have_fpregset_t = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_FPREGSET_T 1
+EOF
+
+fi
+
for ac_func in valloc getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1242 "configure"
+#line 1306 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
ac_cv_func_mmap=no
else
cat > conftest.$ac_ext <<EOF
-#line 1294 "configure"
+#line 1358 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test. */
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
cat > conftest.$ac_ext <<EOF
-#line 1528 "configure"
+#line 1592 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1591 "configure"
+#line 1655 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1710 "configure"
+#line 1774 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1754 "configure"
+#line 1818 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1789 "configure"
+#line 1853 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1829 "configure"
+#line 1893 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1868 "configure"
+#line 1932 "configure"
#include "confdefs.h"
int main() { return 0; }
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1973 "configure"
+#line 2037 "configure"
#include "confdefs.h"
#include <tclInt.h>
EOF
else
cat > conftest.$ac_ext <<EOF
-#line 2030 "configure"
+#line 2094 "configure"
#include "confdefs.h"
#include <stdio.h>
ac_cv_c_tclib="-l$installedtcllibroot"
else
cat > conftest.$ac_ext <<EOF
-#line 2190 "configure"
+#line 2254 "configure"
#include "confdefs.h"
Tcl_AppInit()
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2306 "configure"
+#line 2370 "configure"
#include "confdefs.h"
#include <tk.h>
EOF
else
cat > conftest.$ac_ext <<EOF
-#line 2370 "configure"
+#line 2434 "configure"
#include "confdefs.h"
#include <stdio.h>
ac_cv_c_tklib="-l$installedtklibroot"
else
cat > conftest.$ac_ext <<EOF
-#line 2551 "configure"
+#line 2615 "configure"
#include "confdefs.h"
Tcl_AppInit()
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2598 "configure"
+#line 2662 "configure"
#include "confdefs.h"
int main() { return 0; }
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2636 "configure"
+#line 2700 "configure"
#include "confdefs.h"
int main() { return 0; }
AC_ARG_PROGRAM
AC_HEADER_STDC
-AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h)
+AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h)
AC_HEADER_STAT
+AC_MSG_CHECKING([for gregset_t type])
+AC_CACHE_VAL(gdb_have_gregset_t,
+[AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
+gdb_have_gregset_t=yes, gdb_have_gregset_t=no)])
+AC_MSG_RESULT($gdb_have_gregset_t)
+if test $gdb_have_gregset_t = yes; then
+ AC_DEFINE(HAVE_GREGSET_T)
+fi
+
+AC_MSG_CHECKING([for fpregset_t type])
+AC_CACHE_VAL(gdb_have_fpregset_t,
+[AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
+gdb_have_fpregset_t=yes, gdb_have_fpregset_t=no)])
+AC_MSG_RESULT($gdb_have_fpregset_t)
+if test $gdb_have_fpregset_t = yes; then
+ AC_DEFINE(HAVE_FPREGSET_T)
+fi
+
AC_FUNC_MMAP
dnl Handle optional features that can be enabled.
#include "defs.h"
#include <time.h>
+#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
+#endif
#include <fcntl.h>
#include <errno.h>
#include "gdb_string.h"
int which;
unsigned int reg_addr; /* Unused in this version */
{
+#if defined (HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T)
gregset_t gregset;
fpregset_t fpregset;
#endif
}
}
+#endif /* defined(HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T) */
}
\f
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#ifdef HAVE_SYS_PROCFS_H
+
#include "defs.h"
#include <sys/procfs.h>
*/
+#ifdef HAVE_GREGSET_T
+
/* This is a duplicate of the table in i386-xdep.c. */
static int regmap[] =
}
}
-#if defined (FP0_REGNUM)
+#endif /* HAVE_GREGSET_T */
+
+#if defined (FP0_REGNUM) && defined (HAVE_FPREGSET_T)
/* Given a pointer to a floating point register set in /proc format
(fpregset_t *), unpack the register contents and supply them as gdb's
/* FIXME: see m68k-tdep.c for an example, for the m68k. */
}
-#endif /* defined (FP0_REGNUM) */
+#endif /* defined (FP0_REGNUM) && defined (HAVE_FPREGSET_T) */
+
+#endif /* HAVE_SYS_PROCFS_H */