Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* patch, Aix 5.1 ptrace64 build failure
@ 2002-03-18 11:33 Tom Rix
  2002-03-20 13:18 ` Kevin Buettner
  2002-03-20 13:36 ` Peter.Schauer
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Rix @ 2002-03-18 11:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: kevinb

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

Gdb fails to build on AIX 5.1 because the system has already defined
ptrace64.

This patch prefixes the rs6000-nat.c ptrace32 and ptrace64 functions
with gdb_rs6000_ to fix this problem.

Ok  to commit?

Tom

--
Tom Rix
GCC Engineer
trix@redhat.com



[-- Attachment #2: gdb-ptrace-001fa.patch --]
[-- Type: text/plain, Size: 5227 bytes --]

2002-03-18  Tom Rix  <trix@redhat.com>

	* rs6000-nat.c: Replace ptrace[32|64] with gdb_rs6000_ptrace[32|64].

diff -rup src-old/gdb/rs6000-nat.c src/gdb/rs6000-nat.c
--- src-old/gdb/rs6000-nat.c	Mon Mar 18 14:07:34 2002
+++ src/gdb/rs6000-nat.c	Mon Mar 18 14:15:13 2002
@@ -160,11 +160,11 @@ static int special_regs[] =
 /* Call ptrace(REQ, ID, ADDR, DATA, BUF). */
 
 static int
-ptrace32 (int req, int id, int *addr, int data, int *buf)
+gdb_rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf)
 {
   int ret = ptrace (req, id, (int *)addr, data, buf);
 #if 0
-  printf ("ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
+  printf ("gdb_rs6000_ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
 	  req, id, (unsigned int)addr, data, (unsigned int)buf, ret);
 #endif
   return ret;
@@ -173,7 +173,7 @@ ptrace32 (int req, int id, int *addr, in
 /* Call ptracex(REQ, ID, ADDR, DATA, BUF). */
 
 static int
-ptrace64 (int req, int id, long long addr, int data, int *buf)
+gdb_rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
 {
 #ifdef ARCH3264
   int ret = ptracex (req, id, addr, data, buf);
@@ -181,7 +181,7 @@ ptrace64 (int req, int id, long long add
   int ret = 0;
 #endif
 #if 0
-  printf ("ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n",
+  printf ("gdb_rs6000_ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n",
 	  req, id, addr, data, (unsigned int)buf, ret);
 #endif
   return ret;
@@ -202,7 +202,7 @@ fetch_register (int regno)
   if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
     {
       nr = regno - FP0_REGNUM + FPR0;
-      ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
+      gdb_rs6000_ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
     }
 
   /* Bogus register number. */
@@ -223,13 +223,13 @@ fetch_register (int regno)
 	nr = regno;
 
       if (!ARCH64 ())
-	*addr = ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
+	*addr = gdb_rs6000_ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
       else
 	{
 	  /* PT_READ_GPR requires the buffer parameter to point to long long,
 	     even if the register is really only 32 bits. */
 	  long long buf;
-	  ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
+	  gdb_rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
 	  if (REGISTER_RAW_SIZE (regno) == 8)
 	    memcpy (addr, &buf, 8);
 	  else
@@ -264,7 +264,7 @@ store_register (int regno)
   if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
     {
       nr = regno - FP0_REGNUM + FPR0;
-      ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
+      gdb_rs6000_ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
     }
 
   /* Bogus register number. */
@@ -293,7 +293,7 @@ store_register (int regno)
 	nr = regno;
 
       if (!ARCH64 ())
-	ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
+	gdb_rs6000_ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
       else
 	{
 	  /* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
@@ -303,7 +303,7 @@ store_register (int regno)
 	    memcpy (&buf, addr, 8);
 	  else
 	    buf = *addr;
-	  ptrace64 (PT_WRITE_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
+	  gdb_rs6000_ptrace64 (PT_WRITE_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
 	}
     }
 
@@ -377,9 +377,9 @@ read_word (CORE_ADDR from, int *to, int 
   errno = 0;
 
   if (arch64)
-    *to = ptrace64 (PT_READ_I, PIDGET (inferior_ptid), from, 0, NULL);
+    *to = gdb_rs6000_ptrace64 (PT_READ_I, PIDGET (inferior_ptid), from, 0, NULL);
   else
-    *to = ptrace32 (PT_READ_I, PIDGET (inferior_ptid), (int *)(long) from,
+    *to = gdb_rs6000_ptrace32 (PT_READ_I, PIDGET (inferior_ptid), (int *)(long) from,
                     0, NULL);
 
   return !errno;
@@ -449,9 +449,9 @@ child_xfer_memory (CORE_ADDR memaddr, ch
       for (i = 0, errno = 0; i < count; i++, addr += sizeof (int))
 	{
 	  if (arch64)
-	    ptrace64 (PT_WRITE_D, PIDGET (inferior_ptid), addr, buf[i], NULL);
+	    gdb_rs6000_ptrace64 (PT_WRITE_D, PIDGET (inferior_ptid), addr, buf[i], NULL);
 	  else
-	    ptrace32 (PT_WRITE_D, PIDGET (inferior_ptid), (int *)(long) addr,
+	    gdb_rs6000_ptrace32 (PT_WRITE_D, PIDGET (inferior_ptid), (int *)(long) addr,
 		      buf[i], NULL);
 
 	  if (errno)
@@ -490,9 +490,9 @@ exec_one_dummy_insn (void)
   prev_pc = read_pc ();
   write_pc (DUMMY_INSN_ADDR);
   if (ARCH64 ())
-    ret = ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
+    ret = gdb_rs6000_ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
   else
-    ret = ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
+    ret = gdb_rs6000_ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
 
   if (ret != 0)
     perror ("pt_continue");
@@ -987,9 +987,9 @@ xcoff_relocate_symtab (unsigned int pid)
 #endif
 
       if (arch64)
-	rc = ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, size, NULL);
+	rc = gdb_rs6000_ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, size, NULL);
       else
-	rc = ptrace32 (PT_LDINFO, pid, (int *) ldi, size, NULL);
+	rc = gdb_rs6000_ptrace32 (PT_LDINFO, pid, (int *) ldi, size, NULL);
 
       if (rc == -1)
         {

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

* Re: patch, Aix 5.1 ptrace64 build failure
  2002-03-18 11:33 patch, Aix 5.1 ptrace64 build failure Tom Rix
@ 2002-03-20 13:18 ` Kevin Buettner
  2002-03-20 13:36 ` Peter.Schauer
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Buettner @ 2002-03-20 13:18 UTC (permalink / raw)
  To: Tom Rix, gdb-patches; +Cc: kevinb

On Mar 18,  2:31pm, Tom Rix wrote:

> Gdb fails to build on AIX 5.1 because the system has already defined
> ptrace64.
> 
> This patch prefixes the rs6000-nat.c ptrace32 and ptrace64 functions
> with gdb_rs6000_ to fix this problem.
> 
> Ok  to commit?

Yes, approved.  The only thing I want you to change is the ChangeLog
entry...

> 2002-03-18  Tom Rix  <trix@redhat.com>
> 
> 	* rs6000-nat.c: Replace ptrace[32|64] with gdb_rs6000_ptrace[32|64].

Please spell out ptrace32() and ptrace64() instead of using ptrace[32|64].
(Likewise for gdb_rs6000_ptrace32() and gdb_rs6000_ptrace64().)  The reason
for this is so that a grep for ptrace32 (or one of the other strings) in
the ChangeLogs will turn up these entries.

Thanks,

Kevin


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

* Re: patch, Aix 5.1 ptrace64 build failure
  2002-03-18 11:33 patch, Aix 5.1 ptrace64 build failure Tom Rix
  2002-03-20 13:18 ` Kevin Buettner
@ 2002-03-20 13:36 ` Peter.Schauer
  2002-03-20 16:22   ` Kevin Buettner
  1 sibling, 1 reply; 4+ messages in thread
From: Peter.Schauer @ 2002-03-20 13:36 UTC (permalink / raw)
  To: Tom Rix; +Cc: gdb-patches, kevinb

Looks ok to me, but I'd prefer a rs6000_ prefix over gdb_rs6000_ to keep the
code in line with the rest of GDB.

> This is a multi-part message in MIME format.
> --------------8C5DA08590FB4C86F9BEB5FC
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 
> Gdb fails to build on AIX 5.1 because the system has already defined
> ptrace64.
> 
> This patch prefixes the rs6000-nat.c ptrace32 and ptrace64 functions
> with gdb_rs6000_ to fix this problem.
> 
> Ok  to commit?
> 
> Tom
> 
> --
> Tom Rix
> GCC Engineer
> trix@redhat.com
> 
> 
> 
> --------------8C5DA08590FB4C86F9BEB5FC
> Content-Type: text/plain; charset=us-ascii;
>  name="gdb-ptrace-001fa.patch"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="gdb-ptrace-001fa.patch"
> 
> 2002-03-18  Tom Rix  <trix@redhat.com>
> 
> 	* rs6000-nat.c: Replace ptrace[32|64] with gdb_rs6000_ptrace[32|64].
> 
> diff -rup src-old/gdb/rs6000-nat.c src/gdb/rs6000-nat.c
> --- src-old/gdb/rs6000-nat.c	Mon Mar 18 14:07:34 2002
> +++ src/gdb/rs6000-nat.c	Mon Mar 18 14:15:13 2002
> @@ -160,11 +160,11 @@ static int special_regs[] =
>  /* Call ptrace(REQ, ID, ADDR, DATA, BUF). */
>  
>  static int
> -ptrace32 (int req, int id, int *addr, int data, int *buf)
> +gdb_rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf)
>  {
>    int ret = ptrace (req, id, (int *)addr, data, buf);
>  #if 0
> -  printf ("ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
> +  printf ("gdb_rs6000_ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n",
>  	  req, id, (unsigned int)addr, data, (unsigned int)buf, ret);
>  #endif
>    return ret;
> @@ -173,7 +173,7 @@ ptrace32 (int req, int id, int *addr, in
>  /* Call ptracex(REQ, ID, ADDR, DATA, BUF). */
>  
>  static int
> -ptrace64 (int req, int id, long long addr, int data, int *buf)
> +gdb_rs6000_ptrace64 (int req, int id, long long addr, int data, int *buf)
>  {
>  #ifdef ARCH3264
>    int ret = ptracex (req, id, addr, data, buf);
> @@ -181,7 +181,7 @@ ptrace64 (int req, int id, long long add
>    int ret = 0;
>  #endif
>  #if 0
> -  printf ("ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n",
> +  printf ("gdb_rs6000_ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n",
>  	  req, id, addr, data, (unsigned int)buf, ret);
>  #endif
>    return ret;
> @@ -202,7 +202,7 @@ fetch_register (int regno)
>    if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
>      {
>        nr = regno - FP0_REGNUM + FPR0;
> -      ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
> +      gdb_rs6000_ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0);
>      }
>  
>    /* Bogus register number. */
> @@ -223,13 +223,13 @@ fetch_register (int regno)
>  	nr = regno;
>  
>        if (!ARCH64 ())
> -	*addr = ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
> +	*addr = gdb_rs6000_ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
>        else
>  	{
>  	  /* PT_READ_GPR requires the buffer parameter to point to long long,
>  	     even if the register is really only 32 bits. */
>  	  long long buf;
> -	  ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
> +	  gdb_rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
>  	  if (REGISTER_RAW_SIZE (regno) == 8)
>  	    memcpy (addr, &buf, 8);
>  	  else
> @@ -264,7 +264,7 @@ store_register (int regno)
>    if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
>      {
>        nr = regno - FP0_REGNUM + FPR0;
> -      ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
> +      gdb_rs6000_ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0);
>      }
>  
>    /* Bogus register number. */
> @@ -293,7 +293,7 @@ store_register (int regno)
>  	nr = regno;
>  
>        if (!ARCH64 ())
> -	ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
> +	gdb_rs6000_ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
>        else
>  	{
>  	  /* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
> @@ -303,7 +303,7 @@ store_register (int regno)
>  	    memcpy (&buf, addr, 8);
>  	  else
>  	    buf = *addr;
> -	  ptrace64 (PT_WRITE_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
> +	  gdb_rs6000_ptrace64 (PT_WRITE_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
>  	}
>      }
>  
> @@ -377,9 +377,9 @@ read_word (CORE_ADDR from, int *to, int 
>    errno = 0;
>  
>    if (arch64)
> -    *to = ptrace64 (PT_READ_I, PIDGET (inferior_ptid), from, 0, NULL);
> +    *to = gdb_rs6000_ptrace64 (PT_READ_I, PIDGET (inferior_ptid), from, 0, NULL);
>    else
> -    *to = ptrace32 (PT_READ_I, PIDGET (inferior_ptid), (int *)(long) from,
> +    *to = gdb_rs6000_ptrace32 (PT_READ_I, PIDGET (inferior_ptid), (int *)(long) from,
>                      0, NULL);
>  
>    return !errno;
> @@ -449,9 +449,9 @@ child_xfer_memory (CORE_ADDR memaddr, ch
>        for (i = 0, errno = 0; i < count; i++, addr += sizeof (int))
>  	{
>  	  if (arch64)
> -	    ptrace64 (PT_WRITE_D, PIDGET (inferior_ptid), addr, buf[i], NULL);
> +	    gdb_rs6000_ptrace64 (PT_WRITE_D, PIDGET (inferior_ptid), addr, buf[i], NULL);
>  	  else
> -	    ptrace32 (PT_WRITE_D, PIDGET (inferior_ptid), (int *)(long) addr,
> +	    gdb_rs6000_ptrace32 (PT_WRITE_D, PIDGET (inferior_ptid), (int *)(long) addr,
>  		      buf[i], NULL);
>  
>  	  if (errno)
> @@ -490,9 +490,9 @@ exec_one_dummy_insn (void)
>    prev_pc = read_pc ();
>    write_pc (DUMMY_INSN_ADDR);
>    if (ARCH64 ())
> -    ret = ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
> +    ret = gdb_rs6000_ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
>    else
> -    ret = ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
> +    ret = gdb_rs6000_ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
>  
>    if (ret != 0)
>      perror ("pt_continue");
> @@ -987,9 +987,9 @@ xcoff_relocate_symtab (unsigned int pid)
>  #endif
>  
>        if (arch64)
> -	rc = ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, size, NULL);
> +	rc = gdb_rs6000_ptrace64 (PT_LDINFO, pid, (unsigned long) ldi, size, NULL);
>        else
> -	rc = ptrace32 (PT_LDINFO, pid, (int *) ldi, size, NULL);
> +	rc = gdb_rs6000_ptrace32 (PT_LDINFO, pid, (int *) ldi, size, NULL);
>  
>        if (rc == -1)
>          {
> 
> --------------8C5DA08590FB4C86F9BEB5FC--
> 
> 
> 


-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de


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

* Re: patch, Aix 5.1 ptrace64 build failure
  2002-03-20 13:36 ` Peter.Schauer
@ 2002-03-20 16:22   ` Kevin Buettner
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Buettner @ 2002-03-20 16:22 UTC (permalink / raw)
  To: Peter.Schauer, Tom Rix; +Cc: gdb-patches, kevinb

On Mar 20, 10:36pm, Peter.Schauer wrote:

> Looks ok to me, but I'd prefer a rs6000_ prefix over gdb_rs6000_ to keep the
> code in line with the rest of GDB.

I agree.

Kevin


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

end of thread, other threads:[~2002-03-21  0:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-18 11:33 patch, Aix 5.1 ptrace64 build failure Tom Rix
2002-03-20 13:18 ` Kevin Buettner
2002-03-20 13:36 ` Peter.Schauer
2002-03-20 16:22   ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox