From 5c45e068d75b49e595bc60f84d223b83ffaac4d8 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 21 Jan 2005 13:49:22 +0000 Subject: [PATCH] * acconfig.h (HAVE_STRUCT_REG_R_FS, HAVE_STRUCT_R_GS): Remove undefs. * configure.ac: Use AC_CHECK_MEMBERS to check whether `struct thread' has a td_pcb member and whether `struct reg' has r_fs and r_gs members. * configure, config.in: Regenerate. --- gdb/ChangeLog | 9 ++ gdb/acconfig.h | 6 -- gdb/config.in | 14 +-- gdb/configure | 222 ++++++++++++++++++++++++++++++++++++++++------- gdb/configure.ac | 28 ++---- 5 files changed, 214 insertions(+), 65 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d5fe71e31d..1ca68e250f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2005-01-21 Mark Kettenis + + * acconfig.h (HAVE_STRUCT_REG_R_FS, HAVE_STRUCT_R_GS): Remove + undefs. + * configure.ac: Use AC_CHECK_MEMBERS to check whether `struct + thread' has a td_pcb member and whether `struct reg' has r_fs and + r_gs members. + * configure, config.in: Regenerate. + 2005-01-21 Mark Kettenis * configure.ac: Remove ia64-*-aix* junk. diff --git a/gdb/acconfig.h b/gdb/acconfig.h index 01e3b3fdcb..e625697e1c 100644 --- a/gdb/acconfig.h +++ b/gdb/acconfig.h @@ -3,12 +3,6 @@ # undef _GNU_SOURCE #endif -/* Define if your struct reg has r_fs. */ -#undef HAVE_STRUCT_REG_R_FS - -/* Define if your struct reg has r_gs. */ -#undef HAVE_STRUCT_REG_R_GS - /* Define if pstatus_t type is available */ #undef HAVE_PSTATUS_T diff --git a/gdb/config.in b/gdb/config.in index 63b9e6187c..9c6414a369 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -4,12 +4,6 @@ # undef _GNU_SOURCE #endif -/* Define if your struct reg has r_fs. */ -#undef HAVE_STRUCT_REG_R_FS - -/* Define if your struct reg has r_gs. */ -#undef HAVE_STRUCT_REG_R_GS - /* Define if pstatus_t type is available */ #undef HAVE_PSTATUS_T @@ -457,10 +451,16 @@ /* Define to 1 if your system has struct reg in . */ #undef HAVE_STRUCT_REG +/* Define to 1 if `r_fs' is member of `struct reg'. */ +#undef HAVE_STRUCT_REG_R_FS + +/* Define to 1 if `r_gs' is member of `struct reg'. */ +#undef HAVE_STRUCT_REG_R_GS + /* Define to 1 if `st_blocks' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLOCKS -/* Define to 1 if your system has td_pcb in struct thread. */ +/* Define to 1 if `td_pcb' is member of `struct thread'. */ #undef HAVE_STRUCT_THREAD_TD_PCB /* Define to 1 if you have the `syscall' function. */ diff --git a/gdb/configure b/gdb/configure index 38fef3fbf1..d22a2df3ff 100755 --- a/gdb/configure +++ b/gdb/configure @@ -16746,10 +16746,10 @@ _ACEOF fi -# See if defines `struct thread' with a td_pcb member. -echo "$as_me:$LINENO: checking for td_pcb in struct thread" >&5 -echo $ECHO_N "checking for td_pcb in struct thread... $ECHO_C" >&6 -if test "${gdb_cv_struct_thread_td_pcb+set}" = set; then +# Check if defines `struct thread' with a td_pcb member. +echo "$as_me:$LINENO: checking for struct thread.td_pcb" >&5 +echo $ECHO_N "checking for struct thread.td_pcb... $ECHO_C" >&6 +if test "${ac_cv_member_struct_thread_td_pcb+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -16760,10 +16760,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + + int main () { -struct thread td; td.td_pcb; +static struct thread ac_aggr; +if (ac_aggr.td_pcb) +return 0; ; return 0; } @@ -16790,25 +16794,76 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gdb_cv_struct_thread_td_pcb=yes + ac_cv_member_struct_thread_td_pcb=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gdb_cv_struct_thread_td_pcb=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + + +int +main () +{ +static struct thread ac_aggr; +if (sizeof ac_aggr.td_pcb) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_thread_td_pcb=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_member_struct_thread_td_pcb=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gdb_cv_struct_thread_td_pcb" >&5 -echo "${ECHO_T}$gdb_cv_struct_thread_td_pcb" >&6 -if test $gdb_cv_struct_thread_td_pcb = yes; then +echo "$as_me:$LINENO: result: $ac_cv_member_struct_thread_td_pcb" >&5 +echo "${ECHO_T}$ac_cv_member_struct_thread_td_pcb" >&6 +if test $ac_cv_member_struct_thread_td_pcb = yes; then -cat >>confdefs.h <<\_ACEOF +cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_THREAD_TD_PCB 1 _ACEOF + fi + # See if defines `struct lwp`. echo "$as_me:$LINENO: checking for struct lwp" >&5 echo $ECHO_N "checking for struct lwp... $ECHO_C" >&6 @@ -16937,9 +16992,9 @@ fi # See if supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. -echo "$as_me:$LINENO: checking for r_fs in struct reg" >&5 -echo $ECHO_N "checking for r_fs in struct reg... $ECHO_C" >&6 -if test "${gdb_cv_struct_reg_r_fs+set}" = set; then +echo "$as_me:$LINENO: checking for struct reg.r_fs" >&5 +echo $ECHO_N "checking for struct reg.r_fs... $ECHO_C" >&6 +if test "${ac_cv_member_struct_reg_r_fs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -16949,10 +17004,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include + +int +main () +{ +static struct reg ac_aggr; +if (ac_aggr.r_fs) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_reg_r_fs=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + int main () { -struct reg r; r.r_fs; +static struct reg ac_aggr; +if (sizeof ac_aggr.r_fs) +return 0; ; return 0; } @@ -16979,26 +17082,30 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gdb_cv_struct_reg_r_fs=yes + ac_cv_member_struct_reg_r_fs=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gdb_cv_struct_reg_r_fs=no +ac_cv_member_struct_reg_r_fs=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gdb_cv_struct_reg_r_fs" >&5 -echo "${ECHO_T}$gdb_cv_struct_reg_r_fs" >&6 -if test $gdb_cv_struct_reg_r_fs = yes; then - cat >>confdefs.h <<\_ACEOF +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_reg_r_fs" >&5 +echo "${ECHO_T}$ac_cv_member_struct_reg_r_fs" >&6 +if test $ac_cv_member_struct_reg_r_fs = yes; then + +cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_REG_R_FS 1 _ACEOF + fi -echo "$as_me:$LINENO: checking for r_gs in struct reg" >&5 -echo $ECHO_N "checking for r_gs in struct reg... $ECHO_C" >&6 -if test "${gdb_cv_struct_reg_r_gs+set}" = set; then +echo "$as_me:$LINENO: checking for struct reg.r_gs" >&5 +echo $ECHO_N "checking for struct reg.r_gs... $ECHO_C" >&6 +if test "${ac_cv_member_struct_reg_r_gs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -17008,10 +17115,13 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include + int main () { -struct reg r; r.r_gs; +static struct reg ac_aggr; +if (ac_aggr.r_gs) +return 0; ; return 0; } @@ -17038,24 +17148,74 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - gdb_cv_struct_reg_r_gs=yes + ac_cv_member_struct_reg_r_gs=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gdb_cv_struct_reg_r_gs=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +static struct reg ac_aggr; +if (sizeof ac_aggr.r_gs) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_reg_r_gs=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_member_struct_reg_r_gs=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $gdb_cv_struct_reg_r_gs" >&5 -echo "${ECHO_T}$gdb_cv_struct_reg_r_gs" >&6 -if test $gdb_cv_struct_reg_r_gs = yes; then - cat >>confdefs.h <<\_ACEOF +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_reg_r_gs" >&5 +echo "${ECHO_T}$ac_cv_member_struct_reg_r_gs" >&6 +if test $ac_cv_member_struct_reg_r_gs = yes; then + +cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_REG_R_GS 1 _ACEOF + fi + # See if provides the PTRACE_GETREGS request. echo "$as_me:$LINENO: checking for PTRACE_GETREGS" >&5 echo $ECHO_N "checking for PTRACE_GETREGS... $ECHO_C" >&6 diff --git a/gdb/configure.ac b/gdb/configure.ac index d51b0a567c..e30e4af6f4 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -589,15 +589,11 @@ if test "$gdb_with_regex" = yes; then [Define to 1 if the regex included in libiberty should be used.]) fi -# See if defines `struct thread' with a td_pcb member. -AC_CACHE_CHECK([for td_pcb in struct thread], gdb_cv_struct_thread_td_pcb, -[AC_TRY_COMPILE([#include -#include ], [struct thread td; td.td_pcb;], -gdb_cv_struct_thread_td_pcb=yes, gdb_cv_struct_thread_td_pcb=no)]) -if test $gdb_cv_struct_thread_td_pcb = yes; then - AC_DEFINE(HAVE_STRUCT_THREAD_TD_PCB, 1, - [Define to 1 if your system has td_pcb in struct thread.]) -fi +# Check if defines `struct thread' with a td_pcb member. +AC_CHECK_MEMBERS([struct thread.td_pcb], [], [], +[#include +#include +]) # See if defines `struct lwp`. AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp, @@ -621,18 +617,8 @@ fi # See if supports the %fs and %gs i386 segment registers. # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. -AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs, -[AC_TRY_COMPILE([#include ], [struct reg r; r.r_fs;], -gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)]) -if test $gdb_cv_struct_reg_r_fs = yes; then - AC_DEFINE(HAVE_STRUCT_REG_R_FS) -fi -AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs, -[AC_TRY_COMPILE([#include ], [struct reg r; r.r_gs;], -gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)]) -if test $gdb_cv_struct_reg_r_gs = yes; then - AC_DEFINE(HAVE_STRUCT_REG_R_GS) -fi +AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [], + [#include ]) # See if provides the PTRACE_GETREGS request. AC_MSG_CHECKING(for PTRACE_GETREGS) -- 2.34.1