From 064ef605afee6a947892bae4e77de5740b9c3292 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Sun, 27 Jul 2008 21:18:50 +0000 Subject: [PATCH] * configure.ac: Check for the GNU/Linux ptrace signature. * configure: Regenerated. --- gdb/ChangeLog | 5 +++ gdb/configure | 92 +++++++++++++++++++++++++++++++++++++++++++++++- gdb/configure.ac | 17 ++++++--- 3 files changed, 108 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3dce7a7ef46..37292bc6849 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-07-27 Daniel Jacobowitz + + * configure.ac: Check for the GNU/Linux ptrace signature. + * configure: Regenerated. + 2008-07-27 Daniel Jacobowitz * linux-nat.c (resume_callback): Add more debugging output. diff --git a/gdb/configure b/gdb/configure index 139f7e1a8b9..09f59baeaaf 100755 --- a/gdb/configure +++ b/gdb/configure @@ -20116,7 +20116,8 @@ _ACEOF fi -# Check return type. +# Check return type. Varargs (used on GNU/Linux) conflict with the +# empty argument list, so check for that explicitly. echo "$as_me:$LINENO: checking return type of ptrace" >&5 echo $ECHO_N "checking return type of ptrace... $ECHO_C" >&6 if test "${gdb_cv_func_ptrace_ret+set}" = set; then @@ -20132,6 +20133,48 @@ $gdb_ptrace_headers int main () { +extern long ptrace (enum __ptrace_request, ...); + ; + 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 + gdb_cv_func_ptrace_ret='long' +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. */ +$gdb_ptrace_headers +int +main () +{ extern int ptrace (); ; return 0; @@ -20168,6 +20211,8 @@ gdb_cv_func_ptrace_ret='long' 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_func_ptrace_ret" >&5 echo "${ECHO_T}$gdb_cv_func_ptrace_ret" >&6 @@ -20182,6 +20227,49 @@ if test "${gdb_cv_func_ptrace_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$gdb_ptrace_headers +int +main () +{ +extern long ptrace (enum __ptrace_request, ...); + ; + 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 + gdb_cv_func_ptrace_args='int,int,long,long' +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for gdb_arg1 in 'int' 'long'; do for gdb_arg2 in 'pid_t' 'int' 'long'; do for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do @@ -20292,6 +20380,8 @@ done # Provide a safe default value. : ${gdb_cv_func_ptrace_args='int,int,long,long'} +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gdb_cv_func_ptrace_args" >&5 echo "${ECHO_T}$gdb_cv_func_ptrace_args" >&6 diff --git a/gdb/configure.ac b/gdb/configure.ac index 4b5fe786610..32d09379304 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -643,16 +643,23 @@ AC_CHECK_DECLS(ptrace, [], [ : ${gdb_cv_func_ptrace_ret='int'} : ${gdb_cv_func_ptrace_args='int,int,long,long'} ], $gdb_ptrace_headers) -# Check return type. +# Check return type. Varargs (used on GNU/Linux) conflict with the +# empty argument list, so check for that explicitly. AC_CACHE_CHECK([return type of ptrace], gdb_cv_func_ptrace_ret, AC_TRY_COMPILE($gdb_ptrace_headers, - [extern int ptrace ();], - gdb_cv_func_ptrace_ret='int', - gdb_cv_func_ptrace_ret='long')) + [extern long ptrace (enum __ptrace_request, ...);], + gdb_cv_func_ptrace_ret='long', + AC_TRY_COMPILE($gdb_ptrace_headers, + [extern int ptrace ();], + gdb_cv_func_ptrace_ret='int', + gdb_cv_func_ptrace_ret='long'))) AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret, [Define as the return type of ptrace.]) # Check argument types. AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [ + AC_TRY_COMPILE($gdb_ptrace_headers, + [extern long ptrace (enum __ptrace_request, ...);], + [gdb_cv_func_ptrace_args='int,int,long,long'],[ for gdb_arg1 in 'int' 'long'; do for gdb_arg2 in 'pid_t' 'int' 'long'; do for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do @@ -676,7 +683,7 @@ gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5"; done # Provide a safe default value. : ${gdb_cv_func_ptrace_args='int,int,long,long'} -]) +])]) ac_save_IFS=$IFS; IFS=',' set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS -- 2.30.2