This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Bad ptrace test in gdb/configure.ac
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GDB <gdb at sourceware dot org>
- Date: Thu, 16 Feb 2012 11:23:15 -0800
- Subject: Bad ptrace test in gdb/configure.ac
gdb/configure.ac has
# 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 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'],[
It first detects the return type of ptrace. Right after that, it uses
long as return
type for ptrace when detecting its arguments. I think it should use
[extern $gdb_cv_func_ptrace_ret ptrace (enum __ptrace_request, ...);],
instead of
[extern long ptrace (enum __ptrace_request, ...);],
--
H.J.