From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id nLpOO/M02WLWpxcAWB0awg (envelope-from ) for ; Thu, 21 Jul 2022 07:13:55 -0400 Received: by simark.ca (Postfix, from userid 112) id E5E9A1E5EA; Thu, 21 Jul 2022 07:13:55 -0400 (EDT) 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=cvnhU1RM; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 24ADE1E222 for ; Thu, 21 Jul 2022 07:13:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B1913857350 for ; Thu, 21 Jul 2022 11:13:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B1913857350 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658402034; bh=xVGj8hP+cUMesBEzf25L86RvnDp14ekfxJRtbNIHDjw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=cvnhU1RMssQMI7+9dzhQCBlbwOb8yPRwxwW5y6gX/h4OIIjusxkPkEQFz2+BwokGy 34pM7R1TfN+w9Q901pinjk0P3V25uyXvqbZ+k95Ylsl3XlOdGfWhmMe/WsA/vVQ7xe uURO0M2I7UpDL7g/gy4oDVzsnPxHmxVqhHg5pR44= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id C2BC93856DF5 for ; Thu, 21 Jul 2022 11:13:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C2BC93856DF5 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 04AA03437C; Thu, 21 Jul 2022 11:13:19 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DBCC513A1B; Thu, 21 Jul 2022 11:13:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id A16FNM402WLLZwAAMHmgww (envelope-from ); Thu, 21 Jul 2022 11:13:18 +0000 Date: Thu, 21 Jul 2022 13:13:17 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb] Fix python selftest with python 3.11 Message-ID: <20220721111316.GA23728@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Mark Wielaard Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, With python 3.11 I noticed: ... $ gdb -q -batch -ex "maint selftest python" Running selftest python. Self test failed: self-test failed at gdb/python/python.c:2246 Ran 1 unit tests, 1 failed ... In more detail: ... (gdb) p output $5 = "Traceback (most recent call last):\n File \"\", line 0, \ in \nKeyboardInterrupt\n" (gdb) p ref_output $6 = "Traceback (most recent call last):\n File \"\", line 1, \ in \nKeyboardInterrupt\n" ... Fix this by also allowing line number 0. Tested on x86_64-linux. This should hopefully fix buildbot builder gdb-rawhide-x86_64. Any comments? Thanks, - Tom [gdb] Fix python selftest with python 3.11 --- gdb/python/python.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index 8fa935c8286..365859a2e4e 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -2240,10 +2240,13 @@ test_python () SELF_CHECK (*e.message == "Error while executing Python code."); } SELF_CHECK (saw_exception); - std::string ref_output("Traceback (most recent call last):\n" - " File \"\", line 1, in \n" - "KeyboardInterrupt\n"); - SELF_CHECK (output == ref_output); + std::string ref_output_0("Traceback (most recent call last):\n" + " File \"\", line 0, in \n" + "KeyboardInterrupt\n"); + std::string ref_output_1("Traceback (most recent call last):\n" + " File \"\", line 1, in \n" + "KeyboardInterrupt\n"); + SELF_CHECK (output == ref_output_0 || output == ref_output_1); } #undef CMD