From patchwork Mon Sep 2 10:21:11 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: 172725 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4129260ily; Mon, 2 Sep 2019 03:21:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwii95o5ffWZ0cE73pBd01E4kqWW9rN4ymnSEMZHQpLn2B58nKCubkkZ/9xg0oNkdEJ84FN X-Received: by 2002:a0c:f6ce:: with SMTP id d14mr17718184qvo.56.1567419707511; Mon, 02 Sep 2019 03:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567419707; cv=none; d=google.com; s=arc-20160816; b=JiMRyZ9UO1nx9sqowXOBM2+fjFjLgobcZeQt97aC2q2f+++QQZxkLZazJikCAY+TZb 7a6ezBhQ4w/da6X2p9GGxU4vs2sEUUTMuOBVuRXoEc9qKF1K3dJuyN+EUBQ70fpoYZD8 pzXsc5q64m7Mz78r3v0Aix8ntObAbAKsZi1FvzAxS6UE8jeaoobHnanV+VegVgbpphh5 NTPpL/9IxDL6bltXk7slPCB8w+DbCePiHnYSJmashuEeLNMy/XkA5dzpyCa4uZyapCfA Nue3C8lpnN9WTd/CcE72IrfR2HDoAv8OYhpU2qwbhDbEzI9zdhvYO+FuirTEv/h2uFCT XB9A== 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=LerAiTk+RHTNAwomwqqVsvMK0Yfd9IxxuCZGECaCdYo=; b=rtMIFHFp9G39mxCGOmZNVDgZr+69YHdAjdfTZtMuWQDsIY3yLNXSTycWGZllejpb/0 pzdlGK708mW9UiL0vgQ6Z023S8y/2M940mUSwjn/77F9bV7/vIHga5iwHzl+ABsU4X2D 0r6fxfCePe6kfzYme56DojgYhk3b6OzID9SX1ENY0eSV1qut7/y6F5ewZo59PqY9qqRb LgzDKnBh1Ap/aDtuQ9Eev1wQv1LWUWfnMguFtfKjs4/P6Uzhbv4vED8pjNTbKkrk9vMS M6GW6t8WPzDjZok6XY9IJtStMN8cZo7EJaUHxy4CL2eT05ny60Xd2f1nWclG2HB2wcR2 gwJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZhsEyGI5; 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 a69si660747qkc.264.2019.09.02.03.21.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Sep 2019 03:21:47 -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=ZhsEyGI5; 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]:34666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4jT0-0004dr-VT for patch@linaro.org; Mon, 02 Sep 2019 06:21:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54786) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4jSh-0004dE-2M for qemu-devel@nongnu.org; Mon, 02 Sep 2019 06:21:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4jSf-0004FN-U3 for qemu-devel@nongnu.org; Mon, 02 Sep 2019 06:21:26 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:54519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4jSf-0004EW-MG for qemu-devel@nongnu.org; Mon, 02 Sep 2019 06:21:25 -0400 Received: by mail-wm1-x335.google.com with SMTP id k2so12496633wmj.4 for ; Mon, 02 Sep 2019 03:21:25 -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=LerAiTk+RHTNAwomwqqVsvMK0Yfd9IxxuCZGECaCdYo=; b=ZhsEyGI5NhReaA1qVILVR1iil7nhfx2NSzpzTnimcgJbrMQ3dBEYnv4wvbwZPzLEXk zywro4zM2eDoYUpJiVMAoKFEMKrUoebOeVdMBPwQKfZqfFtpWkPD+Ktqb21bUO2sbbR6 /i2EXF87BjwuEMqHUognfBb8dhBRTs1tdUC9dseQqPxc9GWzVHLb39gyVJQzOdFNP5SU 6Q7gWf+M743d521hiQdRzbkY6oL+6zvNvJDxGQaQtUDGVr29szniDqU9d5ZwDa3B7TCi 1jJFUZIihX8xKR1V3SYR2vlAIM1cKSrQv9Qzcp859/FZife1MECgHy7bTs1TtZgKhD17 jZSg== 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=LerAiTk+RHTNAwomwqqVsvMK0Yfd9IxxuCZGECaCdYo=; b=g9D01JYIeoME3O2p5fQRA9czDN4JFQb5nO+043TMYPUaGDKhgwIfx04DOa30Eo8keM ud2BErHV+e1TjN7Lx1Rr9kFK5CC/Un2unM5C2jdE3F+CM5fIYSM7XOZXpadIvVXB0VZX zhWTV6P3+g/FCdVKRWhOYlEqmCq6fZEY2LvaLrKOdQpe0oZVSVCFL3JiRwaDFHo2rLPk 3o9M4Mbl3MJ9kmftYVp1SEghbng/ld4qWRORYhHn1Utzfnkdxq7/gjrysyPXWuVnOTMZ luWEUUj4g2KkkrQaArv0/ePLo9rmE5hNOwzEGPIGQIa+ggt6Id/0Xjw2npEYLpcvRH/k WgMA== X-Gm-Message-State: APjAAAXkrwycsB5SqrQEMVD6q/S64spCxLmRRHpAPFkk6+FUtukyeEQ7 o81CcOwA3Td8BNafNUVfNS6z/CBVkyw= X-Received: by 2002:a1c:6a0b:: with SMTP id f11mr32436446wmc.87.1567419683475; Mon, 02 Sep 2019 03:21:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g26sm11849821wmh.32.2019.09.02.03.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 03:21:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 51E271FF8C; Mon, 2 Sep 2019 11:21:22 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Mon, 2 Sep 2019 11:21:11 +0100 Message-Id: <20190902102122.1128-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902102122.1128-1-alex.bennee@linaro.org> References: <20190902102122.1128-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::335 Subject: [Qemu-devel] [PULL 01/12] gdbstub: Fix handling of '!' packet with new infra 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?= , Ramiro Polla , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Ramiro Polla Since the '!' packet is not handled by the new infrastructure, gdb_handle_packet() would call run_cmd_parser() with a NULL cmd_parser value, which would lead to an unsupported packet ("$#00") being sent, which could confuse the gdb client. This also has a side-effect of speeding up the initial connection with gdb. Fixes: 3e2c12615b52 ("gdbstub: Implement deatch (D pkt) with new infra") Signed-off-by: Ramiro Polla Message-Id: <20190805190901.14072-1-ramiro.polla@gmail.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/gdbstub.c b/gdbstub.c index b92ba59e4df..5c067594bae 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2588,7 +2588,9 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) break; } - run_cmd_parser(s, line_buf, cmd_parser); + if (cmd_parser) { + run_cmd_parser(s, line_buf, cmd_parser); + } return RS_IDLE; }