2013-08-07 Raunaq Bathija <raunaq12@in.ibm.com>
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 7 Aug 2013 14:39:57 +0000 (14:39 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Wed, 7 Aug 2013 14:39:57 +0000 (14:39 +0000)
    Ulrich Weigand  <uweigand@de.ibm.com>

* gdb_ptrace.h: Use ptrace64 instead of ptrace if HAVE_PTRACE64
is defined.
* rs6000-nat.c: Check for __ld_info64_ if compiling 64 BIT gdb.
(rs6000_ptrace32): Call ptrace64 instead of ptrace if present.
(rs6000_ptrace64): Call ptace64 instead of ptracex if present.
* configure.ac: Check for ptrace64.
* configure, config.in: Regenerate.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/gdb_ptrace.h
gdb/rs6000-nat.c

index 67f5cd477717857e4c0fbd3de3be8136a244eb2c..e93af27ea01f2d5035388fcc67d13898dc837cf4 100644 (file)
@@ -1,3 +1,14 @@
+2013-08-07  Raunaq Bathija  <raunaq12@in.ibm.com>
+           Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * gdb_ptrace.h: Use ptrace64 instead of ptrace if HAVE_PTRACE64
+       is defined.
+       * rs6000-nat.c: Check for __ld_info64_ if compiling 64 BIT gdb.
+       (rs6000_ptrace32): Call ptrace64 instead of ptrace if present.
+       (rs6000_ptrace64): Call ptace64 instead of ptracex if present.
+       * configure.ac: Check for ptrace64.
+       * configure, config.in: Regenerate.
+
 2013-08-07  Raunaq Bathija  <raunaq12@in.ibm.com>
            Ulrich Weigand  <uweigand@de.ibm.com>
 
index 92c278978f38ff8c2cdafa17f1460e97c9653db5..76abd04a09dce9e93af5b5d571670ba84d17c7b6 100644 (file)
 /* Define if <sys/procfs.h> has pstatus_t. */
 #undef HAVE_PSTATUS_T
 
+/* Define to 1 if you have the `ptrace64' function. */
+#undef HAVE_PTRACE64
+
 /* Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request. */
 #undef HAVE_PTRACE_GETFPXREGS
 
index 4833297971af92a14c99f4a00b70527b07559272..80678256bfab7990d036d0f9dad3ff1520e720d4 100755 (executable)
@@ -10181,7 +10181,7 @@ for ac_func in canonicalize_file_name realpath getrusage getuid getgid \
                sigaction sigprocmask sigsetmask socketpair syscall \
                ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
                setrlimit getrlimit posix_madvise waitpid lstat \
-               fdwalk pipe2
+               fdwalk pipe2 ptrace64
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
index 48f37c89c7147c401031ca3cefdcd76622a2c45d..667821f1ecc1064ec54e44a538544db2917a2f38 100644 (file)
@@ -1166,7 +1166,7 @@ AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid getgid \
                sigaction sigprocmask sigsetmask socketpair syscall \
                ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
                setrlimit getrlimit posix_madvise waitpid lstat \
-               fdwalk pipe2])
+               fdwalk pipe2 ptrace64])
 AM_LANGINFO_CODESET
 
 # Check the return and argument types of ptrace.  No canned test for
index 5c2a43314dca8eddeddcbdb18b5ad78c837cfa0e..053a7185861b370ced050362aa261da621dc7c49 100644 (file)
@@ -135,7 +135,15 @@ extern PTRACE_TYPE_RET ptrace();
    zero.  */
 
 #ifdef PTRACE_TYPE_ARG5
-# define ptrace(request, pid, addr, data) ptrace (request, pid, addr, data, 0)
+# ifdef HAVE_PTRACE64
+#  define ptrace(request, pid, addr, data) \
+          ptrace64 (request, pid, addr, data, 0)
+#  undef PTRACE_TYPE_ARG3
+#  define PTRACE_TYPE_ARG3 long long
+# else
+#  define ptrace(request, pid, addr, data) \
+          ptrace (request, pid, addr, data, 0)
+# endif
 #endif
 
 #endif /* gdb_ptrace.h */
index 676961815413141a9a85b541fe62bb16347b2aae..0953356d7f33775abd4a8eb9e87e5fda35a505a6 100644 (file)
@@ -65,7 +65,7 @@
 /* In 32-bit compilation mode (which is the only mode from which ptrace()
    works on 4.3), __ld_info32 is #defined as equivalent to ld_info.  */
 
-#ifdef __ld_info32
+#if defined (__ld_info32) || defined (__ld_info64)
 # define ARCH3264
 #endif
 
@@ -131,7 +131,11 @@ regmap (struct gdbarch *gdbarch, int regno, int *isfloat)
 static int
 rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf)
 {
+  #ifdef HAVE_PTRACE64
+  int ret = ptrace64 (req, id, (long long) addr, data, buf);
+  #else
   int ret = ptrace (req, id, (int *)addr, data, buf);
+  #endif
 #if 0
   printf ("rs6000_ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
          req, id, (unsigned int)addr, data, (unsigned int)buf, ret);
@@ -145,7 +149,11 @@ static int
 rs6000_ptrace64 (int req, int id, long long addr, int data, void *buf)
 {
 #ifdef ARCH3264
+  #ifdef HAVE_PTRACE64
+  int ret = ptrace64 (req, id, addr, data, buf);
+  #else
   int ret = ptracex (req, id, addr, data, buf);
+  #endif
 #else
   int ret = 0;
 #endif
This page took 0.03837 seconds and 4 git commands to generate.