From patchwork Mon Jul 22 16:07:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 813726 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp1940921wro; Mon, 22 Jul 2024 09:08:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWFEyoQjGrZ0yvg+z2VNiMX/FrjJrUwyRjsP4T3uEoOmpFcmav+jv0QEWiuSkz8063+M+gcXj8iBd28enOWhKiR X-Google-Smtp-Source: AGHT+IEnNog3JaTPZsBrjzxrzDy25dN2+vCZZMUZnlTGBHaRdDQ1CP6ZmfsH55p3MKZZjtpF9LeQ X-Received: by 2002:a05:622a:110e:b0:447:dc01:eb1c with SMTP id d75a77b69052e-44fc5516983mr3085481cf.26.1721664512035; Mon, 22 Jul 2024 09:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721664512; cv=none; d=google.com; s=arc-20160816; b=kDQZn6MPjA+Z20Ya+q7k79m9IVS18otaJmYLyAycSI/Bou1r6HUzi8AGCsaDUcbwKm 5XhMQmNJzJLRHjlfsEtjq/7rCMWB0dr2z5Br2MFHDvQsgITceXMTEutby+CKW3O2aHLC mCEyGNBI4ekOf5kw/xGtzO1Qb84xKuk142sXc/kAagrkjtinA6YJ18p9qBtCKZv1DgdE yqS/3S1P7hqsyjwsBZgdLchVvXgEo1R6AZnz1qjn2fAb09EXWVpCwCIAxWRB3EgYdLCI VxQsVM5YYKaRu6sSegeRz6eStgKJTAGoDPNF6kSze4OGTWterxDf1ZIzq0ejGjgy0BxQ /i6w== 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=Pcell0MRaFDFSI4iiBTc3IYNF1B/5BVQzfL7iLBoEns=; fh=fQSRkfw+DkTHa5KQssXieneufL+rl3wPoA2jkVIsZpk=; b=YYqq7CzoGGJH87tM787M5uxSstoyAJKvuLfo7+2/FMfd7hK/nuiLAj96cc3a1ji44n wQmA+B+tx2lAhZ9p7WETKHOdgW8gyPAn0gVECv3nfNEvlY88OTfmAWIFpmSP4NCWjyI1 /DZ1kkgUZ6E1SzVfIc5fgicNFjgQJFsCBUjY3wK68Iu+wda0YPp98XhfbgtmAohtEY7C 5xT3RszD3vF3HCzLwjqmZh8Rf3qk/Y8BGkF+wTP2+sMNSViuLX6opRXybEkwN2IBGZqP 4VgODY9aHN0TY1SC+lky7QsJuJCSrdIxc/J93dOqa4lslKlMYa/S5UqMEKgb7KK1sgE1 ZJ4A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BfOmtheK; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f9cdb6c85si77084711cf.313.2024.07.22.09.08.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jul 2024 09:08:32 -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=BfOmtheK; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVvZk-0004pU-Sm; Mon, 22 Jul 2024 12:07:50 -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 1sVvZZ-0004hi-U4 for qemu-devel@nongnu.org; Mon, 22 Jul 2024 12:07:38 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0: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 1sVvZY-0007eH-07 for qemu-devel@nongnu.org; Mon, 22 Jul 2024 12:07:37 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1fd66cddd07so19100695ad.2 for ; Mon, 22 Jul 2024 09:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721664453; x=1722269253; 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=Pcell0MRaFDFSI4iiBTc3IYNF1B/5BVQzfL7iLBoEns=; b=BfOmtheKYokTvSpqyisaCna6zq5wYW4zeZiwNcjz6VYBBST4pCyAF5LAbrbEQ615yi ddqGicJ82Rml3WETrK/2E7ZMKs4mj25IVGdOPx1Pc+ng31wIRJypJ90e9rbC7I6DA2By qIobCT4HCA24BSV5dq3r/Qzh9bajclPIOcWte/bbsB5wKZmftgnysJemJd+Nx4ZI53bY e5DK6565Fdhy8P0XBtuC/HTQFIetcEVOrkrSjz/o8XGzn0y2J6Q1iCx91ZHuorfaXG4y 54pn38M8PyVvuJ2zvTX06L35dgGcJNXFlgqh7sZqH/u45IuhjG+0zYhg23cZEdybJt3q PXMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721664453; x=1722269253; 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=Pcell0MRaFDFSI4iiBTc3IYNF1B/5BVQzfL7iLBoEns=; b=R5XgyuSxlKdpY1XZ7QRy9ra+hYJU7wwnS/ywDfxAR5ufxSAssM0sGCAyQzBG/82dqt plYkdPYqaX5SpJQCSZN8OzyqAOHcbS9JOACBTST6BfExfMnOdz1bSnsB4wGzzEa/nomI 3DakXOHRrohOoEYLpycvg1vpXlGW4ilXhpagIIsfbjm5C98gS85iFTy4cupbdnCPtgGc hSPscdPsI4wtuhxFXP1TfGfTgVlc0bux49/MfOurYn4vjI2QQ/eE1e/MMGVpReZczqkd R4pHNqoFZX+ckkxHlZgdkmTJdbbBA+a/aDYFzctt4fa2lgyz3CSlS6I7dY5uOmJ+9wVn 3wjA== X-Gm-Message-State: AOJu0YwlH1LP4tKqPPYQ7J7CjyzT7YFiNLVoa5Y2xQ/3vverbaTDz8uZ llbAzmoKAgY45BVWEHceBz1xEIDcfmBJft8RbeUwPr532pPSQwWeusxofCepsPPEEMzQleDyr12 X X-Received: by 2002:a17:902:e84a:b0:1fc:6acd:1ecf with SMTP id d9443c01a7336-1fdb5fae0f2mr2001145ad.65.1721664453120; Mon, 22 Jul 2024 09:07:33 -0700 (PDT) Received: from amd.. ([2804:7f0:b402:9243:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f2ac8eesm56533165ad.118.2024.07.22.09.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 09:07:32 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, philmd@linaro.org, alex.bennee@linaro.org, richard.henderson@linaro.org Cc: peter.maydell@linaro.org, gustavo.romero@linaro.org Subject: [PATCH 3/4] tests/guest-debug: Support passing arguments to the GDB test script Date: Mon, 22 Jul 2024 16:07:08 +0000 Message-Id: <20240722160709.1677430-4-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240722160709.1677430-1-gustavo.romero@linaro.org> References: <20240722160709.1677430-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=gustavo.romero@linaro.org; helo=mail-pl1-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 This commit adds a new option to run-test.py, --test-args, which can be used to pass arguments to the GDB test script specified by the --test option. The arguments passed are in the key=value form, and multiple pairs can be passed, separated by a space. For example: run-test.py [...] --test --test-args v0="string" v1=10 The 'v0' and 'v1' variables will then be available in the GDB test script, like this: print(v0) print(v1) Signed-off-by: Gustavo Romero --- tests/guest-debug/run-test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index 368ff8a890..63b55fb8bd 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -27,6 +27,7 @@ def get_args(): parser.add_argument("--binary", help="Binary to debug", required=True) parser.add_argument("--test", help="GDB test script") + parser.add_argument("--test-args", help="Arguments to GDB test script") parser.add_argument("--gdb", help="The gdb binary to use", default=None) parser.add_argument("--gdb-args", help="Additional gdb arguments") @@ -91,6 +92,9 @@ def log(output, msg): gdb_cmd += " -ex 'target remote %s'" % (socket_name) # finally the test script itself if args.test: + if args.test_args: + test_args = args.test_args.replace(" ",";") + gdb_cmd += f" -ex 'py {test_args}'" gdb_cmd += " -x %s" % (args.test)