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: 73949 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47DB2385772B for ; Thu, 10 Aug 2023 15:37:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47DB2385772B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691681833; bh=iHM26J4ebdoiYZJz3zhEjNseIBWtdhkWcsKebtX2pWo=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=eOv1bDIun3WPEiLWdPQEluCESwBuw2F+6T9L/rBCy+wJN3jLNwRfdXII2LHqzDQyi dTcPWh63seY2BKkXB8nljsdQYeIpY5rmd4sZ3Y0gZd1YKuKtTfNl8ZDBIM/taRHxjB 1laEXC7vz6chkMHQTS2D+1+BNGNa2wSci+yoUdlk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 4360A3858288 for ; Thu, 10 Aug 2023 15:36:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4360A3858288 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31771a876b5so937377f8f.3 for ; Thu, 10 Aug 2023 08:36:47 -0700 (PDT) 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=M3D4BMOy3lY7/hdq6nH6fP5hzomdDg9diuCdvUSNFMzFTmdwtBriRIk5EgnDdqGWH2 VHEsgsFPWz0rwndolWHWEr/Sewf993jEFN/tfPWNfh/r/+u1NYZF1f3IvdKjQgmiFDxM Kexu3jae81iQDKJ8h1Rt1vFXfASwy1aGc/gEzafEUfjS44S4ZgfigFB4tluLQghPlHDz kEMo99UgzGPxtgxenNc7eUG5okzzv4AMn+gDxj/SOoJjgBM9SVkSAvxWR9R4k4NtnMCI z11w5rn5adrhJXTiDWMC8WOf1nQLqmp/9XmmAyPVaaHbjpn2sxYskQH28gOkJ3XB57xt y+8A== X-Gm-Message-State: AOJu0YxtIkqQ5uRUfRWqIPlH4KvV43grXvAXztuTtiD9r+xP+RMETZex 60hTKrFeNn52iwMwbrdE/rDdgg== 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) 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 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Alex_Benn=C3=A9e_via_Gdb-patches?= From: =?utf-8?q?Alex_Benn=C3=A9e?= Reply-To: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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); }