From patchwork Wed May 31 15:09:33 2017 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: 100796 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp369579qge; Wed, 31 May 2017 08:09:40 -0700 (PDT) X-Received: by 10.237.56.68 with SMTP id j62mr7064800qte.82.1496243380353; Wed, 31 May 2017 08:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496243380; cv=none; d=google.com; s=arc-20160816; b=HdGG/6y26N8Zosz5Ejxe7j2rcC9nMUKZTiKOux7Fy5Gz++N73is52L85NhQVofUyXN XjmGoyaRX/oFgFG0qKHeRYB75vCnP5Ks48aeKdsmzVZWYmJNSgtG4jCa3xnNNVD/7jWU BvtH2NnT2t8UvOxCqWD4FfuSGvUDondIh0uZbVPRpJXmGffCx7LpQFyTU0P8zfYI/Dni 4Z15k0GLuJFBT2paEqlxwOvilsJ/doktoEp7iS1Xi1w6cdZ4dV1KZNIrBUeT1pgpPFBT CzuYDUhVJKZzObYpvTZRQk8zLYbeIMX9hMNdY6r/jel+bhq+Pei9SpmlN4a2JLYnwWaP t0tg== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=6lt72P3aLwFXOUi+wPId6VktQXhcG3oK7BqMKsED0EE=; b=b7ojQktp1qpxxzL6KGB5a+R05V9Ocor6R7On/izN7x7KG0TvORSaGG6ywtTPzL0HT0 rG3zySzeyKTGj3Kw+sp2wvuiAdUgTvxxtz0/O7sWGPDST9tY1la4bVVv0HJxBHbY66p/ 53a6WFINbhHt5N2oNU2Z4JQT8m5UvWyM0zfeGplkin0/WfcU6vaDwVHgdEERP/8DOk3G 3N2wvjzwGAeFZR2czNl496opFk/sQGv6Ue+9f6TAygVRHhuGZcSp23qccIBNUeI5lQL+ k1Uixfjj57sm+5EutjkucBq5DPevT0vl1cNUF9sCDpA3mkpJWJZzu/1ZlvUKWPH0KyUE 3VnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r190si16395819qkf.2.2017.05.31.08.09.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 31 May 2017 08:09:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG5Fi-0007tw-0K for patch@linaro.org; Wed, 31 May 2017 11:09:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG5FS-0007sy-A8 for qemu-devel@nongnu.org; Wed, 31 May 2017 11:09:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG5FR-0005aM-Da for qemu-devel@nongnu.org; Wed, 31 May 2017 11:09:22 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:36739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG5FR-0005ZN-6w for qemu-devel@nongnu.org; Wed, 31 May 2017 11:09:21 -0400 Received: by mail-wm0-x22b.google.com with SMTP id 7so122366400wmo.1 for ; Wed, 31 May 2017 08:09:21 -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=6lt72P3aLwFXOUi+wPId6VktQXhcG3oK7BqMKsED0EE=; b=eWjUKzXiK9Erm0vxFTlZkRCR8gRNQSgo+CN5tYOfTuJ8vpWxJMuWWwAs0X74ciCoqH jI+kZIG02TkPKiQdHrIHYMPGTnUfkEnuf7NajjaWH0T44diYVIQhRJfN+u7NW4WeMjUh Dyiimag+VCSqzOG/YyyOCh5MpgJo9kICj5afE= 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=6lt72P3aLwFXOUi+wPId6VktQXhcG3oK7BqMKsED0EE=; b=s7sYZ3Uw3CR4SkASEMlzvK46DzGBIRBPdJAFuyAkHLHWISf/EyxhTlh3mrTXDzt10P UWsRqJCefqqYiB8MtW5Q9nVvJBqrup0BJLHUZhNkNCnUS8zYEEbSIx2eyCMjQlSxsBcZ bbGwN2f3CHpuv7kxOkcGMV53r9EjZd4rF22clTw0Mi9UAARqsOkY0MKETpCygi/DTQhq fCjvJnvBchzxMsSTMr30kd86fyYWS3254nw6G9KjKdG1z9DU0o8yMdm++7AIlf5WBa4l WtRDPCZ4oG0RMUf9DK93BQpTB2cP8O4xqdHWa/XBLUdTpT5MGoJwIooT4NWfDYY0k8iP yZ/g== X-Gm-Message-State: AODbwcBT4ktQlzfli4p/N7dBKTI6Knj66rjfcd9bPJVpF2vDUMrA6uWt ktSQ8520U0nGNgdK X-Received: by 10.28.145.73 with SMTP id t70mr5416065wmd.88.1496243360124; Wed, 31 May 2017 08:09:20 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j126sm17303823wmd.29.2017.05.31.08.09.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 08:09:18 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B78C33E01CB; Wed, 31 May 2017 16:09:33 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: pbonzini@redhat.com, doug16k@gmail.com, imbrenda@linux.vnet.ibm.com Date: Wed, 31 May 2017 16:09:33 +0100 Message-Id: <20170531150933.10156-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170531150933.10156-1-alex.bennee@linaro.org> References: <20170531150933.10156-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22b Subject: [Qemu-devel] [PATCH v1 2/2] gdbstub: don't fail on vCont; C04:0; c packets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The thread-id of 0 means any CPU but we then ignore the fact we find the first_cpu in this case who can have an index of 0. Instead of bailing out just test if we have managed to match up thread-id to a CPU. Otherwise you get: gdb_handle_packet: command='vCont;C04:0;c' put_packet: reply='E22' Signed-off-by: Alex Bennée --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.0 Reviewed-by: Greg Kurz diff --git a/gdbstub.c b/gdbstub.c index a249846954..29c9ed3002 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -934,8 +934,8 @@ static int gdb_handle_vcont(GDBState *s, const char *p) * CPU first, and only then we can use its index. */ cpu = find_cpu(idx); - /* invalid CPU/thread specified */ - if (!idx || !cpu) { + /* invalid thread specified, cpu not found. */ + if (!cpu) { res = -EINVAL; goto out; }