From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22453 invoked by alias); 29 Mar 2012 17:02:35 -0000 Received: (qmail 22444 invoked by uid 22791); 29 Mar 2012 17:02:34 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Mar 2012 17:02:20 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2TH2HNH030678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Mar 2012 13:02:17 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2TH2FcH006120; Thu, 29 Mar 2012 13:02:16 -0400 Message-ID: <4F749597.6000600@redhat.com> Date: Thu, 29 Mar 2012 17:02:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 MIME-Version: 1.0 To: Thiago Jung Bauermann CC: Mark Kettenis , gdb-patches@sourceware.org, "H.J. Lu" Subject: sparc gdbserver bug? (Re: [RFA] handle android bionic ptrace in gdbserver.) References: <1332802002.30339.16.camel@hactar> <201203271611.q2RGBs2N025666@glazunov.sibelius.xs4all.nl> <1332894408.16415.14.camel@hactar> In-Reply-To: <1332894408.16415.14.camel@hactar> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg01007.txt.bz2 On 03/28/2012 01:26 AM, Thiago Jung Bauermann wrote: > #ifndef __sparc__ > - res = ptrace (regset->get_request, pid, nt_type, data); > + res = ptrace (regset->get_request, pid, > + (PTRACE_ARG3_TYPE) nt_type, data); > #else > res = ptrace (regset->get_request, pid, &iov, data); > #endif BTW, I notice the __sparc__ branch here appears to be broken? (sparc has the last two ptrace arguments reversed...). $ git show d0aa472c commit d0aa472c6770baccb29dc37d0e64a81afda99911 Author: H.J. Lu Date: Wed Apr 7 18:49:43 2010 +0000 Add x86 AVX support to gdbserver. ... + + nt_type = regset->nt_type; + if (nt_type) + { + iov.iov_base = buf; + iov.iov_len = regset->size; + data = (void *) &iov; + } + else + data = buf; + #ifndef __sparc__ - res = ptrace (regset->get_request, pid, 0, buf); + res = ptrace (regset->get_request, pid, nt_type, data); #else - res = ptrace (regset->get_request, pid, buf, 0); + res = ptrace (regset->get_request, pid, &iov, data); #endif I think that should have ended up with: #ifndef __sparc__ res = ptrace (regset->get_request, pid, nt_type, data); #else res = ptrace (regset->get_request, pid, data, nt_type); #endif ? -- Pedro Alves