From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28891 invoked by alias); 29 Mar 2012 16:42:51 -0000 Received: (qmail 28784 invoked by uid 22791); 29 Mar 2012 16:42:49 -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 16:42: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 q2TGgINa022563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Mar 2012 12:42:18 -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 q2TGgHTs030516; Thu, 29 Mar 2012 12:42:18 -0400 Message-ID: <4F7490E9.40903@redhat.com> Date: Thu, 29 Mar 2012 16:42: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 Subject: 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/msg01003.txt.bz2 On 03/28/2012 01:26 AM, Thiago Jung Bauermann wrote: > Hi Mark, > > On Tue, 2012-03-27 at 18:11 +0200, Mark Kettenis wrote: >>> > > From: Thiago Jung Bauermann >>> > > Date: Mon, 26 Mar 2012 19:46:42 -0300 >> > Sad to see all this compatibility goo just a different prototype. >> > This could almost certainly be fixed by just fixing the header. > I completely agree. IMHO in this case the header to be fixed is actually > glibc's, since it declares ptrace in a different way than what is > supported by the kernel. The kernel just supports the system call. The man page is really not a part of the kernel. It's a separately maintained project. >> > Anyway, you should test this on a 64-bit platform. I have a strong >> > suspicion things will break there because of plain integers that are >> > being cast to void *. > Good catch, that's what happened indeed. I don't know what would be the > correct fix. I changed the types of the variables that are passed to > ptrace from int to long. At least it hurts the eyes less than two casts > in a row. :-) Honestly, I'd prefer the double cast, in order to leave the ptrace arg type intricacy closest the the ptrace call as possible, instead of that care being spread and diluted about. It's also what other places in the code base already do (both gdb and gdbserver). -- Pedro Alves