aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-07-27 21:18:50 +0000
committerDaniel Jacobowitz <drow@false.org>2008-07-27 21:18:50 +0000
commit064ef605afee6a947892bae4e77de5740b9c3292 (patch)
treea36cd5e792197549fea688751977432b3968be8b /gdb
parent57380f4e0bbdfa396ed068db6bd867b4fafd9925 (diff)
downloadgdb-064ef605afee6a947892bae4e77de5740b9c3292.zip
gdb-064ef605afee6a947892bae4e77de5740b9c3292.tar.gz
gdb-064ef605afee6a947892bae4e77de5740b9c3292.tar.bz2
* configure.ac: Check for the GNU/Linux ptrace signature.
* configure: Regenerated.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rwxr-xr-xgdb/configure92
-rw-r--r--gdb/configure.ac17
3 files changed, 108 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3dce7a7..37292bc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2008-07-27 Daniel Jacobowitz <dan@codesourcery.com>
+ * configure.ac: Check for the GNU/Linux ptrace signature.
+ * configure: Regenerated.
+
+2008-07-27 Daniel Jacobowitz <dan@codesourcery.com>
+
* linux-nat.c (resume_callback): Add more debugging output.
(linux_nat_has_pending_sigint): New function, based on
linux_nat_has_pending.
diff --git a/gdb/configure b/gdb/configure
index 139f7e1..09f59ba 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
@@ -20293,6 +20381,8 @@ done
: ${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
ac_save_IFS=$IFS; IFS=','
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 4b5fe78..32d0937 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