From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id te5LJjv4tmMPChAAWB0awg (envelope-from ) for ; Thu, 05 Jan 2023 11:18:03 -0500 Received: by simark.ca (Postfix, from userid 112) id 903AF1E222; Thu, 5 Jan 2023 11:18:03 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=L9zhKy8R; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D521A1E0D3 for ; Thu, 5 Jan 2023 11:17:59 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EA8D43858C54 for ; Thu, 5 Jan 2023 16:17:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA8D43858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672935479; bh=db5NhE7q/1P1Hc4pDFF3I0LrOPqvekknmzkOzCbrlME=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=L9zhKy8Rl4iQ3YTf3+bWuc4d3yP+Tu9E3YLwpEGyoHlgXlmcMhCaTW0wZmYHwwnCa W7HqegIIaB3coPs8qWQStkyp/mXKhB2n0s+aj+zV26DJeM7V/dFe8o1lNg7khh/lJP f2MdxKo96Ek323n6bkASIF3G4PlaxujmjhGwZXE0= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 6E6533858D35 for ; Thu, 5 Jan 2023 16:17:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E6533858D35 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 AEA633FF4C; Thu, 5 Jan 2023 16:17:32 +0000 (UTC) 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 996F913338; Thu, 5 Jan 2023 16:17:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aI1EJBz4tmNkQgAAMHmgww (envelope-from ); Thu, 05 Jan 2023 16:17:32 +0000 Message-ID: Date: Thu, 5 Jan 2023 17:17:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] Initial implementation of Debugger Adapter Protocol Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20220901163059.3678708-1-tromey@adacore.com> <16a7949d-4a65-28a4-732e-44e6b99f9478@suse.de> <87fscpf1hu.fsf@tromey.com> In-Reply-To: <87fscpf1hu.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-0.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 1/5/23 16:24, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> In case you haven't seen it, on IRC someone mentioned: > > I didn't. > > Tom> diff --git a/gdb/python/lib/gdb/dap/io.py b/gdb/python/lib/gdb/dap/io.py > Tom> index 656ac08b4ec..1d561f07665 100644 > Tom> --- a/gdb/python/lib/gdb/dap/io.py > Tom> +++ b/gdb/python/lib/gdb/dap/io.py > Tom> @@ -22,7 +22,7 @@ def read_json(stream): > Tom> """Read a JSON-RPC message from STREAM. > Tom> The decoded object is returned.""" > Tom> # First read and parse the header. > Tom> - content_length = None > Tom> + content_length = 0 > Tom> while True: > Tom> line = stream.readline() > Tom> line = line.strip() > > In this case, though, the protocol request is malformed and I think it's > fine for gdb to just give up. > I see. > TBH I am not sure what should officially happen for a malformed request. > I don't think the docs I read address this. Agreed, I also couldn't find that info. I suppose we can try to use a more intuitive message for the exception, say "malformed DAP request". Thanks, - Tom