From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2335 invoked by alias); 4 Feb 2013 19:25:11 -0000 Received: (qmail 2325 invoked by uid 22791); 4 Feb 2013 19:25:10 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS 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; Mon, 04 Feb 2013 19:25:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r14JP1fN016498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Feb 2013 14:25:01 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r14JOxUJ000426; Mon, 4 Feb 2013 14:25:00 -0500 Message-ID: <51100B0B.50603@redhat.com> Date: Mon, 04 Feb 2013 19:25:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tom Tromey CC: Mark Kettenis , marcus.shawcroft@arm.com, gdb-patches@sourceware.org Subject: Re: [PATCH] gdbserver ptrace() argument type cleanups. References: <510FF048.8070701@arm.com> <201302041857.r14IvSWJ000937@glazunov.sibelius.xs4all.nl> <876227299x.fsf@fleche.redhat.com> In-Reply-To: <876227299x.fsf@fleche.redhat.com> 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: 2013-02/txt/msg00095.txt.bz2 On 02/04/2013 07:01 PM, Tom Tromey wrote: >>>>>> "Mark" == Mark Kettenis writes: > > Mark> I'd use the word "obfuscation" instead of "cleanup". > > It is awful but necessary. > I think calls in gdb proper probably need this as well. > > > I did try writing a patch to fix it a different way, without as many > casts: > > +static inline PTRACE_TYPE_RET > +gdb_ptrace (int request, pid_t pid, PTRACE_TYPE_ARG3 addr, void *data) > +{ > + return ptrace (request, pid, addr, data); > +} > + > +#undef ptrace > +#define ptrace ERROR > > > ... followed by using gdb_ptrace everywhere. > > However you do still need casts at some call points. > It's quite awful. > > I can send this if anyone thinks it is better. Yeah, the same occurred to me. I didn't try it, but I guessed you'd need casts anyway, given some ptrace calls take pointers as extra arguments, while others take integers. In the end, I just tucked in under the "oh well, it's not that important" rug. :-) However, Marcus' patch is only following the status quo (*), so I didn't bring that up. Without seeing the result it's hard to say which is better. (*) - http://sourceware.org/ml/gdb-patches/2012-03/msg01072.html -- Pedro Alves