From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5763 invoked by alias); 17 Jul 2014 08:35:45 -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 5731 invoked by uid 89); 17 Jul 2014 08:35:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f181.google.com Received: from mail-vc0-f181.google.com (HELO mail-vc0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 17 Jul 2014 08:35:42 +0000 Received: by mail-vc0-f181.google.com with SMTP id lf12so3809793vcb.26 for ; Thu, 17 Jul 2014 01:35:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fqqbk/53BPrR1DMg74MiBevavcKK0SLhNPsZPohvVrQ=; b=cUr1DNTDbSQN7+R+fNkGGSvweQmZ4XyP7nPMARcx1TlxZ0nc5962UWOLHV5C359U2S JLqFMP5V1R6LaoI1sESUsOPYysVIUBuy2chHOdXkIoD3sE4GgduSlQVheD1N85JzOB+D vFvKd82mOyv3HDBkvE4jJ/iwn8Tja5/tOV0HagPdGYi3xg/w00qJ2pMRZBat7n7DngHh Mf6YIowq+A4/FvtOyWZOP6Ik/9Q5SLqA1pVjZupqsf71Dr3Ex3ozwIWHfnjt53sNfK/B uqTDkFb5gVdFRDY8wvAJn6Kj3d8jI0I3BNEVWGm7mvnPNSDi9X8QZ8xc/Jo2ihbqgnsY QlRg== X-Gm-Message-State: ALoCoQnTgq7uIajBTHky1/kiicUN60bEs8xYiIK3FISm31jrRqMw9CnMey7hyLW3U3UA2sXWn3o3 MIME-Version: 1.0 X-Received: by 10.221.63.195 with SMTP id xf3mr15602208vcb.36.1405586140490; Thu, 17 Jul 2014 01:35:40 -0700 (PDT) Received: by 10.52.28.233 with HTTP; Thu, 17 Jul 2014 01:35:38 -0700 (PDT) In-Reply-To: <1405520243-17282-3-git-send-email-gbenson@redhat.com> References: <1405520243-17282-1-git-send-email-gbenson@redhat.com> <1405520243-17282-3-git-send-email-gbenson@redhat.com> Date: Thu, 17 Jul 2014 08:37:00 -0000 Message-ID: Subject: Re: [PATCH 02/15 v2] Remove some GDBSERVER checks from linux-ptrace From: Doug Evans To: Gary Benson Cc: gdb-patches , Tom Tromey Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00454.txt.bz2 On Wed, Jul 16, 2014 at 7:17 AM, Gary Benson wrote: > This patch removes some GDBSERVER checks from nat/linux-ptrace.c. > Currently the code uses a compile-time check to decide whether some > flags should be used. This changes the code to instead let users of > the module specify an additional set of flags; and then changes gdb's > linux-nat.c to call this function. At some later date, when the back > ends are fully merged, we will be able to remove this function again. > > gdb/ > 2014-07-16 Tom Tromey > Gary Benson > > * nat/linux-ptrace.c (additional_flags): New global. > (linux_test_for_tracesysgood, linux_test_for_tracefork): Use > additional_flags; don't check GDBSERVER. > (linux_ptrace_set_additional_flags): New function. > * nat/linux-ptrace.h (linux_ptrace_set_additional_flags): > Declare. > * linux-nat.c (_initialize_linux_nat): Call > linux_ptrace_set_additional_flags. LGTM. I had a thought, and please don't feel compelled to have to submit yet another revision. I'm just writing this down for completeness' sake. Since linux_ptrace_set_additional_flags is supposed to be called before any other related function, one could add an assert to the other functions to verify this. > [...] > +/* Set additional ptrace flags to use. Some such flags may be checked > + by the implementation above. This function must be called before > + any other function in this file; otherwise the flags may not take > + effect appropriately. */ > + > +void > +linux_ptrace_set_additional_flags (int flags) > +{ > + additional_flags = flags; > +}