From patchwork Thu Apr 23 17:05:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 185738 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp2300335ilf; Thu, 23 Apr 2020 10:12:14 -0700 (PDT) X-Google-Smtp-Source: APiQypJN/5SGQHTqf1ob9OIrLJFcMvQNEbW5FGLLcF2MxCmBuLO2pYNx7QBfQNTUdsoCdBXFenu9 X-Received: by 2002:a37:66d8:: with SMTP id a207mr4543340qkc.127.1587661934128; Thu, 23 Apr 2020 10:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587661934; cv=none; d=google.com; s=arc-20160816; b=M25aEjYkt2HX3A4mBdApd/x51j90fUdYnMkgK5TrTu8VChuFjBaMTvmaaFtVq1dUAN phGriTIAbxJBaWvVTYoUuaw0NeO7cs3X+5lGke19bVShkXOL1uLH4xngT+C5PJGcvxkG z/OsZ0lOfrPpYYAnTco4n9Q1ga6c8QRFQ+EmwYt9ZOgy3jcEPh6DDDJ8KW5JNAzrTe1p ExsiemGt6WYCO5l2KCgwHxzJYjeqabI60UMJfkb2HpChjnxuo1JJ4eXqbZ+rNN9cUVLv O2J9VRn46uNwaJS3DF1/Ji3dd0dZofyG8YBRLhSsS0ldsBz7lfcdGtx5LLckmkilX2Uv 9lcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Y8OzSKmIFiuLHfxz8DEOePw2xLZ8ATDtg6VRRYMl4sc=; b=xZHri9G7o0d/JjWRBPz2VdDfi1vHSyj3vNOwjtlDtHp+dOxngwGclWFCRFCxq2yTL8 jxueDjGExWI9ELEByxqMIMYbZLQeDX0DxiqAV8zE7rxOZmGMXFxPtn1eARNsiLwbl6mT uVVhh/ZsmngJGjHvB1GKllqBvejl6XMN9EixaKneOjAAllShLWk9ZNnqirFgfkwH1Ycv VkUCwAY1qrxht0HSVDTtyVBBL5dlKONKw7IKDA69JPwCNPILsMSkYEFSK+Whv7EXwcfS TgWPcQk4bPXVuPpSZQsCnBL+rudaUd0D8uHkJTRbKKleeXNJQLbq+BZNn+VdL/+OKNN1 DxGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wYg220OT; 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 o3si1730552qkj.31.2020.04.23.10.12.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Apr 2020 10:12:14 -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=wYg220OT; 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]:32848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfOX-0006js-Ib for patch@linaro.org; Thu, 23 Apr 2020 13:12:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44686) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfIm-0001JC-F4 for qemu-devel@nongnu.org; Thu, 23 Apr 2020 13:06:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRfIl-0005bo-Sp for qemu-devel@nongnu.org; Thu, 23 Apr 2020 13:06:16 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:34459) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRfIl-0005bB-F1 for qemu-devel@nongnu.org; Thu, 23 Apr 2020 13:06:15 -0400 Received: by mail-wr1-x443.google.com with SMTP id j1so7717940wrt.1 for ; Thu, 23 Apr 2020 10:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y8OzSKmIFiuLHfxz8DEOePw2xLZ8ATDtg6VRRYMl4sc=; b=wYg220OTNpfgoYnWxxgyBCi5xOG4qmF9wbC9NzmnwLUZT6drZM0KuvZFIXnmpccHmb vauj8E/R7uYV7LmV1unP4OdVwij3vZ5S7QIYsR/L/3/zDgV3WI1ziUeJ7nR3rYxmKrK+ qrgcB0AG0i/LJXScpR8lrmJRU77k253bf9eCKeWLhFhMFCaVl/dY9S9eyBBRqWNT7b2X H/nIgeJQ6Ooxva0ZoHX2dSAlJgthdW69OsmrCPb+6DEwYblUGei0bx2bpzb560Bld5da PnWdjFU8rJogvgtaqgWG9jH6Sv34ClIRVN96b9JGs4MV0Gy+gbMlWoUh1ROq/idW+zhQ HN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y8OzSKmIFiuLHfxz8DEOePw2xLZ8ATDtg6VRRYMl4sc=; b=F2k4V74Bu8vQynmfKHFOiHWQJeCKNO+nO+luudFBnMV2TOqVHxhWrrWfEBbfzibCOA tkGyel2bTSM5hqFFIdVXl66DMiXU+iY2avNUpaFM1Rp2TcRwwTSRvfPEJ0cRbcGo4Qi5 C2OxFYbjCTWLtlUnGvgZ+yOHsNbA/QA92YuYGy39K+CBXKsb9p01ljLswJomNybajxnI jvDws7XcPQVH0dvEwAXvIsSZgqbRO7poKFK9q9Ue7BPHdk89Orkd2dIWYdpdHNtbvwGf E+c46ZaTEU9bPoZqZWE/QSJUYvHoPyVos+QmruPuCmwnVgTrupYCTzVhLouS9ALJcC4z WnHQ== X-Gm-Message-State: AGi0PuaKzpr/H6NC978hUYMKASPjAXB9diAam1HQvtKyX7JP8TDHhmMg vTTb0HyU67s3k3iECuAQr206U4hhIOo= X-Received: by 2002:a5d:4b43:: with SMTP id w3mr6095741wrs.208.1587661573681; Thu, 23 Apr 2020 10:06:13 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b2sm5216121wrn.6.2020.04.23.10.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2020 10:06:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4EC961FF9A; Thu, 23 Apr 2020 18:05:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 11/14] tests/guest-debug: use the unix socket for linux-user tests Date: Thu, 23 Apr 2020 18:05:54 +0100 Message-Id: <20200423170557.31106-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423170557.31106-1-alex.bennee@linaro.org> References: <20200423170557.31106-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now we have support for debugging over a unix socket for linux-user lets use it in our test harness. Signed-off-by: Alex Bennée --- tests/guest-debug/run-test.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/tests/guest-debug/run-test.py b/tests/guest-debug/run-test.py index 2bbb8fbaa3..2441a1d623 100755 --- a/tests/guest-debug/run-test.py +++ b/tests/guest-debug/run-test.py @@ -15,6 +15,8 @@ import argparse import subprocess import shutil import shlex +import os +from tempfile import TemporaryDirectory def get_args(): parser = argparse.ArgumentParser(description="A gdbstub test runner") @@ -41,11 +43,14 @@ if __name__ == '__main__': print("We need gdb to run the test") exit(-1) + socket_dir = TemporaryDirectory("qemu-gdbstub") + socket_name = os.path.join(socket_dir.name, "gdbstub.socket") + # Launch QEMU with binary if "system" in args.qemu: cmd = "%s %s %s -s -S" % (args.qemu, args.qargs, args.binary) else: - cmd = "%s %s -g 1234 %s" % (args.qemu, args.qargs, args.binary) + cmd = "%s %s -g %s %s" % (args.qemu, args.qargs, socket_name, args.binary) inferior = subprocess.Popen(shlex.split(cmd)) @@ -56,7 +61,10 @@ if __name__ == '__main__': # disable prompts in case of crash gdb_cmd += " -ex 'set confirm off'" # connect to remote - gdb_cmd += " -ex 'target remote localhost:1234'" + if "system" in args.qemu: + gdb_cmd += " -ex 'target remote localhost:1234'" + else: + gdb_cmd += " -ex 'target remote %s'" % (socket_name) # finally the test script itself gdb_cmd += " -x %s" % (args.test)