aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-01-27 18:51:09 +0000
committerFred Fish <fnf@specifix.com>1996-01-27 18:51:09 +0000
commit4708ac6573eb1956616e58e6c936a05938f4915a (patch)
tree751d0488a58dc7b9dbb594d28c40c93e803c5100 /gdb
parent79edc8468f860448105028573e55426d205abf46 (diff)
downloadgdb-4708ac6573eb1956616e58e6c936a05938f4915a.zip
gdb-4708ac6573eb1956616e58e6c936a05938f4915a.tar.gz
gdb-4708ac6573eb1956616e58e6c936a05938f4915a.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog23
-rw-r--r--gdb/config/i386/xm-linux.h14
-rwxr-xr-xgdb/configure100
-rw-r--r--gdb/configure.in20
-rw-r--r--gdb/core-regset.c4
-rw-r--r--gdb/i386v4-nat.c12
6 files changed, 152 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9b53d13..e6e7546 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,26 @@
+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.
diff --git a/gdb/config/i386/xm-linux.h b/gdb/config/i386/xm-linux.h
index be35056..3fbd88bb 100644
--- a/gdb/config/i386/xm-linux.h
+++ b/gdb/config/i386/xm-linux.h
@@ -17,6 +17,9 @@ 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. */
+#ifndef XM_LINUX_H
+#define XM_LINUX_H
+
#define HOST_BYTE_ORDER LITTLE_ENDIAN
#define HAVE_TERMIOS
@@ -29,3 +32,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* 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 */
diff --git a/gdb/configure b/gdb/configure
index eab894c..6e7b7f3 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -1139,7 +1139,7 @@ EOF
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
@@ -1231,6 +1231,70 @@ EOF
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
@@ -1238,7 +1302,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
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. */
@@ -1290,7 +1354,7 @@ else
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. */
@@ -1524,7 +1588,7 @@ test -z "$x_direct_test_library" && x_direct_test_library=Xt
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
@@ -1587,7 +1651,7 @@ rm -f conftest*
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; }
@@ -1706,7 +1770,7 @@ else
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; }
@@ -1750,7 +1814,7 @@ else
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; }
@@ -1785,7 +1849,7 @@ else
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; }
@@ -1825,7 +1889,7 @@ else
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; }
@@ -1864,7 +1928,7 @@ else
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; }
@@ -1969,7 +2033,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
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
@@ -2026,7 +2090,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 2030 "configure"
+#line 2094 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2186,7 +2250,7 @@ else
ac_cv_c_tclib="-l$installedtcllibroot"
else
cat > conftest.$ac_ext <<EOF
-#line 2190 "configure"
+#line 2254 "configure"
#include "confdefs.h"
Tcl_AppInit()
@@ -2302,7 +2366,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
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
@@ -2366,7 +2430,7 @@ if test "$cross_compiling" = yes; then
else
cat > conftest.$ac_ext <<EOF
-#line 2370 "configure"
+#line 2434 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2547,7 +2611,7 @@ else
ac_cv_c_tklib="-l$installedtklibroot"
else
cat > conftest.$ac_ext <<EOF
-#line 2551 "configure"
+#line 2615 "configure"
#include "confdefs.h"
Tcl_AppInit()
@@ -2594,7 +2658,7 @@ else
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; }
@@ -2632,7 +2696,7 @@ else
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; }
diff --git a/gdb/configure.in b/gdb/configure.in
index c29cb2c..d3285bb 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -36,9 +36,27 @@ AC_CANONICAL_SYSTEM
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.
diff --git a/gdb/core-regset.c b/gdb/core-regset.c
index 5e10996..68b0845 100644
--- a/gdb/core-regset.c
+++ b/gdb/core-regset.c
@@ -35,7 +35,9 @@ regardless of whether or not the actual target has floating point hardware.
#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"
@@ -77,6 +79,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
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;
@@ -106,6 +109,7 @@ fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
#endif
}
}
+#endif /* defined(HAVE_GREGSET_T) && defined (HAVE_FPREGSET_T) */
}
diff --git a/gdb/i386v4-nat.c b/gdb/i386v4-nat.c
index 1f1d38b..5febaf7 100644
--- a/gdb/i386v4-nat.c
+++ b/gdb/i386v4-nat.c
@@ -17,6 +17,8 @@ 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. */
+#ifdef HAVE_SYS_PROCFS_H
+
#include "defs.h"
#include <sys/procfs.h>
@@ -64,6 +66,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
*/
+#ifdef HAVE_GREGSET_T
+
/* This is a duplicate of the table in i386-xdep.c. */
static int regmap[] =
@@ -118,7 +122,9 @@ fill_gregset (gregsetp, regno)
}
}
-#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
@@ -151,4 +157,6 @@ fill_fpregset (fpregsetp, regno)
/* 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 */