From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1849 invoked by alias); 29 Mar 2012 17:23:10 -0000 Received: (qmail 1839 invoked by uid 22791); 29 Mar 2012 17:23:09 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Mar 2012 17:22:54 +0000 Received: by qcsd16 with SMTP id d16so1743131qcs.0 for ; Thu, 29 Mar 2012 10:22:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.209.74 with SMTP id gf10mr1455100qab.8.1333041773442; Thu, 29 Mar 2012 10:22:53 -0700 (PDT) Received: by 10.229.89.137 with HTTP; Thu, 29 Mar 2012 10:22:50 -0700 (PDT) In-Reply-To: <4F749597.6000600@redhat.com> References: <1332802002.30339.16.camel@hactar> <201203271611.q2RGBs2N025666@glazunov.sibelius.xs4all.nl> <1332894408.16415.14.camel@hactar> <4F749597.6000600@redhat.com> Date: Thu, 29 Mar 2012 17:23:00 -0000 Message-ID: Subject: Re: sparc gdbserver bug? (Re: [RFA] handle android bionic ptrace in gdbserver.) From: "H.J. Lu" To: Pedro Alves Cc: Thiago Jung Bauermann , Mark Kettenis , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg01008.txt.bz2 On Thu, Mar 29, 2012 at 10:02 AM, Pedro Alves wrote: > On 03/28/2012 01:26 AM, Thiago Jung Bauermann wrote: > >> =A0#ifndef __sparc__ >> - =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, nt_type, data); >> + =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (PTRACE_ARG3_TYPE) nt_type, data); >> =A0#else >> =A0 =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, &iov, data); >> =A0#endif > > > BTW, I notice the __sparc__ branch here appears to be broken? > (sparc has the last two ptrace arguments reversed...). > > =A0$ git show d0aa472c > =A0commit d0aa472c6770baccb29dc37d0e64a81afda99911 > =A0Author: H.J. Lu > =A0Date: =A0 Wed Apr 7 18:49:43 2010 +0000 > > =A0 =A0 Add x86 AVX support to gdbserver. > =A0... > > =A0+ > =A0+ =A0 =A0 =A0nt_type =3D regset->nt_type; > =A0+ =A0 =A0 =A0if (nt_type) > =A0+ =A0 =A0 =A0 { > =A0+ =A0 =A0 =A0 =A0 iov.iov_base =3D buf; > =A0+ =A0 =A0 =A0 =A0 iov.iov_len =3D regset->size; > =A0+ =A0 =A0 =A0 =A0 data =3D (void *) &iov; > =A0+ =A0 =A0 =A0 } > =A0+ =A0 =A0 =A0else > =A0+ =A0 =A0 =A0 data =3D buf; > =A0+ > =A0#ifndef __sparc__ > =A0- =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, 0, buf); > =A0+ =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, nt_type, data); > =A0#else > =A0- =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, buf, 0); > =A0+ =A0 =A0 =A0res =3D ptrace (regset->get_request, pid, &iov, data); > =A0#endif > > I think that should have ended up with: > > =A0#ifndef __sparc__ > =A0 =A0 =A0 res =3D ptrace (regset->get_request, pid, nt_type, data); > =A0#else > =A0 =A0 =A0 res =3D ptrace (regset->get_request, pid, data, nt_type); > =A0#endif > It may be a typo for sparc branch. --=20 H.J.