From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id AK+YCIUR82UF9AYAWB0awg (envelope-from ) for ; Thu, 14 Mar 2024 11:02:29 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=fYyI9CBv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1D2BF1E0BB; Thu, 14 Mar 2024 11:02:29 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0C7631E01D for ; Thu, 14 Mar 2024 11:02:27 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CBFB3857B98 for ; Thu, 14 Mar 2024 15:02:26 +0000 (GMT) Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id BBD2F3858C31 for ; Thu, 14 Mar 2024 15:02:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBD2F3858C31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BBD2F3858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710428528; cv=none; b=hEHHVTY6YwW2bqW+LwyXGSpzj8YcuuGPnQJNbiA7ctIXiXpHCfEt8AofmtMWYG1V4QgOv8z6yoBC8L2ANj0nz873ych3F7wd8NnxZ94WM+IHx837tTuKVJV94LEY1Jqe0v6AEMRaGl64mxk/6plmrr10tG7Wdq57D7dcluXmPq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710428528; c=relaxed/simple; bh=Bvrck3ipfmuO78eABsbB751sSHEnNUrMsM7SnImm0LI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=m5uYdfbHstnff7zXls/OqprIRykRi6K4gOYtvcnHY+Fb+BYk0h+6KLMY0qpwsbQ2i1ScXQwjjo7YHFmh/6fWCcaM+xWC5m1IzuBKxrPNLC7I5waz7z4FN/JiLm7+qeSCMVLbD400tSt0p2aGvX87pqEoyTAZ2be3Rnjff+llFN0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5006a.ext.cloudfilter.net ([10.0.29.179]) by cmsmtp with ESMTPS id klhKrO9KaHXmAkmarrfuGF; Thu, 14 Mar 2024 15:02:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id kmaqrY1POOvLqkmarrVIsG; Thu, 14 Mar 2024 15:02:05 +0000 X-Authority-Analysis: v=2.4 cv=dYCG32Xe c=1 sm=1 tr=0 ts=65f3116d a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=K6JAEmCyrfEA:10 a=Qbun_eYptAEA:10 a=ek68ymROjXQ14CopI2IA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=sq+fkZ00jrOcSLINSWhLu2TAgTG5IQ0xXgt/o/68a7w=; b=fYyI9CBvJTLlgKQrczi3xZ0VgH O+4dMXFD+e6nwyaxldF0anAHexJpG4rT4AcqO3mQvbVs9gYCPzxferNnhTDljRF+2LqJ1NakAsJa6 F8AA4T8SlUR9CcGw9uYZzBlc3; Received: from 97-122-82-115.hlrn.qwest.net ([97.122.82.115]:60290 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rkmaq-004KWp-1j; Thu, 14 Mar 2024 09:02:04 -0600 From: Tom Tromey To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] Remove 'if' from GDB_PY_HANDLE_EXCEPTION References: <20231222184451.218271-1-tom@tromey.com> <87ttn3qyp8.fsf@tromey.com> X-Attribution: Tom Date: Thu, 14 Mar 2024 09:02:03 -0600 In-Reply-To: <87ttn3qyp8.fsf@tromey.com> (Tom Tromey's message of "Tue, 23 Jan 2024 18:58:43 -0700") Message-ID: <87bk7gluvo.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.82.115 X-Source-L: No X-Exim-ID: 1rkmaq-004KWp-1j X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-82-115.hlrn.qwest.net (murgatroyd) [97.122.82.115]:60290 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfPWhArdwnVrCy8aBswBIrKquvB1yv3cBalo3Sj/492VAs7zABKWjU6fSGLTX6fhUjWNfE1DoVLS3bDJnqQyWThB1scMMXgsXAbFoAfqFNm6hAO0Isy1N Q0AJG5m498JIb2M91Y4vLwwzjvO+RokCj8wADldt6h4e45doeYxErCoWzlYF153KlAK+8oLjA1UkFN8w73dsFXSTjNPRGtUzmFc= X-Spam-Status: No, score=-3015.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Simon> In infpy_write_memory for instance, GDB_PY_HANDLE_EXCEPTION is not Simon> called within the catch block. Is it normal? > Nope, oops. Here's v2, that fixes this and also removes an unnecessary > return -- which is kind of the main motivation of this change, the 'if' > sometimes results in the compiler thinking the macro doesn't return, > whereas it does. > Remove 'if' from GDB_PY_HANDLE_EXCEPTION > This removes the embedded 'if' from GDB_PY_HANDLE_EXCEPTION and > GDB_PY_SET_HANDLE_EXCEPTION. I believe this 'if' was necessary with > the old gdb try/catch macros, but it no longer is: these should only > ever be called from a 'catch' block, where it's already known that an > exception was thrown. > Simon pointed out, though, that in a few spots, these were in facts > called outside of 'catch' blocks. This patch cleans up these spots. > I also found one spot where a redundant 'return nullptr' could be > removed. I'm checking this in. Tom