From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hW2cHGnsj2oKXgUAWB0awg (envelope-from ) for ; Thu, 27 Aug 2026 03:51:05 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=emIyQVPX; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Y73AMay/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Hotb2f14; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3WvqTA+j; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 513851E09B; Thu, 27 Aug 2026 03:51:05 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 B78F51E09B for ; Thu, 27 Aug 2026 03:51:03 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BB6EB4BA79A9 for ; Thu, 27 Aug 2026 07:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB6EB4BA79A9 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=emIyQVPX; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Y73AMay/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Hotb2f14; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3WvqTA+j Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id BD7864BA2E25 for ; Thu, 27 Aug 2026 07:50:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD7864BA2E25 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD7864BA2E25 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787817036; cv=none; b=OlC8des06ftLEpe6rmSi94fa/EGMwRPNjorrJfDOpK9Sa8qlux8nq0woVTtmwjKvcf9neOi7UWjYeqszoT3RNl2FwNY9BjTtOC16fXb0q2pFm1fB6PN++64V/rHrZuRH2zGsCg9OI+NYajQSBHcAckbW3Q4JD+hHjuhEK9r/zro= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787817036; c=relaxed/simple; bh=aSZ3HFvfOF556nMAAOpTHAjgjvr3/nR11EyYnS80Y8A=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=jj3L67ejFQaIUcCq3Hzp7KLABbpLVI76r8Kqsfh8gzFd3cQVXLHEmPc05iag/jeYcx1W+yDmMfSR/VCjTF56CAUZnZbXzsOrpVKbH1IsIaZzC1KCxpGgf0URNn45ERy5w+q5Vx+Ts1fSdXZoqof+R19nfCCs6fS1MV07U4R+CKI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=emIyQVPX; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Y73AMay/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Hotb2f14; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=3WvqTA+j DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD7864BA2E25 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 89D6021222 for ; Thu, 27 Aug 2026 07:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1787817031; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pkDFC5X1yfuERmJdc2L5GYItZwrZXpF3eojAku0bZcI=; b=emIyQVPXHOS4l0/xodGV3eXUTV/tl5V28406D4Xtr9ubekl9puOTtkS97JxmDHzvSyTt6+ 1HN14XCB/6Da2lZzkiB1Bc7tGX08PTZ9tkq3dWkGquILKC04Akl2PLY1CbZl6/6ztoGgjC JnIhriQ9vZ9Jinsjps+ZHQsnqTwdPxs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1787817031; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pkDFC5X1yfuERmJdc2L5GYItZwrZXpF3eojAku0bZcI=; b=Y73AMay/KrCPcmoXBvWTRen9XyW7gIdDr5l0UeAD77nwMtYZnfIbQThwAaPTD4Q/JdESx7 C98qOOfjHu/v+sCw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Hotb2f14; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=3WvqTA+j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1787817027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pkDFC5X1yfuERmJdc2L5GYItZwrZXpF3eojAku0bZcI=; b=Hotb2f14v+veeDpK71+6OgCgT8d3Pv+KNPxnJ9td3MAvwxtO1eQKX6FE68XrhhjLfOi+le 3EIJIx4+CNjdKZAJoF8IQSD59zAuYMDCuSTTo+gWSV6d2Dtw1dNCg6SiC0wNCC0hOTGDfM R+DIknRoHS/pJfj0z+4B+s1GtwfI6e4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1787817027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pkDFC5X1yfuERmJdc2L5GYItZwrZXpF3eojAku0bZcI=; b=3WvqTA+jSaG9YzH04jxflqgOfeZ4a2jQeU7ng6fSCsZIZMPBegEWYtC7TkY3t0TzEbzji/ LdOA+lHxvaq2cTBw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 78FF413354 for ; Thu, 27 Aug 2026 07:50:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id dxYtHEPsj2puFgAAD6G6ig (envelope-from ) for ; Thu, 27 Aug 2026 07:50:27 +0000 Message-ID: <2754e219-f2e6-47a4-8af9-b0ab24b092c1@suse.de> Date: Thu, 27 Aug 2026 09:50:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PING][PATCH] [gdb/python] Document quit_force uses From: Tom de Vries To: gdb-patches@sourceware.org References: <20260811080018.1151006-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20260811080018.1151006-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 89D6021222 X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; DKIM_TRACE(0.00)[suse.de:+] 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 On 8/11/26 10:00 AM, Tom de Vries wrote: > The Python extension has two functions that convert exceptions from the GDB > domain to the Python domain and vice versa: gdbpy_convert_exception and > gdbpy_handle_exception. > > Each function has an exception though, where it calls quit_force: > - for gdbpy_convert_exception, when handling gdb_exception_forced_quit, and > - for gdbpy_handle_exception, when handling SystemExit. > > I think it's a good idea to document these exceptions in more detail, and > since AFAICT the reasoning is the same, I've added the same comment in both > places. Ping. Thanks, - Tom > --- > gdb/python/py-utils.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/gdb/python/py-utils.c b/gdb/python/py-utils.c > index a831b96eb38..1c68b206601 100644 > --- a/gdb/python/py-utils.c > +++ b/gdb/python/py-utils.c > @@ -221,7 +221,14 @@ gdbpy_convert_exception (const struct gdb_exception &exception) > if (exception.reason == RETURN_QUIT) > exc_class = PyExc_KeyboardInterrupt; > else if (exception.reason == RETURN_FORCED_QUIT) > - quit_force (NULL, 0); > + { > + /* Ideally we'd like to propagate the exception to top-level, where > + we'll call quit_force. Propagating the exception would ensure that > + appropriate cleanups are run. > + OTOH, there is the risk that the exception will be swallowed. > + For now, don't take this risk and immediately call quit_force. */ > + quit_force (NULL, 0); > + } > else if (exception.error == MEMORY_ERROR) > exc_class = gdbpy_gdb_memory_error; > else > @@ -485,6 +492,11 @@ gdbpy_handle_exception () > exit_arg = 1; > } > > + /* Ideally we'd like to propagate the exception to top-level, where > + we'll call quit_force. Propagating the exception would ensure that > + appropriate cleanups are run. > + OTOH, there is the risk that the exception will be swallowed. > + For now, don't take this risk and immediately call quit_force. */ > quit_force (&exit_arg, 0); > } > else if (! fetched_error.type_matches (gdbpy_gdberror_exc) > > base-commit: 8e6c4f526a68b796b7bd71d53e4dc459ac56c3ef