From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15038 invoked by alias); 19 Sep 2014 18:14:53 -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 15025 invoked by uid 89); 19 Sep 2014 18:14:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Sep 2014 18:14:51 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1XV2hj-0006xv-NH from Don_Breazeal@mentor.com ; Fri, 19 Sep 2014 11:14:47 -0700 Received: from [127.0.0.1] ([172.30.12.90]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 19 Sep 2014 11:14:47 -0700 Message-ID: <541C7296.4080105@codesourcery.com> Date: Fri, 19 Sep 2014 18:14:00 -0000 From: "Breazeal, Don" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Pedro Alves , gdb-patches@sourceware.org Subject: [pushed] 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> <540EE512.4040708@redhat.com> In-Reply-To: <540EE512.4040708@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00639.txt.bz2 On 9/9/2014 4:31 AM, Pedro Alves wrote: > 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. Thanks for the review. This is pushed in now, with fixes detailed below. > > Though I wonder why not push the SIGTRAP check to > linux_is_extended_waitstatus too. My thinking was to implement something at the same level as WIFSTOPPED et al. > >> 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. Fixed. > >> >> gdbserver/ >> 2014-08-20 Don Breazeal >> * linux-low.c (handle_extended_wait): Call > > Missing empty line above. Fixed. > >> linux_ptrace_get_extended_event. >> (get_stop_pc, get_detach_signal, linux_low_filter_event): Call >> linux_is_extended_waitstatus. > > Thanks, > Pedro Alves >