From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id E6C393858D39 for ; Tue, 14 Mar 2023 13:05:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E6C393858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EDA67219C6; Tue, 14 Mar 2023 13:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678799134; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yxZAzzp77GfbO4/HrSkurbyKxgrbGYvuVSRLgl2o9n4=; b=RwajTGO84fb2TGF5xR87a9cvm7O6gycsexcUi0I5KoFHryJ9l6ZoXqBW/GvhWGBoZuJCSm +zZY06j4zweCV3oBX7jHe9khzHR8J14d6tgaNDSfN29LdNxrkWjiER0jzz9+XPwH6/5K4S IgknM7D/Sgun9PxoeMQCNpbBvyBLzSc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678799134; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yxZAzzp77GfbO4/HrSkurbyKxgrbGYvuVSRLgl2o9n4=; b=i8xa6E8HxyBrObbm2oyvBHqeBzuDwAawUuII9IPypY6ULrLqWn0+0eZXH5Ji+m62pFlc1y JP/GxR3b+pPp+cBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D7D5313A1B; Tue, 14 Mar 2023 13:05:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sNe8Mx5xEGQibAAAMHmgww (envelope-from ); Tue, 14 Mar 2023 13:05:34 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 2/3] [gdb/dap] Allow Content-Length on separate line Date: Tue, 14 Mar 2023 14:05:34 +0100 Message-Id: <20230314130535.6369-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230314130535.6369-1-tdevries@suse.de> References: <20230314130535.6369-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: Currently this DAP input is accepted: ... Content-Length: 54 {"seq": 1, ...}Content-Length: 163 {"seq": 2, ...}Content-Length: 136 ... Also allow: ... Content-Length: 54 {"seq": 1, ...} Content-Length: 163 {"seq": 2, ...} Content-Length: 136 ... which makes command files a bit easier to read. --- gdb/python/lib/gdb/dap/io.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/python/lib/gdb/dap/io.py b/gdb/python/lib/gdb/dap/io.py index 28f4d93ba46..fd9953a7aaa 100644 --- a/gdb/python/lib/gdb/dap/io.py +++ b/gdb/python/lib/gdb/dap/io.py @@ -28,7 +28,10 @@ def read_json(stream): line = stream.readline() line = line.strip() if line == b"": - break + if content_length != None: + break + else: + continue if line.startswith(b"Content-Length:"): line = line[15:].strip() content_length = int(line) -- 2.35.3