public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Bad ptrace test in gdb/configure.ac
@ 2012-02-16 19:23 H.J. Lu
  2012-03-08 15:13 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2012-02-16 19:23 UTC (permalink / raw)
  To: GDB

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bad ptrace test in gdb/configure.ac
  2012-02-16 19:23 Bad ptrace test in gdb/configure.ac H.J. Lu
@ 2012-03-08 15:13 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2012-03-08 15:13 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-08 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 19:23 Bad ptrace test in gdb/configure.ac H.J. Lu
2012-03-08 15:13 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).