From patchwork Fri May 17 15:02:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 797475 Delivered-To: patch@linaro.org Received: by 2002:adf:e68e:0:b0:351:d90a:5487 with SMTP id r14csp815373wrm; Fri, 17 May 2024 08:04:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXIcZthClKgdq/FXD9hpsJrbeBPrx73IuzVBpWhgn/qdYSiOZvKXWJpCl1pN5fHgSbjkOPJAlh0qeDX3r1/jmNQ X-Google-Smtp-Source: AGHT+IGaJ2s9/D30PYUuMRdx/1DoN9RGNSOze4lUOKPRasAOmJbXB8Y5mz8eMlPlA8H3QafABIW6 X-Received: by 2002:a25:d04d:0:b0:de4:5c35:62d with SMTP id 3f1490d57ef6-dee4f314afamr21700575276.52.1715958259512; Fri, 17 May 2024 08:04:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715958259; cv=none; d=google.com; s=arc-20160816; b=SK1tqzc++Id6TJD0ew42oPWwaQ5I00MKNNFUbnax4NaOTtOZea/grzcuPGTaRK1W8D B3QIKojfZ6ncXdVyrRSGmqyTKUqEFpRSIBXntwZ4j4ORzrSgsQ1s3JWTjcCSZFJarMJ/ zAAn3aobaET22JZP1xRO8UY16XCCY8CHhZLbGkVSPBotP7xgG9LAx7iqE6BM4kmf8KH4 W/+4gPwW+EJq5szu515KAuBlmwmZiVSjisEvhKvZacsVmkbL9KA9aDD87xpjTXWgqZjH 57ENeCkBwq4uP52ZTeE+1XcxzxJoM9pqNWa988TvdCTIchK0qYJ7Vj94cm2VZq/XPAEI oIhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CZ4R0GpwuiTGFZYxz5B+fpMVNyC6MJRh/IKnd5gDIFo=; fh=ePyGoEiUVsGq5muf6+HqrCJFUwgxhWNYwaYwKs9b+Tk=; b=lSZ6K/ke+IRFU6glK9n3DzMB7gvXV431a/bPo9dyjHzDBMALdq3epJg4KMchXIIbGf xzcl6//cdSO3dR2pEIFkFCPjuSlP3H6IqkPLp3nbo3qk/SBg/3VtcvAbiCale2ATFV/9 f4uNx+B8FuPcq9buQaTWD/1dpO4QvoZHsVI5sQ3cVAtq73WchFHjKgrst+O5vb1oXtK2 44RP6xi2YX6tedaeCh+hfzwXtC1dbaYSRl8V1g1blYlnrY5ESIJpjmcz6xZDThxTA9Bk ROtuJmCVAfZgeeovAOZzW+N4kgTxG/ZSOunxtBYeHxnpOHUdaS9EvywmhW9z0ifDSmYp MjhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fEqAGDOJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 3f1490d57ef6-decd2f716c1si8491999276.673.2024.05.17.08.04.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2024 08:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fEqAGDOJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7z6q-00051a-9F; Fri, 17 May 2024 11:03:00 -0400 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 1s7z6o-0004zq-RV for qemu-devel@nongnu.org; Fri, 17 May 2024 11:02:58 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s7z6n-0005QV-8n for qemu-devel@nongnu.org; Fri, 17 May 2024 11:02:58 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a59e4136010so514879566b.3 for ; Fri, 17 May 2024 08:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715958175; x=1716562975; 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=CZ4R0GpwuiTGFZYxz5B+fpMVNyC6MJRh/IKnd5gDIFo=; b=fEqAGDOJK1oItUQ4vhKuDvBvDFXISaGMwkUtHoUqXBih+NB0f56QPJqjcJbnXfXqf8 iENDaUdQX5HmbT0dJVc+tDvELlCWyQWfdl6YM/TlC6Vcuf8FmrnhPR6sfaZNl7tuQMWR PZnu6jDnnWnd34Qzdt0Efrljz3eqCqNmCXqLKBxJsAtJoN53+GSx4FMAiXryxYtQEOEl ZymReNmfbuKfpQQuFWeL2d00zm9lCaJ6qOph0AkbRyojd3x+wKAaoxsV/ljFU09HSp8v xlkeVP/FrqXVO3mgQcelste2cYC2q4+/PjvfQznHOUoUz8+Bvt4GhYawXQ+BBBSGMFGR F+Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715958175; x=1716562975; 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=CZ4R0GpwuiTGFZYxz5B+fpMVNyC6MJRh/IKnd5gDIFo=; b=vNcIFvSlwneF2mU9YBwRhdRmaipNivuPL2W9o6vyqqw+TwOvvsrh8/t7aUnAky2Kxw wOU6AxNcbLShQgoqDL8zJRbCDVgvWewL6tEq049C8NX9u7XR7NkbJQ2KKJpuftGk9L3o QB2afaGmQfB9MBGw7g5nUsrKboJP1VNB0M7mek7wtIASGuzWNbwxM6DDIUVyCymh04jh ABz03fUp+pJQjN9k066jNZ81jEYaTWF/9tFZhbdPzUy2AhFu+Risp8A8iWoV2cygmi6K VOonY9IyRDVe+lxMzaGsqyNdcx9xKpob84msSYPOI85Vf65vvHTxZNva+DJcNoxb2Vj6 1JsA== X-Gm-Message-State: AOJu0YzED+PuuuscOy3UAGUEP2B3GSmez5cMLzbuHxRZXuJqEDPXcDwt fZYS9DTc0eEtZvx3TkJuwJbx8Sm7INv2IK4H4KsAub/MKjMZbIpv5u6kZ3GhkJAzOLEvNrxKnyf z X-Received: by 2002:a17:906:15cd:b0:a59:c9ce:3386 with SMTP id a640c23a62f3a-a5a2d5cb0c1mr1344291466b.33.1715958175249; Fri, 17 May 2024 08:02:55 -0700 (PDT) Received: from localhost.localdomain ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b17555sm1120578666b.189.2024.05.17.08.02.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 17 May 2024 08:02:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gustavo Romero , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PULL 5/5] tests: Gently exit from GDB when tests complete Date: Fri, 17 May 2024 17:02:27 +0200 Message-ID: <20240517150227.32205-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240517150227.32205-1-philmd@linaro.org> References: <20240517150227.32205-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Gustavo Romero GDB commit a207f6b3a38 ('Rewrite "python" command exception handling') changed how exit() called from Python scripts loaded by GDB behave, turning it into an exception instead of a generic error code that is returned. This change caused several QEMU tests to crash with the following exception: Python Exception : 0 Error occurred in Python: 0 This happens because in tests/guest-debug/test_gdbstub.py exit is called after the tests have completed. This commit fixes it by politely asking GDB to exit via gdb.execute, passing the proper fail_count to be reported to 'make', instead of abruptly calling exit() from the Python script. Signed-off-by: Gustavo Romero Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240515173132.2462201-4-gustavo.romero@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- tests/guest-debug/test_gdbstub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/guest-debug/test_gdbstub.py b/tests/guest-debug/test_gdbstub.py index 7f71d34da1..46fbf98f0c 100644 --- a/tests/guest-debug/test_gdbstub.py +++ b/tests/guest-debug/test_gdbstub.py @@ -57,4 +57,4 @@ def main(test, expected_arch=None): pass print("All tests complete: {} failures".format(fail_count)) - exit(fail_count) + gdb.execute(f"exit {fail_count}")