From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29083 invoked by alias); 9 Sep 2014 11:31:48 -0000 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 Received: (qmail 29073 invoked by uid 89); 9 Sep 2014 11:31:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 09 Sep 2014 11:31:35 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s89BVWEP021411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Sep 2014 07:31:32 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s89BVUnV013258; Tue, 9 Sep 2014 07:31:31 -0400 Message-ID: <540EE512.4040708@redhat.com> Date: Tue, 09 Sep 2014 11:31:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: Don Breazeal , gdb-patches@sourceware.org Subject: Re: [PATCH 03/16 v2] Refactor ptrace extended event status References: <1407434395-19089-1-git-send-email-donb@codesourcery.com> <1408580964-27916-4-git-send-email-donb@codesourcery.com> In-Reply-To: <1408580964-27916-4-git-send-email-donb@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00220.txt.bz2 Hi Don, Let's get this one out of the way. On 08/21/2014 01:29 AM, Don Breazeal wrote: > This patch implements functions for identifying and extracting extended > ptrace event information from a Linux wait status. These are just > convenience functions intended to hide the ">> 16" used to extract the > event from the wait status word, replacing the hard-coded shift with a more > descriptive function call. This is preparatory work for implementation of > follow-fork and detach-on-fork for extended-remote linux targets. > > The functions linux_is_extended_waitstatus and > linux_ptrace_get_extended_event are defined in nat/linux-ptrace.c, and > called in linux-nat.c and gdbserver/linux-low.c. > > My initial approach was to implement predicates for every extended event, > e.g. linux_is_traced_clone (status), linux_is_traced_fork (status), but > that didn't fit the current implementation as well, bloated the code a bit, > and didn't add anything to readability, so I went with just extracting the > event bits from the status instead. > > Tested on x64 Ubuntu Lucid, native only. This is OK. Please push. Though I wonder why not push the SIGTRAP check to linux_is_extended_waitstatus too. > gdb/ > 2014-08-20 Don Breazeal > > * linux-nat.c (linux_handle_extended_wait): Call > linux_ptrace_get_extended_event. > (wait_lwp): Call linux_is_extended_waitstatus. > (linux_nat_filter_event): Call linux_ptrace_get_extended_event > and linux_is_extended_waitstatus. > * nat/linux-ptrace.c (linux_test_for_tracefork): Call > linux_ptrace_get_extended_event. > (linux_ptrace_get_extended_event): New function. > (linux_is_extended_waitstatus): New function. > * nat/linux-ptrace.h: Declare new functions. Please spell out the new declarations. Like: * nat/linux-ptrace.h (linux_ptrace_get_extended_event) (linux_is_extended_waitstatus): New declarations. > > gdbserver/ > 2014-08-20 Don Breazeal > * linux-low.c (handle_extended_wait): Call Missing empty line above. > linux_ptrace_get_extended_event. > (get_stop_pc, get_detach_signal, linux_low_filter_event): Call > linux_is_extended_waitstatus. Thanks, Pedro Alves