From patchwork Mon Mar 31 02:10:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 348 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id B30EF3606D4 for ; Sun, 30 Mar 2014 19:11:03 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id 5A887E04258; Sun, 30 Mar 2014 19:11:03 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 3126CDA3923 for ; Sun, 30 Mar 2014 19:11:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=OpobkPn9IG9WbCBIenNgU/IkU55T5 DLRNNkXAD0vThW9emPsdW5KFVrADyQwSZFBHq2q4nzAkJtBdaryw8XKBuALtLUZD Pm93oALBLKeCUxeeHlpOnSUJF4D/xp1IPmMLTGvLquOzM/hDUGu2VDDxl2pH1R+u 4+DeLv3gczIkxY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=zxGwlnllTQI/zgf14ALuOM0eR20=; b=ekg C/O0VbJG+utGyDL5AXM07OUiFQ1VZtPaHjlhzbVwVRLyvEm5O2aPu2iVSmJ9mEPt vc5DCSRiTrgWMt+AK83vqQMA2eY4ss7z0ikF8ZM/MNNxsMWinYhwdi9j1+7aetrw pIb0iwjS+MKoz1AImllDDeZTDmoDC4ZEA4ii/33k= Received: (qmail 32602 invoked by alias); 31 Mar 2014 02:11:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 32592 invoked by uid 89); 31 Mar 2014 02:10:59 -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-f73.google.com Received: from mail-yh0-f73.google.com (HELO mail-yh0-f73.google.com) (209.85.213.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 31 Mar 2014 02:10:56 +0000 Received: by mail-yh0-f73.google.com with SMTP id c41so1036367yho.0 for ; Sun, 30 Mar 2014 19:10:54 -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:to:subject:date:message-id:mime-version :content-type; bh=pjx9uVjNyKorLS/psi81Tg4Jvmf/2KHhxCm5FEnoUOU=; b=Ow4hLrfYTcL+hZDjCcQbJEiR0+L9Jw7ktyGu/40wZ5iQFmh1pguJ6WmOMTjtY5DzQd 4ua4H+UhQGRJ2K5cHj2qypUMRinDjyr9431CgR5ky1fDMR2c5yU1kRaT7cZ83I4ywkGZ IaIstwv4AnUvtLiS4qxzf64XiH1Mt2gyHQr83wPu57AUqXyduLflR/YjQmqv9IKv62Cd pT7K05GgqinskDXGG74C+XnHcs2CHfR3Rwau1q2jGIM0RNvR9eJ8Ia+fPA0yKkfCFsyE 20/nDLaG/HndYGdjIJMfu0bW1eSuO72Ze11PEIo9YO1dadzn9O4M2+g01DTazJsGyEYE Dh+A== X-Gm-Message-State: ALoCoQkWM3u76r3pdhLr9fe0KFKvWMDwuQpMgOLP0jFSk5FtOoF/27H/p8uFfm2irQwjfSvMrmI/1FjTHF6oCmgxHH0dvDMVY/sGfEduQE5Dx9wcHTVBQdRSvdAF5I/5y+uBB3cIjJjtTa8rW48FOxFs5t4VVFO+0Z3z5dtB+8RZIPPq+7cjMXcO637kXnt+oGGex9CvIPV8Al9gQ0OdJGK57eJM6wjgN1O5sjIWxzU+mcdaBO4jeRc= X-Received: by 10.236.137.50 with SMTP id x38mr8460429yhi.9.1396231854352; Sun, 30 Mar 2014 19:10:54 -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 i30si2391440yhc.0.2014.03.30.19.10.54 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Mar 2014 19:10:54 -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 F2A0E31C15E for ; Sun, 30 Mar 2014 19:10:53 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [commit] inferior.h (enum stop_kind): Improve comment. Date: Sun, 30 Mar 2014 19:10:53 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi. While working on fixing pr 14236 I found this comment which wasn't as clear as it could be. What does "It" refer to in "It is also used after attach, ..." ? Reworded thusly. 2014-03-30 Doug Evans * inferior.h (enum stop_kind): Improve comment. diff --git a/gdb/inferior.h b/gdb/inferior.h index 64a78ce..f8d358d 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -305,20 +305,20 @@ enum step_over_calls_kind setting up a remote connection; it is like STOP_QUIETLY_NO_SIGSTOP except that there is no need to hide a signal. */ -/* It is also used after attach, due to attaching to a process. This - is a bit trickier. When doing an attach, the kernel stops the - debuggee with a SIGSTOP. On newer GNU/Linux kernels (>= 2.5.61) - the handling of SIGSTOP for a ptraced process has changed. Earlier - versions of the kernel would ignore these SIGSTOPs, while now - SIGSTOP is treated like any other signal, i.e. it is not muffled. - +/* STOP_QUIETLY_NO_SIGSTOP is used to handle a tricky situation with attach. + When doing an attach, the kernel stops the debuggee with a SIGSTOP. + On newer GNU/Linux kernels (>= 2.5.61) the handling of SIGSTOP for + a ptraced process has changed. Earlier versions of the kernel + would ignore these SIGSTOPs, while now SIGSTOP is treated like any + other signal, i.e. it is not muffled. + If the gdb user does a 'continue' after the 'attach', gdb passes the global variable stop_signal (which stores the signal from the attach, SIGSTOP) to the ptrace(PTRACE_CONT,...) call. This is problematic, because the kernel doesn't ignore such SIGSTOP now. I.e. it is reported back to gdb, which in turn presents it back to the user. - + To avoid the problem, we use STOP_QUIETLY_NO_SIGSTOP, which allows gdb to clear the value of stop_signal after the attach, so that it is not passed back down to the kernel. */