From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id CC8053858C5E for ; Tue, 14 Mar 2023 13:05:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC8053858C5E 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-out2.suse.de (Postfix) with ESMTPS id D35381F894; 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=LRLs07T2HJ5c3a6LaZLb6o2UPBl8ODDNgGVONwC1HXc=; b=h8y6nfp/m6mrSsXM8Uk2YPIV30UfEcAd5qbEYEqSLzrzYZ8vpZjDuKouMpsebnVZjiWTBB U4CabSq8JSn2oaEV+95eNH9G8cHsUNPNjLgT2ID39aCNgMx0iDucaRukLBNGKpM0tHfGg7 arr354PEc+MMKTagfzYCFYV78rBFFH4= 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=LRLs07T2HJ5c3a6LaZLb6o2UPBl8ODDNgGVONwC1HXc=; b=Uvlz+L2sZbDWjkYNWTrJ0DHs8EjA7xgW7CngyhzIah0muflF+LOtsHIrJYWS0FF5KxMD8c 5ZhxrB82i8qu8SAA== 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 BDEA113A79; 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 GJdkLR5xEGQibAAAMHmgww (envelope-from ); Tue, 14 Mar 2023 13:05:34 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC 1/3] [gdb/dap] Add logging of ignored lines Date: Tue, 14 Mar 2023 14:05:33 +0100 Message-Id: <20230314130535.6369-2-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,KAM_SHORT,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: This input sequence is accepted by DAP: ... {"seq": 4, "type": "request", "command": "configurationDone"}Content-Length: 84 ... This input sequence has the same effect: ... {"seq": 4, "type": "request", "command": "configurationDone"}ignorethis Content-Length: 84 ... but the 'ignorethis' part is silently ignored. Log the ignored bit, such that we have: ... READ: <<<{"seq": 4, "type": "request", "command": "configurationDone"}>>> WROTE: <<<{"request_seq": 4, "type": "response", "command": "configurationDone" , "success": true}>>> +++ run IGNORED: <<>> ... --- 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 74cc82301d7..28f4d93ba46 100644 --- a/gdb/python/lib/gdb/dap/io.py +++ b/gdb/python/lib/gdb/dap/io.py @@ -14,8 +14,9 @@ # along with this program. If not, see . import json +import sys -from .startup import start_thread, send_gdb +from .startup import start_thread, send_gdb, log def read_json(stream): @@ -31,6 +32,8 @@ def read_json(stream): if line.startswith(b"Content-Length:"): line = line[15:].strip() content_length = int(line) + continue + log("IGNORED: <<<%s>>>" % line) data = bytes() while len(data) < content_length: new_data = stream.read(content_length - len(data)) -- 2.35.3