From patchwork Thu Mar 14 13:07:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aktemur, Tankut Baris" X-Patchwork-Id: 87186 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 003423857718 for ; Thu, 14 Mar 2024 13:09:06 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by sourceware.org (Postfix) with ESMTPS id AAD993857815 for ; Thu, 14 Mar 2024 13:08:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AAD993857815 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AAD993857815 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710421691; cv=none; b=lVcUj+VJdGzIMTX1swZuaivODiQ5aOqzGCePCvciHm/jtkY1IK46uIPXCS5EEYxRrI14tOEDdRr4Q2zsWY9cwXLAMhoEBibY654emguvlJpcZeTnZFG4z5vMNvjMb9+ZeBZpLks2ufMJkchvvB/NbWWCPgJiwagbnuyWGHLet2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710421691; c=relaxed/simple; bh=NXvWzjSdLv7DB0aATc/jXWSt2zMjuWAYjmw/W8ZCMZ0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=xfWiVu+c/R9Zn7Et0AAudT5om3sQqo1mBalZ1s4eaT5WeBwi5Xj9vYycvHoJ7SwIkK7mXbgeAo6yCn40gliLkiCrkXWP4myJIgmj8QDQuRyMEmqTCba6YJpOu3ksoQC8RI2MvKUBNeH0OfsPP3WFRjkvC7CVWlH3RKkmK8C2qRo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710421690; x=1741957690; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NXvWzjSdLv7DB0aATc/jXWSt2zMjuWAYjmw/W8ZCMZ0=; b=C5zQ18WsLStEPANSIPdYVGHvCKWicjaS8+l8j7Qce6320z5VpLc9gyXX UwVo319s/dJrboq0zNwfNetHbdpIdyjv+gWDZJTCFVuOupTnqCjLDGYlt rO4d53Yz/bQ3Ctx8dSvhznVkacUq12H1uXqn9e2eIv2dpas3J29AIKRnG 53HO1gDgIHDDjlgoyYXWSmfcofSlnYjvUxSjQJdHrurTBlmldaFhSDWaO CpcYuCZAraSNRHF60QLB7Ny2hcQozcPQjRxSyae/AofMyNxUpUS1ESaZk eC1TorGxHARNWmBBr/WwRf4LMlK77TcPWJqsam0NdHAhZFITd0UfSRjnN A==; X-IronPort-AV: E=McAfee;i="6600,9927,11012"; a="5090751" X-IronPort-AV: E=Sophos;i="6.07,125,1708416000"; d="scan'208";a="5090751" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 06:08:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,125,1708416000"; d="scan'208";a="12169742" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2024 06:08:07 -0700 From: Tankut Baris Aktemur To: gdb-patches@sourceware.org Cc: tom@tromey.com Subject: [PATCH v2 3/4] rsp: add 'E' to escaped characters Date: Thu, 14 Mar 2024 14:07:30 +0100 Message-Id: <2df4539dd59feb3b70f15ed679563a85bb286075.1710420898.git.tankut.baris.aktemur@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Add 'E' to the list of escaped characters when sending/receiving binary data. This is a preparation for the next patch, to be able to distinguish an error response from binary data that starts with 'E'. Approved-By: Tom Tromey Reviewed-By: Eli Zaretskii --- gdb/doc/gdb.texinfo | 4 +++- gdbsupport/rsp-low.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index f2b80db94ef..9a7d61be65e 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -42389,7 +42389,9 @@ bytes @code{0x7d 0x5d}. The bytes @code{0x23} (@sc{ascii} @samp{#}), @samp{@}}) must always be escaped. Responses sent by the stub must also escape @code{0x2a} (@sc{ascii} @samp{*}), so that it is not interpreted as the start of a run-length encoded sequence -(described next). +(described next). The @code{0x45} (@sc{ascii} @samp{E}) byte should +also be escaped to distinguish it from an error reply that starts with +the @samp{E} character. Response @var{data} can be run-length encoded to save space. Run-length encoding replaces runs of identical characters with one diff --git a/gdbsupport/rsp-low.cc b/gdbsupport/rsp-low.cc index 37dce9d5c74..0a11adc78e5 100644 --- a/gdbsupport/rsp-low.cc +++ b/gdbsupport/rsp-low.cc @@ -171,7 +171,7 @@ bin2hex (const gdb_byte *bin, int count) static int needs_escaping (gdb_byte b) { - return b == '$' || b == '#' || b == '}' || b == '*'; + return b == '$' || b == '#' || b == '}' || b == '*' || b == 'E'; } /* See rsp-low.h. */