From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id o42uJ+4H3mWONi8AWB0awg (envelope-from ) for ; Tue, 27 Feb 2024 11:03:58 -0500 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=DslklPat; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=O3pKQhN6; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=DslklPat; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=O3pKQhN6; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8D7BB1E0D2; Tue, 27 Feb 2024 11:03:58 -0500 (EST) 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 364D61E030 for ; Tue, 27 Feb 2024 11:03:56 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE8DD3858414 for ; Tue, 27 Feb 2024 16:03:55 +0000 (GMT) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 8C6EB3858D20 for ; Tue, 27 Feb 2024 16:03:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8C6EB3858D20 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 8C6EB3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709049817; cv=none; b=HTyB7XX253PIfsa/vb3Z47RfKWNCN9zqXdg5MnBG3hLlpHXtBOnOHXt/IvULI7Q2K6xp03yXGo46C8WaTpKVxOF079C18Wds+hueczHvpBAkqStkZIGAg1Z4dTWyAQ2WTEabs7HXJxeC/M2tII/JQiTEMBWMo1ZmLGgtJMX7CJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709049817; c=relaxed/simple; bh=0UKItw/mUcneN4/TRFj5ug9pUoz/g/1ynslcqhQgzgs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=qgGaSpYqrG7Gxtp5l7WcoVQfIV+3bfAMUg9UtPkPzuIcwl2QZkBN4WrQijAFfzgMO41VcuN6gu12k2e58sG3cqYo32eHPmEjSWM5WcBQxfpICPrDLII4YlU3dh/XGd1bGInuvxbcQ8JtlutZWQ+tbVO6+JMIZX0mOK23jDRD6pc= ARC-Authentication-Results: i=1; server2.sourceware.org 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 664E3225EC; Tue, 27 Feb 2024 16:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709049814; 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=NpmszKmNk44qvKucG0X0hkOMLSJLWncpSQI1vTsN168=; b=DslklPat3JILSC1yvAE+EZ4j2qnEaBmUi2cJDyRFwJxDzQ91vB/RYWmdGhk2JQ7iiIqF/z KEKStsfrEEMLtvZb84IZA9pGOAAwRkKC1wer0Z2gt8++zaXIXkvkLwQ7diIVpmvaGBS44r u2Z8o48kOj17FdfsDlnRiFMyLro+azA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709049814; 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=NpmszKmNk44qvKucG0X0hkOMLSJLWncpSQI1vTsN168=; b=O3pKQhN6rqL5ur38c1XiPAuqQYr4GG/fV4168L875Si13gkKMySp2rJX2WDRjZukmMD427 CfnTx3As2+TYb0Dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709049814; 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=NpmszKmNk44qvKucG0X0hkOMLSJLWncpSQI1vTsN168=; b=DslklPat3JILSC1yvAE+EZ4j2qnEaBmUi2cJDyRFwJxDzQ91vB/RYWmdGhk2JQ7iiIqF/z KEKStsfrEEMLtvZb84IZA9pGOAAwRkKC1wer0Z2gt8++zaXIXkvkLwQ7diIVpmvaGBS44r u2Z8o48kOj17FdfsDlnRiFMyLro+azA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709049814; 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=NpmszKmNk44qvKucG0X0hkOMLSJLWncpSQI1vTsN168=; b=O3pKQhN6rqL5ur38c1XiPAuqQYr4GG/fV4168L875Si13gkKMySp2rJX2WDRjZukmMD427 CfnTx3As2+TYb0Dw== 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 43B8D13A65; Tue, 27 Feb 2024 16:03:34 +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 J7MeD9YH3mXYVQAAD6G6ig (envelope-from ); Tue, 27 Feb 2024 16:03:34 +0000 Message-ID: <815c5904-4699-477c-a8f1-cb49af0607af@suse.de> Date: Tue, 27 Feb 2024 17:03:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 3/4] Rewrite "python" command exception handling Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20240227-py-simple-exc-v4-0-3341d342c126@adacore.com> <20240227-py-simple-exc-v4-3-3341d342c126@adacore.com> From: Tom de Vries In-Reply-To: <20240227-py-simple-exc-v4-3-3341d342c126@adacore.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=DslklPat; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=O3pKQhN6 X-Spamd-Result: default: False [-1.94 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.14)[68.14%]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_DKIM_ARC_DNSWL_HI(-1.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 664E3225EC X-Spam-Level: X-Spam-Score: -1.94 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 2/27/24 15:45, Tom Tromey wrote: > The "python" command (and the Python implementation of the gdb > "source" command) does not handle Python exceptions in the same way as > other gdb-facing Python code. In particular, exceptions are turned > into a generic error rather than being routed through > gdbpy_handle_exception, which takes care of converting to 'quit' as > appropriate. > > I think this was done this way because PyRun_SimpleFile and friends do > not propagate the Python exception -- they simply indicate that one > occurred. > > This patch reimplements these functions to respect the general gdb > convention here. As a bonus, some Windows-specific code can be > removed, as can the _execute_file function. > > The bulk of this change is tweaking the test suite to match the new > way that exceptions are displayed. These changes are largely > uninteresting. However, it's worth pointing out the py-error.exp > change. Here, the failure changes because the test changes the host > charset to something that isn't supported by Python. This then > results in a weird error in the new setup. > Acked-By: Tom de Vries Thanks, - Tom