From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11609 invoked by alias); 11 Jul 2014 19:29:09 -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 11524 invoked by uid 89); 11 Jul 2014 19:29:05 -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,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yh0-f74.google.com Received: from mail-yh0-f74.google.com (HELO mail-yh0-f74.google.com) (209.85.213.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 11 Jul 2014 19:29:01 +0000 Received: by mail-yh0-f74.google.com with SMTP id b6so257949yha.3 for ; Fri, 11 Jul 2014 12:28:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type :content-transfer-encoding:message-id:date:to:cc:subject:in-reply-to :references; bh=7ZP7gXMWF5qRp+zwb43mwqHjBQZsHtOFYQmzXw05fqk=; b=NpErCLSxQlHXdJBHN3qerrMk65C0NU4h/qxPIsi3T7JGLoe9GfHfG8Rldojd1gWw5n CcmAIyJcPTLoPSKf3N5bdmgQtyC/QvG8XSRaSfskS/tkx+0MK6Xfw15DFbE4pmTpTBwr LEre/SzV/Knx8YtN8va4AMTFnLNmROhEAlovgM0ayQoKOIs4lnA2axHm3pL/WLKvDNj9 LT3BxtZTykqFc8WJqcmFzwrYTwZCUEG5Q6n8rngWMGCG2ZUk/VeAxSXQhgBdp/0X+o7X rFryrZp9vBCZpFd9f9KfO73py7ZHZ/Mf6xhjBYQgUspMqZQUYLase+g+YV5YlB5u1ySj q9Ag== X-Gm-Message-State: ALoCoQlVwKl9Eb8pcbuSkTr9x8Xc3vL53Qisgcgrfc3ADz57INkOHtScTNeskwlyFm86yQ9Xlbgn X-Received: by 10.52.231.97 with SMTP id tf1mr380360vdc.3.1405106938785; Fri, 11 Jul 2014 12:28:58 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id j43si238524yhh.5.2014.07.11.12.28.58 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Jul 2014 12:28:58 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3BFA031C2F0; Fri, 11 Jul 2014 12:28:58 -0700 (PDT) From: Doug Evans MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21440.15097.640934.811897@ruffy.mtv.corp.google.com> Date: Fri, 11 Jul 2014 19:30:00 -0000 To: Gary Benson Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 02/15] Remove some GDBSERVER checks from linux-ptrace In-Reply-To: <1404902255-11101-3-git-send-email-gbenson@redhat.com> References: <1404902255-11101-1-git-send-email-gbenson@redhat.com> <1404902255-11101-3-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00290.txt.bz2 Gary Benson writes: > 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-09 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. Hi. Recognizing that this is a temporary hack, the patch is ok with me. One nit below. > @@ -433,18 +435,7 @@ linux_test_for_tracefork (int child_pid) > > /* We got the PID from the grandchild, which means fork > tracing is supported. */ > -#ifdef GDBSERVER > - /* Do not enable all the options for now since gdbserver does not > - properly support them. This restriction will be lifted when > - gdbserver is augmented to support them. */ > - current_ptrace_options |= PTRACE_O_TRACECLONE; > -#else > - current_ptrace_options |= PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK > - | PTRACE_O_TRACECLONE | PTRACE_O_TRACEEXEC; > - > - /* Do not enable PTRACE_O_TRACEEXIT until GDB is more prepared to > - support read-only process state. */ > -#endif > + current_ptrace_options |= PTRACE_O_TRACECLONE | additional_flags; > > /* Do some cleanup and kill the grandchild. */ > my_waitpid (second_pid, &second_status, 0); I can't tell if the PTRACE_O_TRACEEXIT comment was accidentally or intentionally dropped. I'm not sure it's important enough to keep, but it would be good to verify its deletion was intentional.