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 87BA73858418 for ; Fri, 6 Jan 2023 14:12:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87BA73858418 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 BE5EC264A5; Fri, 6 Jan 2023 14:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1673014345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RwW+jiW4b8g1IvnZ70zizY0aYirkH9hckKGc1K3aN+M=; b=XvUDYvFcpXVMT59s+6/bP5Jq7T24PL/8wSZVIhtbiskKhNXK6eqfTKC9uQlhPY0rI1hLq6 Wzcbzh/H0ky8ivdk+HF6L7t7N/Q9BkNeGi7OOLYsjVnr2GpmDvkq8vP1tZp2gH7eaCiTaP Q7cqxU1jtY3CpYQOvqC5933qh/x1KtI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1673014345; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RwW+jiW4b8g1IvnZ70zizY0aYirkH9hckKGc1K3aN+M=; b=cLqhIRGNpvhMMA2c0BRFzV4CZRkUAyt7gpLeXf+nOwhdsEQlZm6s/PxpftlCZV/KGNjLNv FzwjAVfB/68AbkBA== 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 A905413596; Fri, 6 Jan 2023 14:12:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0D3tJ0ksuGOqcgAAMHmgww (envelope-from ); Fri, 06 Jan 2023 14:12:25 +0000 Message-ID: Date: Fri, 6 Jan 2023 15:12:25 +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> From: Tom de Vries In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,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: On 1/5/23 17:17, Tom de Vries via Gdb-patches wrote: > 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". I could try to implement this, but I haven't found a way to trigger the exception, so I can't test a potential implementation. Also I wonder if I trigger it, will the exception message show up ( see https://sourceware.org/bugzilla/show_bug.cgi?id=29968 ). Anyway, I'm parking this for now. Thanks, - Tom