gdb: move ptrace.m4 to gdbsupport
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 26 Oct 2020 01:08:49 +0000 (21:08 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 26 Oct 2020 01:08:49 +0000 (21:08 -0400)
ptrace.m4, providing the GDB_AC_PTRACE autoconf macro, is used by gdb,
gdbserver and gdbsupport.  I think it would make sense to move it to
gdbsupport.

gdb/ChangeLog:

* acinclude.m4: Update ptrace.m4 path.
* ptrace.m4: Moved to gdbsupport.

gdbserver/ChangeLog:

* acinclude.m4: Update ptrace.m4 path.

gdbsupport/ChangeLog:

* Makefile.in: Re-generate.
* acinclude.m4: Update ptrace.m4 path.
* ptrace.m4: Move here.

Change-Id: I849c149fd5dd8c3b2b0af38654fb353e3727871b

gdb/ChangeLog
gdb/acinclude.m4
gdb/ptrace.m4 [deleted file]
gdbserver/ChangeLog
gdbserver/acinclude.m4
gdbsupport/ChangeLog
gdbsupport/Makefile.in
gdbsupport/acinclude.m4
gdbsupport/ptrace.m4 [new file with mode: 0644]

index 2606f871170bd6da769c674e9adee366a70d428e..d4d13c07b4c5fda253e88bb15da9e4a22bc72ee1 100644 (file)
@@ -1,3 +1,8 @@
+2020-10-25  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * acinclude.m4: Update ptrace.m4 path.
+       * ptrace.m4: Moved to gdbsupport.
+
 2020-10-24  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * symfile-mem.c (add_vsyscall_page): Use inferior parameter
index 6fbc88bb55cd3e28aca9c012ec34cc6ba7db4ec0..9aa32e6d1470d514fa7c7f871d0d272f0b10c8c1 100644 (file)
@@ -72,7 +72,7 @@ dnl For libiberty_INIT.
 m4_include(libiberty.m4)
 
 dnl For GDB_AC_PTRACE.
-m4_include(ptrace.m4)
+m4_include(../gdbsupport/ptrace.m4)
 
 m4_include(ax_cxx_compile_stdcxx.m4)
 
diff --git a/gdb/ptrace.m4 b/gdb/ptrace.m4
deleted file mode 100644 (file)
index 0fcd855..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-dnl Copyright (C) 2012-2020 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GDB.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-dnl Check the return and argument types of ptrace.
-
-AC_DEFUN([GDB_AC_PTRACE],
-[
-
-AC_CHECK_HEADERS([sys/ptrace.h ptrace.h])
-
-gdb_ptrace_headers='
-#include <sys/types.h>
-#if HAVE_SYS_PTRACE_H
-# include <sys/ptrace.h>
-#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-'
-
-# 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='enum __ptrace_request,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
-   for gdb_arg4 in 'int' 'long' 'void *'; do
-     AC_TRY_COMPILE($gdb_ptrace_headers, [
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
-], [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
-    break 4;])
-    for gdb_arg5 in 'int *' 'int' 'long'; do
-     AC_TRY_COMPILE($gdb_ptrace_headers, [
-extern $gdb_cv_func_ptrace_ret
-  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
-], [
-gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
-    break 5;])
-    done
-   done
-  done
- done
-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
-shift
-AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG1, $[1],
-  [Define to the type of arg 1 for ptrace.])
-AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG3, $[3],
-  [Define to the type of arg 3 for ptrace.])
-AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG4, $[4],
-  [Define to the type of arg 4 for ptrace.])
-if test -n "$[5]"; then
-  AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG5, $[5],
-    [Define to the type of arg 5 for ptrace.])
-fi
-])
index 74391ed137a6a6147dc8be2acd130dbf04b6f00f..a7eebfd7a712efe1ad8996ae96b1299acd4ebba8 100644 (file)
@@ -1,3 +1,7 @@
+2020-10-25  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * acinclude.m4: Update ptrace.m4 path.
+
 2020-10-24  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * config.in: Re-generate.
index a49be8dff81e1ffe17f979692d9a6251874586c9..f02a63cc70c33f0c19538d24255e76e1dd1435d3 100644 (file)
@@ -27,7 +27,7 @@ dnl For libiberty_INIT.
 m4_include(../gdb/libiberty.m4)
 
 dnl For GDB_AC_PTRACE.
-m4_include(../gdb/ptrace.m4)
+m4_include(../gdbsupport/ptrace.m4)
 
 m4_include(../gdb/ax_cxx_compile_stdcxx.m4)
 
index cd05d6adf75227b4d89f49f90037b64efa3583ee..759eea1296b58a34c11230c658e26cf2236c767b 100644 (file)
@@ -1,3 +1,9 @@
+2020-10-25  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * Makefile.in: Re-generate.
+       * acinclude.m4: Update ptrace.m4 path.
+       * ptrace.m4: Move here.
+
 2020-10-08  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * tdesc.h (allocate_target_description): Update return type.
index 044ef1555c276d1af78c828a56011b1a8409ffb3..ccfc27f43aedabab602c93e94a8ae88b5ed749b6 100644 (file)
@@ -123,7 +123,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/codeset.m4 \
        $(top_srcdir)/../config/ax_pthread.m4 \
        $(top_srcdir)/../gdb/ax_cxx_compile_stdcxx.m4 \
        $(top_srcdir)/../gdb/libiberty.m4 $(top_srcdir)/selftest.m4 \
-       $(top_srcdir)/../gdb/ptrace.m4 $(top_srcdir)/warning.m4 \
+       $(top_srcdir)/ptrace.m4 $(top_srcdir)/warning.m4 \
        $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
index 4c86c4f8de7698bf770421c38d1974ac63748659..cc9c2dcb32f8bcca810a1a03c795115acb08ee16 100644 (file)
@@ -4,7 +4,7 @@ m4_include([../config/ax_pthread.m4])
 m4_include([../gdb/ax_cxx_compile_stdcxx.m4])
 m4_include([../gdb/libiberty.m4])
 m4_include([selftest.m4])
-m4_include([../gdb/ptrace.m4])
+m4_include([ptrace.m4])
 
 dnl This gets AM_GDB_WARNINGS.
 m4_include(warning.m4)
diff --git a/gdbsupport/ptrace.m4 b/gdbsupport/ptrace.m4
new file mode 100644 (file)
index 0000000..0fcd855
--- /dev/null
@@ -0,0 +1,90 @@
+dnl Copyright (C) 2012-2020 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GDB.
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+dnl Check the return and argument types of ptrace.
+
+AC_DEFUN([GDB_AC_PTRACE],
+[
+
+AC_CHECK_HEADERS([sys/ptrace.h ptrace.h])
+
+gdb_ptrace_headers='
+#include <sys/types.h>
+#if HAVE_SYS_PTRACE_H
+# include <sys/ptrace.h>
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+'
+
+# 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='enum __ptrace_request,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
+   for gdb_arg4 in 'int' 'long' 'void *'; do
+     AC_TRY_COMPILE($gdb_ptrace_headers, [
+extern $gdb_cv_func_ptrace_ret
+  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
+], [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
+    break 4;])
+    for gdb_arg5 in 'int *' 'int' 'long'; do
+     AC_TRY_COMPILE($gdb_ptrace_headers, [
+extern $gdb_cv_func_ptrace_ret
+  ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
+], [
+gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
+    break 5;])
+    done
+   done
+  done
+ done
+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
+shift
+AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG1, $[1],
+  [Define to the type of arg 1 for ptrace.])
+AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG3, $[3],
+  [Define to the type of arg 3 for ptrace.])
+AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG4, $[4],
+  [Define to the type of arg 4 for ptrace.])
+if test -n "$[5]"; then
+  AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG5, $[5],
+    [Define to the type of arg 5 for ptrace.])
+fi
+])
This page took 0.038541 seconds and 4 git commands to generate.