From 4708ac6573eb1956616e58e6c936a05938f4915a Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Sat, 27 Jan 1996 18:51:09 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 23 +++++++++ gdb/config/i386/xm-linux.h | 14 ++++++ gdb/configure | 100 ++++++++++++++++++++++++++++++------- gdb/configure.in | 20 +++++++- gdb/core-regset.c | 4 ++ gdb/i386v4-nat.c | 12 ++++- 6 files changed, 152 insertions(+), 21 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9b53d1395c8..e6e7546939e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,26 @@ +Sat Jan 27 10:34:05 1996 Fred Fish + + * 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 * 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 be350560ec2..3fbd88bba01 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 + + +/* + * 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 eab894c131a..6e7b7f3aae3 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 < +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 < +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 < conftest.$ac_ext < conftest.$ac_ext < EOF @@ -1587,7 +1651,7 @@ rm -f conftest* ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < EOF @@ -2026,7 +2090,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < @@ -2186,7 +2250,7 @@ else ac_cv_c_tclib="-l$installedtcllibroot" else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < EOF @@ -2366,7 +2430,7 @@ if test "$cross_compiling" = yes; then else cat > conftest.$ac_ext < @@ -2547,7 +2611,7 @@ else ac_cv_c_tklib="-l$installedtklibroot" else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <],[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 ],[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 5e10996cdda..68b08457a49 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 +#ifdef HAVE_SYS_PROCFS_H #include +#endif #include #include #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 1f1d38b7eaf..5febaf7f8d1 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 @@ -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 */ -- 2.30.2