From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B887B3858419 for ; Mon, 25 Oct 2021 19:02:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B887B3858419 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 19PJ2PBv006566 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Oct 2021 15:02:30 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 19PJ2PBv006566 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E00461ECEB; Mon, 25 Oct 2021 15:02:24 -0400 (EDT) Message-ID: Date: Mon, 25 Oct 2021 15:02:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH] Replace deprecated_target_wait_hook by observers Content-Language: en-US To: Tom Tromey , Simon Marchi via Gdb-patches References: <20210826144044.146397-1-patrick@monnerat.net> <8240f04b-eef9-f14b-1d1f-18b2a187cc65@polymtl.ca> <87o88j3vfh.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87o88j3vfh.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 25 Oct 2021 19:02:25 +0000 X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2021 19:02:39 -0000 On 2021-09-23 16:10, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> The only dangerous things about this is if an observer throws an > Simon> exception, an exception will exit the destructor, and that aborts the > Simon> process. > > I think observers generally aren't supposed to throw. > > If we want gdb to robust against this, I think the thing to do would be > add a try/catch in observable::notify. > > Tom > I started experimenting with this, asserting if an observer throws: https://review.lttng.org/c/binutils-gdb/+/6527 But I am seeing some failures. As long as we are not enforcing this, i would favor the safer approach. Simon