From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 99D6F3858C42 for ; Fri, 26 Apr 2024 15:12:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99D6F3858C42 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 99D6F3858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714144334; cv=none; b=tURHxBmwwt3xRYakEqUeLyLFdNepjdlWiHZ23f8d/rLfetl6h02hB845EdDVtZG0cC4v2W9M5RrS2FoZWRSbzyRmOFjoGe1jFNdxI41bQjIUPcER9d+zSXoROeLIoaOlr8Qqk0R4qWXLODPU1buSFLEF3OypxvNO9TObqCUWdOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714144334; c=relaxed/simple; bh=IMOl+0PedJ85MUS91FGbYOMPJ/Uufz1MrF9e3T0JJf4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YIJPvbGuV/BTFk/MKevtMaD5wZFrQcWtz93mO8zif57pJ2VwMJKxcIq5C/XxG0Ol3aZ8K9mZeZENV8kUwF7nOPjD6APX+6CYC9RDGg2kWz5z12TdI/AY4nANhecJF5gOYYbN2KQqHktPuixioZz4AzIqSXrQAM6TCCtPiP2kAQg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714144332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bI0ZrCmPGkDQ/tJddOYyf2or5AndBlR3c4wKS+eN8nQ=; b=NZyGnsYVzIBfDjCSwjbV67ePf91XDFi0o2hvRABii5Gme0timx+3OYXThgwhxbqyn+0nlV tcbHEXEYSSq9MUX4tbMVS6mY+9p0ErzYXi5zd1ZaITfOrfKZpGYz5EpODtadqa5rAOCrl3 O9hnn8gX7NpQldql8mAQdZt1Q06Np3Q= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-X9hkfR0VMUa1HBN0rGFsNg-1; Fri, 26 Apr 2024 11:12:11 -0400 X-MC-Unique: X9hkfR0VMUa1HBN0rGFsNg-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-343ee356227so1431124f8f.2 for ; Fri, 26 Apr 2024 08:12:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714144330; x=1714749130; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bI0ZrCmPGkDQ/tJddOYyf2or5AndBlR3c4wKS+eN8nQ=; b=mn2fR/h68jNN0+GoKaH7izBimpub07uJ2bVubkT44KCvyxNYVK/8BFPhTRiasOpVAA RfOF0htwMXfstPv6fFBry7EYmtIhnzt5S+ux42lYNiWNyr5y1LqoykUMBx+eYe7H7cLf m+1HyxMO5F4H0gqtEU64CDgWKNt7x8uNOyYLjQW/Lcb67ITuWDbaUAE8MDla3f69ahCd XkauY1la39zNO87AfiIyUh6uiiNM5o5ukJGsBARggfTanjjBeBZ5iq985OA3QKuo4Wg7 V0BNbiF732ffXnFxTnqqbDbqb1KrZui3cJt+J5c1BsX9jrw2CslkMdGWHtEPpc12QEJH OVkQ== X-Forwarded-Encrypted: i=1; AJvYcCVueVfL/0Vmlk1E9lPtb+vfDLpPERTVsx/UqOy4tO7atKySDiRwSPx8VytZruJbQzcCPzkxdVdlYyh+8aDiGcQ9kijt/tRug63nJw== X-Gm-Message-State: AOJu0YxHodwz6ZiGjcBID8ItZKY0rMkT8tc7UhYQF/6/C2fnpzn3h03g dZ0mzgThQCtX48SDEvb7H5L6BMOaAUvwR1B34yVLCef6mcbEVKzG1bo39dBolKJAST2yGHtt4H3 PP6lgREcsPQRlIFHex+3XPz2q8p/CEjw+9PJcI6V3ax2owC++PgJNuwfWrUk= X-Received: by 2002:adf:e40e:0:b0:34b:3f16:ba9d with SMTP id g14-20020adfe40e000000b0034b3f16ba9dmr2156425wrm.23.1714144329714; Fri, 26 Apr 2024 08:12:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExliUyPWNIMoxmCrl9kT5PDEaWpvcFO3GZ6IoWUftymiHKjN/qnGwQIOD0/YTb++tE48RCGw== X-Received: by 2002:adf:e40e:0:b0:34b:3f16:ba9d with SMTP id g14-20020adfe40e000000b0034b3f16ba9dmr2156291wrm.23.1714144325969; Fri, 26 Apr 2024 08:12:05 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id h16-20020adffd50000000b00346d3a626b8sm22848913wrs.3.2024.04.26.08.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 08:12:05 -0700 (PDT) From: Andrew Burgess To: Tom Tromey Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/remote: fix qRcmd error handling In-Reply-To: <87zfticueh.fsf@tromey.com> References: <8734rdsb51.fsf@tromey.com> <87v847u9q9.fsf@redhat.com> <87zfticueh.fsf@tromey.com> Date: Fri, 26 Apr 2024 16:12:04 +0100 Message-ID: <87cyqctayj.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Tom Tromey writes: >>> The patch itself seems reasonable to me, but at the same time, isn't the >>> behavior you describe also fine? >>> >>> The docs describe "OK", other "O" output packets, the "E" response, and >>> the empty response. It seems to me that any other response could >>> reasonably be treated as an error. > > Andrew> The behaviour I'm restoring is documented, see the 'OUTPUT' entry in the > Andrew> 'Reply:' list: > > Andrew> 'OUTPUT' > Andrew> A command response with the hex encoded output string OUTPUT. > > I thought your patch was concerned with changing the output of responses > other than 'E' or 'O'... did I misunderstand that? I don't think so. I guess I didn't explain myself very well. After GDB sends a qRcmd packet to the remote, the remote can reply with zero or more 'O' packets. This patch is not about these replies; they are still working fine. The remote can also reply with an 'E' packet. This patch is not about these error reply packets; they are still working fine. The remote can also reply with an empty packet indicating the qRcmd is not supported. This patch is not about this type of reply; this is still working fine. The remote can also reply with a packet containing the string "OK", this is different from a general 'O' packet, this indicates that the remote is done handling the qRcmd and so GDB is done too. This patch is not about this reply; this is still working fine. The remote can also reply with a random hex encoded string, of the kind that would appear after the 'O' in an 'O' packet, but without the adding the leading 'O' character. When GDB gets one of these packets GDB decodes the string and prints it, after which the qRcmd is done. This patch is about this behaviour only. This feature was broken in commit 3623271997a5c0d, after this the hex encoded string would be treated as an error. In fact, what happens is that GDB calls packet_result::err_msg() which will then throw an assertion error because the packet status is PACKET_OK, not PACKET_ERROR. Thanks, Andrew