Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] x86-64 ptrace() ABI change sync
@ 2002-04-04  5:13 Michal Ludvig
  2002-04-04  8:39 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Ludvig @ 2002-04-04  5:13 UTC (permalink / raw)
  To: gdb-patches

Hi all,
I've committed this obvious patch which synces gdb with changed glibc to 
both mainline and 5.2-branch.

Michal Ludvig

Index: ChangeLog
	* x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI
	change sync

Index: x86-64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-linux-nat.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 x86-64-linux-nat.c
*** x86-64-linux-nat.c  2002/03/27 10:21:26     1.7
--- x86-64-linux-nat.c  2002/04/04 13:01:24
*************** child_xfer_memory (CORE_ADDR memaddr, ch
*** 441,456 ****
         if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
         {
           /* Need part of initial word -- fetch it.  */
!         ptrace (PT_READ_I, PIDGET (inferior_ptid),
!                 (PTRACE_ARG3_TYPE) addr, buffer);
         }

         if (count > 1)          /* FIXME, avoid if even boundary */
         {
!         ptrace (PT_READ_I, PIDGET (inferior_ptid),
                   ((PTRACE_ARG3_TYPE)
                    (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))),
!                 buffer + count - 1);
         }

         /* Copy data to be written over corresponding part of buffer */
--- 441,456 ----
         if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
         {
           /* Need part of initial word -- fetch it.  */
!         buffer[0] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
!                 (PTRACE_ARG3_TYPE) addr, 0);
         }

         if (count > 1)          /* FIXME, avoid if even boundary */
         {
!         buffer[count-1] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
                   ((PTRACE_ARG3_TYPE)
                    (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))),
!                  0);
         }

         /* Copy data to be written over corresponding part of buffer */
*************** child_xfer_memory (CORE_ADDR memaddr, ch
*** 486,493 ****
         for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
         {
           errno = 0;
!         ptrace (PT_READ_I, PIDGET (inferior_ptid),
!                 (PTRACE_ARG3_TYPE) addr, buffer + i);
           if (errno)
             return 0;
         }
--- 486,493 ----
         for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
         {
           errno = 0;
!         buffer[i] = ptrace (PT_READ_I, PIDGET (inferior_ptid),
!                 (PTRACE_ARG3_TYPE) addr, 0);
           if (errno)
             return 0;
         }



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

* Re: [patch] x86-64 ptrace() ABI change sync
  2002-04-04  5:13 [patch] x86-64 ptrace() ABI change sync Michal Ludvig
@ 2002-04-04  8:39 ` Daniel Jacobowitz
  2002-04-04  8:51   ` Andreas Jaeger
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2002-04-04  8:39 UTC (permalink / raw)
  To: gdb-patches

On Thu, Apr 04, 2002 at 03:13:22PM +0200, Michal Ludvig wrote:
> Hi all,
> I've committed this obvious patch which synces gdb with changed glibc to 
> both mainline and 5.2-branch.
> 
> Michal Ludvig
> 
> Index: ChangeLog
> 	* x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI
> 	change sync

Is this needed for gdbserver?  I'd guess not, since I assumed that
ptrace() behaved according to its man page.  So probably gdbserver is
already correct.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [patch] x86-64 ptrace() ABI change sync
  2002-04-04  8:39 ` Daniel Jacobowitz
@ 2002-04-04  8:51   ` Andreas Jaeger
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Jaeger @ 2002-04-04  8:51 UTC (permalink / raw)
  To: gdb-patches

Daniel Jacobowitz <drow@mvista.com> writes:

> On Thu, Apr 04, 2002 at 03:13:22PM +0200, Michal Ludvig wrote:
>> Hi all,
>> I've committed this obvious patch which synces gdb with changed glibc to 
>> both mainline and 5.2-branch.
>> 
>> Michal Ludvig
>> 
>> Index: ChangeLog
>> 	* x86-64-linux-nat.c (child_xfer_memory): x86-64 ptrace() ABI
>> 	change sync
>
> Is this needed for gdbserver?  I'd guess not, since I assumed that
> ptrace() behaved according to its man page.  So probably gdbserver is
> already correct.

If you followed the man page, everything should be fine.  The problem
was that I didn't follow the man page in implemting ptrace in glibc
for x86-64 - and fixing this meant changing the interface...  ptrace
is now using the same interface for x86-64 as for x86,

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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

end of thread, other threads:[~2002-04-04 16:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-04  5:13 [patch] x86-64 ptrace() ABI change sync Michal Ludvig
2002-04-04  8:39 ` Daniel Jacobowitz
2002-04-04  8:51   ` Andreas Jaeger

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