From patchwork Thu Aug 10 15:36:40 2023 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: 1819909 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=eQO22FLd; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RM9zf29M0z1yfB for ; Fri, 11 Aug 2023 01:37:50 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qU7iZ-0005QP-MI; Thu, 10 Aug 2023 11:36:55 -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 1qU7iX-0005OZ-Ak for qemu-devel@nongnu.org; Thu, 10 Aug 2023 11:36:53 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qU7iR-0003FG-9a for qemu-devel@nongnu.org; Thu, 10 Aug 2023 11:36:53 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fe1d462762so9490745e9.0 for ; Thu, 10 Aug 2023 08:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691681806; x=1692286606; 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=iHM26J4ebdoiYZJz3zhEjNseIBWtdhkWcsKebtX2pWo=; b=eQO22FLdiPhn3e0movl88+RJll7ghzw5rpTk7QKrBL1XIehBZSmgDzbS0djyOdwFsU ieUbA47LEcCuW4d7tg5UUZgyMqWGPCGxGyuBEQ/mQjZtN+rxe25GzZuD3QwlZaKVo3gL C03AzwsWUesYegBVlJ8tGQUzN6E0WPCs5YzMYi6EFFH98QbVm/DL+puyrvnlk6d9vx4l 7ZJQt7Kix5B4hLkraEapVKVRS37e0odFJHM2whwL6vHGGX1Czbfu6TqTeIilkDAYTmS/ ZxlA1lndqSJeAS129mCyGMcYteTz//dHOGd0Dr1EqTsQMAL4baRZxFJJE8mRn4yJ6woe W4AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691681806; x=1692286606; 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=iHM26J4ebdoiYZJz3zhEjNseIBWtdhkWcsKebtX2pWo=; b=Hcl/rbT6Q59vJ+bCJwhJk2eo5fDvH1Kzryq44XV25uzdyo1AK53izFgR7MNIJYscwH gZOTBXRzyuIFSfbviWfFSwo2W7lP4oxFY5wQRNDwKkkUrstFMvm59uAwYLsFAZ1oiPp+ LO/0yhIf1X9YLuLpwLWv357j7qCT6kGMIP3GG3IIwn8o/+BovzLTMtj6bY0HbpPkEyUq 38njCXm7yTYZdUKiczmhmc0Bte6rWCd+ynbZ03CUqtpwCAncfRHTY93/u93M9K3yO29V 8hMXE+6yV35oN9+A86mCb1RB0A6vMLm89Y0Zb2TomlNkRJsVsLnRsFb+Daj53LSwFOna ADfA== X-Gm-Message-State: AOJu0YzRQ5wMFblPi13khuZFO9/g8k5lLEA+ECLIMrSH5ucifAXtEGZw fWzjv4v2eP+lG95dGoCOE3M36g== X-Google-Smtp-Source: AGHT+IEWA75NxPGLC9g2qsbdXr3KkBpGt0Axzmi59pPqGpaeuqiw4Xc4KfNtxOdsJP0vTVRNcJyemg== X-Received: by 2002:adf:e8d0:0:b0:314:2e95:1ec9 with SMTP id k16-20020adfe8d0000000b003142e951ec9mr2909419wrn.10.1691681805851; Thu, 10 Aug 2023 08:36:45 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k18-20020a056000005200b00317d2be2e59sm2513473wrx.73.2023.08.10.08.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 08:36:43 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A2D1E1FFC3; Thu, 10 Aug 2023 16:36:41 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich , Yonggang Luo , Beraldo Leal , Richard Henderson , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Thomas Huth , David Hildenbrand , qemu-arm@nongnu.org, qemu-s390x@nongnu.org, Wainer dos Santos Moschetta , gdb-patches@sourceware.org Subject: [PATCH 8/8] gdbstub: don't complain about preemptive ACK chars Date: Thu, 10 Aug 2023 16:36:40 +0100 Message-Id: <20230810153640.1879717-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230810153640.1879717-1-alex.bennee@linaro.org> References: <20230810153640.1879717-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When starting a remote connection GDB sends an '+': /* Ack any packet which the remote side has already sent. */ remote_serial_write ("+", 1); which gets flagged as a garbage character in the gdbstub state machine. As gdb does send it out lets be permissive about the handling so we can better see real issues. Signed-off-by: Alex Bennée Cc: gdb-patches@sourceware.org Reviewed-by: Philippe Mathieu-Daudé --- gdbstub/gdbstub.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 20b6fe03fb..5f28d5cf57 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -2074,6 +2074,11 @@ void gdb_read_byte(uint8_t ch) gdbserver_state.line_buf_index = 0; gdbserver_state.line_sum = 0; gdbserver_state.state = RS_GETLINE; + } else if (ch == '+') { + /* + * do nothing, gdb may preemptively send out ACKs on + * initial connection + */ } else { trace_gdbstub_err_garbage(ch); }