This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Bad ptrace test in gdb/configure.ac
- From: Pedro Alves <palves at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GDB <gdb at sourceware dot org>
- Date: Thu, 08 Mar 2012 15:13:18 +0000
- Subject: Re: Bad ptrace test in gdb/configure.ac
- References: <CAMe9rOqbpY5NSZ9_=u91XCdm+A62Rd1N3N_sLebwn4bgduesqg@mail.gmail.com>
On 02/16/2012 07:23 PM, H.J. Lu wrote:
> 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, ...);],
Makes sense to me.
--
Pedro Alves