From patchwork Fri Jul 5 16:04:21 2019 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: 168560 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3757652ilk; Fri, 5 Jul 2019 09:08:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/k5vuACXxB/XXw9aZ8OMV/NKX7OlFwClF7Kz9SwOsI+bhzREw9NLzXzyO/hoJSGooey9A X-Received: by 2002:aa7:d28a:: with SMTP id w10mr5412334edq.251.1562342919366; Fri, 05 Jul 2019 09:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562342919; cv=none; d=google.com; s=arc-20160816; b=yzv4iJTREroC9L70/eCypAtBHCvSuOra/qngRczs2i1s4vbWxkjdj18J14WDXFwpIu 99bOoBAEUI7G2up7Ug3ZZgmmNXA8AVGTe+4T4vJdU4QACmBr6aK+KqmyahN1nl0RsLPx ZzZ6AZZLhFgP94QczucE/gDJ+1YyiHKIO9cRFHFV8BXnbfMXzsibZokzCfAMb/YI93/p 9dEM2HFLtx4go+7rxrSigAtgI8O8YerhhWlVnrg7TTALhLIGzt5IMsWnwveewpQgeq3g F12vFcxUAnY9cD0YLKS+93HKwp8bwcOAu6kZQnNyWypqjCYQj3hryVeDX0nwCts67VZ8 SZvw== 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; bh=qOB93lgrL4R9/I6qfgAIZn9QujVBWBIWVU/5cvf+96Y=; b=puHWmJ5v8RoAwRl5G3c7NkKzVZAqalJwniAGoF1MOqn/1PYl7Q7hXzbFa0wHRzamMi JpcSvPB+bInb3xnoSNxbrNBMt+lA7ux0jeGifsxX1K5dOfB7ivDkz2oZbs6AdJp5ezBf 7/HKmdZYGHxoURZw83K75Vq+1VU3fr4Yd6Q1YjP0DrSt6M5GQpfxlrjAlrLnYkB0S3Ab KAjR5cr6ywXpbOtdNvKkJwhglXnZ+CSs7AbeNUmUPuHqMusqO7v1q5/oDTp5wUWZunfZ LXFeO0RVUHInjU0aSwXpJNGkfl4znfp0asfCgLhEoClCyRh8CcmCeXK0fxUsu+7WP2/y 6GHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="yHISs/FM"; 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=fail (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 l53si1582127edd.293.2019.07.05.09.08.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2019 09:08:39 -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=fail header.i=@linaro.org header.s=google header.b="yHISs/FM"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjQlK-0006en-C9 for patch@linaro.org; Fri, 05 Jul 2019 12:08:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40288) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hjQhc-0002vB-JY for qemu-devel@nongnu.org; Fri, 05 Jul 2019 12:04:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hjQha-0001qR-D5 for qemu-devel@nongnu.org; Fri, 05 Jul 2019 12:04:48 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:33290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hjQha-0000XK-4C for qemu-devel@nongnu.org; Fri, 05 Jul 2019 12:04:46 -0400 Received: by mail-wm1-x342.google.com with SMTP id h19so7885306wme.0 for ; Fri, 05 Jul 2019 09:04:26 -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=qOB93lgrL4R9/I6qfgAIZn9QujVBWBIWVU/5cvf+96Y=; b=yHISs/FMVOK0HYzPaloOwliLqK1L8EbywhZiD2dTaa3syaAx/DPfSJEQErohzcjhA+ fg+urcQHJcWn/tJF9hTAVXjaPJfxQskfNA6vlzpgC+qWP/e8zsmWvCwIDiLBhHSmW1F3 4ADA3/qEe2aTD7a4nD6bkKmMSo9b/YkVLN3nsAQl9WPdNd5ShUxfS/M6tobWe1s0QkDu EfyF2/IeKo3dr7JqxNKdq6lI0srD+WctTrKt7iCBenTHUnSh/Ju0q34qweMj5W2R4M2S q5htEUZZXPfIXEadiUxDtcBC1oUNF8UMDwJYbPxLYsezj4Ktnl8tWPcBQ4EmvjQ7rywV HT8w== 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=qOB93lgrL4R9/I6qfgAIZn9QujVBWBIWVU/5cvf+96Y=; b=EUwH/6gAGP5VckRw5aPzN9vJbxAYcFFeLa1gfy9VVWyjZTOlUR+CUFpIi96l22dLLF Xa134y6ZRLwPn4VYnmjjvDTkVg1YemXtBTUtX27VJIPAD6mAXmq/bl9nszstXj+lB2Wv 5+lPaE7FmNgIBXf8IsznI3KpaZgDfCkz+YzGEV0vIadARHUPjB+FWXeBEUmJZr+Ss0QF HN2oBonW3+VUMBfYoEcAp2RR8mSeADqupMZcbYE+yJYFTZdyo9X73Ky+woipO+72wWT3 LC5UjQvWXN8/lbDvMLMCa6vfM7RxnJnJYmP1e3MV1ASzUBe7H+uCgc+JJCQjp+LsvaCC XPPg== X-Gm-Message-State: APjAAAWb2T0G7XKrsB1ABcyWThDQIP5wMHAExPmKi1ub1ykOFFzcxfVK JxYQuaeDDjxEIdBSvyi0prwJQw== X-Received: by 2002:a7b:cc97:: with SMTP id p23mr4185121wma.120.1562342665585; Fri, 05 Jul 2019 09:04:25 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t15sm9442318wrx.84.2019.07.05.09.04.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 05 Jul 2019 09:04:24 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DDC011FF92; Fri, 5 Jul 2019 17:04:21 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 5 Jul 2019 17:04:21 +0100 Message-Id: <20190705160421.19015-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705160421.19015-1-alex.bennee@linaro.org> References: <20190705160421.19015-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:4864:20::342 Subject: [Qemu-devel] [PATCH v1 5/5] gdbstub: revert to previous set_reg behaviour 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?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Jon Doron Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The refactoring of handle_set_reg missed the fact we previously had responded with an empty packet when we were not using XML based protocols. This broke the fallback behaviour for architectures that don't have registers defined in QEMU's gdb-xml directory. Revert to the previous behaviour and clean up the commentary for what is going on. Fixes: 62b3320bddd Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Cc: Jon Doron Cc: Mark Cave-Ayland --- gdbstub.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/gdbstub.c b/gdbstub.c index ea3349d1aa..b6df7ee25a 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1669,12 +1669,23 @@ static void handle_remove_bp(GdbCmdContext *gdb_ctx, void *user_ctx) put_packet(gdb_ctx->s, "E22"); } +/* + * handle_set/get_reg + * + * Older gdb are really dumb, and don't use 'G/g' if 'P/p' is available. + * This works, but can be very slow. Anything new enough to understand + * XML also knows how to use this properly. However to use this we + * need to define a local XML file as well as be talking to a + * reasonably modern gdb. Responding with an empty packet will cause + * the remote gdb to fallback to older methods. + */ + static void handle_set_reg(GdbCmdContext *gdb_ctx, void *user_ctx) { int reg_size; if (!gdb_has_xml) { - put_packet(gdb_ctx->s, "E00"); + put_packet(gdb_ctx->s, ""); return; } @@ -1694,11 +1705,6 @@ static void handle_get_reg(GdbCmdContext *gdb_ctx, void *user_ctx) { int reg_size; - /* - * Older gdb are really dumb, and don't use 'g' if 'p' is avaialable. - * This works, but can be very slow. Anything new enough to - * understand XML also knows how to use this properly. - */ if (!gdb_has_xml) { put_packet(gdb_ctx->s, ""); return;