From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5717 invoked by alias); 4 Feb 2013 18:57:46 -0000 Received: (qmail 5708 invoked by uid 22791); 4 Feb 2013 18:57:44 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Feb 2013 18:57:39 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id r14IvUKM007415; Mon, 4 Feb 2013 19:57:30 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id r14IvSWJ000937; Mon, 4 Feb 2013 19:57:28 +0100 (CET) Date: Mon, 04 Feb 2013 18:57:00 -0000 Message-Id: <201302041857.r14IvSWJ000937@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: marcus.shawcroft@arm.com CC: gdb-patches@sourceware.org, palves@redhat.com In-reply-to: <510FF048.8070701@arm.com> (message from Marcus Shawcroft on Mon, 04 Feb 2013 17:30:48 +0000) Subject: Re: [PATCH] gdbserver ptrace() argument type cleanups. References: <510FF048.8070701@arm.com> 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/msg00089.txt.bz2 > Date: Mon, 04 Feb 2013 17:30:48 +0000 > From: Marcus Shawcroft > > Hi, > > This patch is ripped out of the aarch64 gdbserver patch here: > > http://sourceware.org/ml/gdb-patches/2013-01/msg00535.html > > These changes are not directly related to the aarch64 port itself. > Since ptrace() has a variadic prototype, the anonymous arguments, > notably arguments 3 and 4, should be given their correct types. > > /Marcus > > Proposed ChangeLog: > > gdb/gdbserver/ > > * linux-low.c (handle_extended_wait, linux_create_inferior) > (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp) > (dequeue_one_deferred_signal, linux_resume_one_thread) > (fetch_register, linux_write_memory, linux_enable_event_reporting) > (linux_tracefork_grandchild, linux_test_for_tracefork) > (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo ): Add > PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments > where the argument is 0. > diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c > index 8988509..c52cd2e 100644 > --- a/gdb/gdbserver/linux-low.c > +++ b/gdb/gdbserver/linux-low.c > @@ -445,7 +445,8 @@ handle_extended_wait (struct lwp_info *event_child, int= > wstat) > unsigned long new_pid; > int ret, status; > =20 > - ptrace (PTRACE_GETEVENTMSG, lwpid_of (event_child), 0, &new_pid); > + ptrace (PTRACE_GETEVENTMSG, lwpid_of (event_child), (PTRACE_ARG3_TYPE) 0, > + &new_pid); I'd use the word "obfuscation" instead of "cleanup".