From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64316 invoked by alias); 26 Nov 2019 16:53:50 -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 64281 invoked by uid 89); 26 Nov 2019 16:53:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=zap, HX-Languages-Length:1796 X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Nov 2019 16:53:46 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 4333F203AC; Tue, 26 Nov 2019 11:53:45 -0500 (EST) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 74EC5202DF; Tue, 26 Nov 2019 11:53:43 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 586C120AF6; Tue, 26 Nov 2019 11:53:43 -0500 (EST) X-Gerrit-PatchSet: 4 Date: Tue, 26 Nov 2019 16:53:00 -0000 From: "Tom Tromey (Code Review)" To: gdb-patches@sourceware.org Cc: Pedro Alves Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v4] Add RAII class for blocking gdb signals X-Gerrit-Change-Id: If3f37dc57dd859c226e9e4d79458a0514746e8c6 X-Gerrit-Change-Number: 168 X-Gerrit-ChangeURL: X-Gerrit-Commit: b102b62adc18eed51e9aebd52d6d7bed4a362fd2 In-Reply-To: References: X-Gerrit-Comment-Date: Tue, 26 Nov 2019 11:53:42 -0500 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-79-g83ff7f88f1 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191126165343.586C120AF6@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-11/txt/msg00870.txt.bz2 Tom Tromey has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/168 ...................................................................... Patch Set 4: (1 comment) I'll zap the comment again, unless you want to reword it yourself somehow. I assume you meant to +2 this one? | --- /dev/null | +++ gdb/gdbsupport/block-signals.h | @@ -1,0 +34,19 @@ public: | + block_signals () | + { | +#ifdef HAVE_PTHREAD_SIGMASK | + sigset_t mask; | + sigemptyset (&mask); | + sigaddset (&mask, SIGINT); | + sigaddset (&mask, SIGCHLD); | + sigaddset (&mask, SIGALRM); | + sigaddset (&mask, SIGWINCH); | + pthread_sigmask (SIG_BLOCK, &mask, &m_old_mask); PS3, Line 43: > I actually wondered whether this should block all signals instead of just blocking a subset -- I was pondering whether the set of signals might be target backend specific, for example. But we can leave that for if/when we need it. I think the Boehm GC needs some signal (or signals?) to be deliverable in order to suspend threads. | +#endif | + } | + | + ~block_signals () | + { | +#ifdef HAVE_PTHREAD_SIGMASK | + pthread_sigmask (SIG_SETMASK, &m_old_mask, nullptr); | +#endif | + } -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: If3f37dc57dd859c226e9e4d79458a0514746e8c6 Gerrit-Change-Number: 168 Gerrit-PatchSet: 4 Gerrit-Owner: Tom Tromey Gerrit-Reviewer: Pedro Alves Gerrit-Reviewer: Tom Tromey Gerrit-Comment-Date: Tue, 26 Nov 2019 16:53:42 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Pedro Alves Comment-In-Reply-To: Tom Tromey Gerrit-MessageType: comment