From nobody Wed Nov 27 13:50:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731962551; cv=none; d=zohomail.com; s=zohoarc; b=HNGtpeAI/zRsd6TOtEeASsEH+FOdBG2s/zGMQzbpm5vBWZn+HNb19E1ywzhIXwjfb+GF9nW4U7qdVSvm2tNL0BRumAXt9zruLcLXaI38CqI029Qace7TTuUai2sHDeRrotIzjHa87ZPZ+O+W/8vl2VVf89Q/XnbSIDC4FR5uunE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731962551; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eHplRik/YcnR60UB43A7Gp9H2sYINST0OAHvGPPuMSA=; b=jfZMq8/g4YYcfr1Gjj7HmqqEwEjGbm0puj+q3iqM1lknTcCkhoKYeIzkVkLpZsr0plA4wV8pbWm284/HmytzElxmouVMAXbi7S0rbbmxjTwp+Ace9sfHqacIv54O9UDSR8ZPq5TxCHgnMbkFOqnvDaQvtUdxs0HdgYQftm/UjcU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731962551390559.0691005886621; Mon, 18 Nov 2024 12:42:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tD8Ys-0001U9-62; Mon, 18 Nov 2024 15:41:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tD8Yq-0001Tq-F1 for qemu-devel@nongnu.org; Mon, 18 Nov 2024 15:41:28 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tD8Yo-0002NO-Hi for qemu-devel@nongnu.org; Mon, 18 Nov 2024 15:41:28 -0500 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5cfcb7183deso2202391a12.0 for ; Mon, 18 Nov 2024 12:41:25 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa20df56b1esm574306066b.71.2024.11.18.12.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 12:41:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 37DDB5F8E9; Mon, 18 Nov 2024 20:41:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731962484; x=1732567284; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eHplRik/YcnR60UB43A7Gp9H2sYINST0OAHvGPPuMSA=; b=acvYzKnbD+BXmYCUeI1WBKGIMbq0Bwzf7Yc3d8JtV1raLgYx97VNXeOpWj6JiJaYeH C7b/dcbuYBGfOtfgPFTV+WrRpvA6CCBBzKgpABzUYIj8t7RhQZISRmrHtAL7lGmT72JS bYa0bWvBBSsKMUK7C+K8D9DxDLfOVWkq9sT5pzdzc0oqDnFVcuMuUuSD+k+xT648TB2k gBzVA1HRx+bqVYDmPu5e5grGaC2NYRXn/OTo/mh4P6M7guc2X12fJO/E5LhpzUfOcFFW pO7ldWovVvyriHR3MexccP91y2ZLDfqFeJQ90LKlUDRur/N67vMqpj3kP/byHfr5LN9x +WGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731962484; x=1732567284; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eHplRik/YcnR60UB43A7Gp9H2sYINST0OAHvGPPuMSA=; b=UR86IOkPYbggMCVLPkwEZCXKvmrSop6QJ3AVbD1zMUkmsPUaxTCs4bz6grrQFNucTg GIo/7SDwKkcK/U8S7RCHUGVqqgBCIyv5nWxCkOjjXYood2Qe6mRk1LvVXNhLNCElxRjH InH57YTvey8dCojyANedNQDyLUFQe5x/EGek4g6vud9t5wTPhZIlv9ysk+9/3dIt2JjK 5GPHJRguoDuI1Bx+KG3WW/ZVrYpbfnFwxx14oE4GA7NFA+wU0er09iw1lKpRXuSMPfVa VDK01L1pWFg7P4idexJV9QMQRoV39BWBxZLP/GNIHABbSkL89UnQH7jOMizFwuQjSCoZ DM5g== X-Gm-Message-State: AOJu0Yxi8mLAXXplyJ0f8Nh2R7BfDH8b6kCM975Ry5+elWuNJojfMFPP i4kd/FrjQ4sDeop0raXktVj7R9lfqvxgtIlNfubIYi16/uMAgyffAtKHuhaDbeo= X-Google-Smtp-Source: AGHT+IHSZTPpMD1xwncPVNmStBGMBG/0LbJF37QW2VIFds0Bat3Vr/oKbEdnHgtRKiu0KWTRsRGQQA== X-Received: by 2002:a17:906:4fcb:b0:a9e:eee8:4947 with SMTP id a640c23a62f3a-aa4c7e256fbmr67195166b.9.1731962484533; Mon, 18 Nov 2024 12:41:24 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Ilya Leoshkevich , Gustavo Romero , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 1/4] tests/tcg: Stop using exit() in the gdbstub testcases Date: Mon, 18 Nov 2024 20:41:20 +0000 Message-Id: <20241118204123.3083310-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241118204123.3083310-1-alex.bennee@linaro.org> References: <20241118204123.3083310-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731962553205116600 From: Ilya Leoshkevich GDB 15 does not like exit() anymore: (gdb) python exit(0) Python Exception : 0 Error occurred in Python: 0 Use the GDB's own exit command, like it's already done in a couple places, everywhere. This is the same fix as commit 93a3048dcf45 ("tests: Gently exit from GDB when tests complete"), but applied to more places. Acked-by: Gustavo Romero Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Ilya Leoshkevich Message-Id: <20241022113939.19989-1-iii@linux.ibm.com> Signed-off-by: Alex Benn=C3=A9e diff --git a/tests/guest-debug/test_gdbstub.py b/tests/guest-debug/test_gdb= stub.py index a715c0e3f5..4f08089e6a 100644 --- a/tests/guest-debug/test_gdbstub.py +++ b/tests/guest-debug/test_gdbstub.py @@ -10,10 +10,16 @@ =20 fail_count =3D 0 =20 + +def gdb_exit(status): + gdb.execute(f"exit {status}") + + class arg_parser(argparse.ArgumentParser): def exit(self, status=3DNone, message=3D""): print("Wrong GDB script test argument! " + message) - gdb.execute("exit 1") + gdb_exit(1) + =20 def report(cond, msg): """Report success/fail of a test""" @@ -38,11 +44,11 @@ def main(test, expected_arch=3DNone): "connected to {}".format(expected_arch)) except (gdb.error, AttributeError): print("SKIP: not connected") - exit(0) + gdb_exit(0) =20 if gdb.parse_and_eval("$pc") =3D=3D 0: print("SKIP: PC not set") - exit(0) + gdb_exit(0) =20 try: test() @@ -62,4 +68,4 @@ def main(test, expected_arch=3DNone): pass =20 print("All tests complete: {} failures".format(fail_count)) - gdb.execute(f"exit {fail_count}") + gdb_exit(fail_count) diff --git a/tests/tcg/multiarch/gdbstub/interrupt.py b/tests/tcg/multiarch= /gdbstub/interrupt.py index 90a45b5140..2d5654d154 100644 --- a/tests/tcg/multiarch/gdbstub/interrupt.py +++ b/tests/tcg/multiarch/gdbstub/interrupt.py @@ -8,7 +8,7 @@ # =20 import gdb -from test_gdbstub import main, report +from test_gdbstub import gdb_exit, main, report =20 =20 def check_interrupt(thread): @@ -49,7 +49,7 @@ def run_test(): """ if len(gdb.selected_inferior().threads()) =3D=3D 1: print("SKIP: set to run on a single thread") - exit(0) + gdb_exit(0) =20 gdb.execute("set scheduler-locking on") for thread in gdb.selected_inferior().threads(): diff --git a/tests/tcg/multiarch/gdbstub/prot-none.py b/tests/tcg/multiarch= /gdbstub/prot-none.py index 7e264589cb..51082a30e4 100644 --- a/tests/tcg/multiarch/gdbstub/prot-none.py +++ b/tests/tcg/multiarch/gdbstub/prot-none.py @@ -5,7 +5,7 @@ SPDX-License-Identifier: GPL-2.0-or-later """ import ctypes -from test_gdbstub import main, report +from test_gdbstub import gdb_exit, main, report =20 =20 def probe_proc_self_mem(): @@ -22,7 +22,7 @@ def run_test(): """Run through the tests one by one""" if not probe_proc_self_mem(): print("SKIP: /proc/self/mem is not usable") - exit(0) + gdb_exit(0) gdb.Breakpoint("break_here") gdb.execute("continue") val =3D gdb.parse_and_eval("*(char[2] *)q").string() diff --git a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py b/tests/tcg/= multiarch/gdbstub/test-proc-mappings.py index 0f687f3284..6eb6ebf7b1 100644 --- a/tests/tcg/multiarch/gdbstub/test-proc-mappings.py +++ b/tests/tcg/multiarch/gdbstub/test-proc-mappings.py @@ -3,7 +3,7 @@ This runs as a sourced script (via -x, via run-test.py).""" from __future__ import print_function import gdb -from test_gdbstub import main, report +from test_gdbstub import gdb_exit, main, report =20 =20 def run_test(): @@ -12,7 +12,7 @@ def run_test(): # m68k GDB supports only GDB_OSABI_SVR4, but GDB_OSABI_LINUX is # required for the info proc support (see set_gdbarch_info_proc()). print("SKIP: m68k GDB does not support GDB_OSABI_LINUX") - exit(0) + gdb_exit(0) mappings =3D gdb.execute("info proc mappings", False, True) report(isinstance(mappings, str), "Fetched the mappings from the infer= ior") # Broken with host page size > guest page size --=20 2.39.5