From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +GExJB+FdGbNhwEAWB0awg (envelope-from ) for ; Thu, 20 Jun 2024 15:38:07 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=f3yWHMlH; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 88DB01E0C1; Thu, 20 Jun 2024 15:38:07 -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 709A81E092 for ; Thu, 20 Jun 2024 15:38:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BA18B3894C00 for ; Thu, 20 Jun 2024 19:38:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA18B3894C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1718912284; bh=EO6zNiYeaG5rdWTPviyR6WSPW9c8fi7iWAvMvsuCNKE=; h=Subject:In-Reply-To:Date:Cc:References:To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=f3yWHMlHn+bsBmB2J5bTbqpZB2aClBwjid6OVfKoiu8XK9A2qQlYMAMXSUE6f+NIW Gf5n7Vkhyr1T08HGuC8AwUeGPG1O0t3TPDnKIpxdrTb66yvs6cghLPUDiox8YlU5uE IrVOn87Xzy04UWYYJi73z6xGLNzLqgT1A6dQq6Gw= Received: from resqmta-h2p-567063.sys.comcast.net (resqmta-h2p-567063.sys.comcast.net [IPv6:2001:558:fd02:2446::b]) by sourceware.org (Postfix) with ESMTPS id AF02A3890431 for ; Thu, 20 Jun 2024 19:37:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF02A3890431 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF02A3890431 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718912249; cv=none; b=Kbi6bVjlOHW/Kjs8k8ZipQVecbWRjJU62axhKR6Kf00oM/+mwXD9Wm2gTx9l/dhxqMaxRw0RTL3mTd+NIYs3DaSLFB+qkg6sIOWhhn44CH6UPgdmanWtyhcJBvF4EufeNtHT+CNsFG0XX2io20juSsT3AXdA6CrmfixzVGQxGUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718912249; c=relaxed/simple; bh=RV4N0MKYMZo6T9AQghoeOf7Ve1fXjOMmZ9+XaHjSttY=; h=DKIM-Signature:Mime-Version:Subject:From:Date:Message-Id:To; b=ZqxJQ7VdVriu8hx8BhF93sGB3ZczghM1hl1eGz3w8sIMAqCQvdkY2/tP8KQsCO2pfr3GLjLa1LBy87kRL8p0apQO/M11n9OCgpHKDcQMQTOYbcqxTLyl3RUT2h7n9s+ajP0XyfIBV8WpTTWLlj74ciTEZNAfU1/muYHmvG5fAok= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from resomta-h2p-555060.sys.comcast.net ([96.102.179.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 256/256 bits) (Client did not present a certificate) by resqmta-h2p-567063.sys.comcast.net with ESMTPS id KGaCsjXhHB1ZJKNb2sERRE; Thu, 20 Jun 2024 19:37:24 +0000 Received: from smtpclient.apple ([73.60.223.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resomta-h2p-555060.sys.comcast.net with ESMTPSA id KNaesvImwZC65KNagsRaCc; Thu, 20 Jun 2024 19:37:04 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.8\)) Subject: Re: `sys.exit` from Python no longer exits the GDB process In-Reply-To: Date: Thu, 20 Jun 2024 15:37:00 -0400 Cc: gdb@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Gulshan Singh X-Mailer: Apple Mail (2.3696.120.41.1.8) X-CMAE-Envelope: MS4xfIqP30rwRzOQSRXBWNkuAs0+vMrINpzGNYkLqATHRrTC50dCSeaYM/IsditEGCYXcatof38BeS9Lm4Z6HiIlSEGxJz3N00dNwFPQKZrtK7O/QhnfRhx4 T0Q0S+a7JqH9fpg80GstcIhLrI3xqZTKLcfo4X7o86S2AvSZC5EePjuIrrQX8q98uEiv325y0VM5KCNsOiRkvOCoUung72LtFtROIIkXud6L3MqltiIdi8SI X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Paul Koning via Gdb Reply-To: Paul Koning Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" > On Jun 20, 2024, at 3:25 PM, Gulshan Singh via Gdb = wrote: >=20 > I'm using GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) > 15.0.50.20240403-git on Ubuntu 24.04, and I'm observing different > behavior with `sys.exit` in Python then when I was using GNU gdb > (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1 on Ubuntu 22.04. >=20 > In GDB 12.1, `sys.exit(1)` in Python would exit the GDB process with > an exit code of 1. In GDB 15.0, I'm seeing that there's an exception > message instead, and GDB does not exit: > ``` > Python Exception : 1 > Error occurred in Python: 1 > ``` >=20 > Is this a bug or intentional behavior? I work on an open source Python > GDB plugin that has some unit tests that get run inside GDB. When an > exception occurs, it's caught and we exit with `sys.exit` so we can > check the return code from our test running scripts. But with the > latest GDB this no longer happens, eventually we run the `quit` > command, and the exit code is zero. If this is intended behavior, is > there any alternative we can use to quit GDB with a non-zero exit code > from Python? If all else fails, os._exit(1) should work, but I too wonder if this = change is intentional, and if so whether there is a way to control its = behavior. paul