From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id 57EBB3858C42 for ; Fri, 26 Apr 2024 19:02:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57EBB3858C42 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 57EBB3858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714158152; cv=none; b=Xnls5ZiynDwVg358S1nFwE0MslVy817mceMHmpbPjTsSwqbRSOKlWmfaS2ePXt6Hw8NLwL680ONg0fUIj9Dj7856soTVv7keA/VNjxvzkDHd3ehjyJpSZTTlCLULQ/gL+HIGO3CrP3VFmUcyb7smQiwZA5w7oo04aZDU7c3vUxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714158152; c=relaxed/simple; bh=HM9mSn/PVH9Lq/AXD1W2I/qdiscY+tAsE8vLikjqN+k=; h=Message-ID:Date:MIME-Version:Subject:From:To; b=i2X9fMCC04vv8y2gExt0JBtyNRpYv37zuzQ/y8PNfQmnUqrZflIXn9KStYcy+JM/0XyVaJoIRkp/6v/9Lj4r597TejB1EcvZPRTgxO/Mj9W4+rZEqvrSMbO7lm2JBZNE7vCfi1HLk0TTWTcK96A33A8bmzePHL1m3yyPdTf9UPs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-34a32ba1962so1977440f8f.2 for ; Fri, 26 Apr 2024 12:02:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714158148; x=1714762948; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fJAaNVcNkSkzx4D190JAfidfhM28roM6TtNkdejilA4=; b=dEZnrtznRSwB05PmtErLiLNLwpSZZcESo2I91zVijoL8QH8LPpjiSMXV0D8CicL4sj BR/OYb6Eikv8RGbPYZRgnMjU5BhpN25paBOh76wWHVJEhGwTm2ltjm7PoqaieXS63XuL Wm9KTEBAnGY3vtbA2SzsAxzdk3PZwBBv6TkeWTe2d8YG/L8yxHuxT21wRyh44kjnG0wl tI0+SXyV0ln35xfs0NAoMmtFy6tH81Tw4ivKwR8WVzQCJIK1AqV6rfde+5QRkc3jBgOU +plQEyMqzxXaKB/lbVDviSFT6S5hAgBmoHQhSF9xcR7GDli3QJUExcQSV2hSaYx840Cx 9FYw== X-Forwarded-Encrypted: i=1; AJvYcCUqmEB/vluT/X7yZpm9KKn8rJaKgWzGipPS8p7vq1jsw7/IAWlLZiy26Ta6PpAm4JhXJleD+Nw28etYnQMgfROJSuKWySyGxuxw/Q== X-Gm-Message-State: AOJu0YxBuGSzdmLu3qZ1Eq1J5avnSfOPLEPk0AUoT5ZuhPpKxJMyhoR+ uLppN7CYny/HqB1rzl7AhGbycr6qqZ0JBqYu+D21DvMSlz22Zp3V X-Google-Smtp-Source: AGHT+IEL2myjXGu3qnVhMwhViwmp5QpXpG2xztKK+AdsKwkuYHsVvpcLCdf1RO3QNmalSNJ6GjawhA== X-Received: by 2002:a05:6000:8c:b0:33e:7f5c:a75d with SMTP id m12-20020a056000008c00b0033e7f5ca75dmr2384676wrx.57.1714158147880; Fri, 26 Apr 2024 12:02:27 -0700 (PDT) Received: from ?IPV6:2001:8a0:f93d:b900:5818:add9:fe9:bdac? ([2001:8a0:f93d:b900:5818:add9:fe9:bdac]) by smtp.gmail.com with ESMTPSA id z18-20020a5d6412000000b00347ec0469b2sm22917023wru.46.2024.04.26.12.02.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Apr 2024 12:02:27 -0700 (PDT) Message-ID: <91568db8-32c2-42e0-b34f-8acb3f93cee1@palves.net> Date: Fri, 26 Apr 2024 20:02:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/12] Document "E.MESSAGE" RSP errors From: Pedro Alves To: Andrew Burgess , gdb-patches@sourceware.org, Eli Zaretskii References: <20240419151342.1592474-1-pedro@palves.net> <20240419151342.1592474-4-pedro@palves.net> <878r15hjbz.fsf@redhat.com> <3b156aac-556b-47eb-a1c7-f20071aa9a8f@palves.net> Content-Language: en-US In-Reply-To: <3b156aac-556b-47eb-a1c7-f20071aa9a8f@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_LOTSOFHASH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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: [Adding Eli.] AFAICT, this is the only patch left in the series that needs an OK. Any comments on the updated documentation change below? Pedro Alves On 2024-04-22 20:04, Pedro Alves wrote: > On 2024-04-22 09:50, Andrew Burgess wrote: > >>> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >>> index 57260a5b2fa..d6184d52841 100644 >>> --- a/gdb/doc/gdb.texinfo >>> +++ b/gdb/doc/gdb.texinfo >>> @@ -42557,6 +42557,10 @@ number. In almost all cases, the protocol does not specify the >>> meaning of the error numbers; @value{GDBN} usually ignores the >>> numbers, or displays them to the user without further interpretation. >>> >>> +@item @samp{E.@var{message}} >>> +An error has occurred; @var{message} is the textual error message, >>> +encoded in @sc{ascii}. >> >> I think we should document here that the 'qRcmd' and 'm' packets don't >> accept this reply format. >> >> Alexandra Hájková has a patch series which has not been posted yet which >> will extend these packets in a backward compatible way so that E.message >> can be used, but until that arrives we should probably document this >> limitation. > > Done, see updated patch below. (See the bottom of the new commit log.) > > Not sure when we'd want to make GDB print the error for the 'm' packet, > though. Currently it just returns TARGET_XFER_E_IO up to the caller. > > I noticed a few packets were documenting an "E.errtext" response, > which I now removed in this version. Then "E.errtext" seemed more > descriptive than "E.message", so I switched to that too. > > > From 36ef5ca67f515039bfa68d2fb2515f181629a24f Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Thu, 18 Apr 2024 20:22:36 +0100 > Subject: [PATCH] Document "E.MESSAGE" RSP errors > > For many years, GDB has accepted a "E.MESSAGE" error response, in > addition to "E NN". For many packets, GDB strips the "E." before > giving the error message to the user. For others, GDB does not strip > the "E.", but still understands that it is an error, as it starts with > "E", and either prints the whole string, or ignores it and just > mentions an error occured (same as for "E NN"). > > This has been the case for as long as I remember. Now that I check, I > see that it's been there since 2006 (commit a76d924dffcb, also here: > https://sourceware.org/pipermail/gdb-patches/2006-September/047286.html). > All along, I actually thought it was documented. Turns out it wasn't. > > This commit documents it, in the new "Standard Replies" section, near > where we document "E NN". > > The original version of this 3-patch documentation series was a single > CodeSourcery patch that documented the textual error as > "E.NAME.MESSAGE", with MESSAGE being 8-bit binary encoded. But I > think the ship has sailed for that. GDBserver has been sending error > messages with more than one "." for a long while, and with no binary > encoding. Still, I've preserved the "Co-Authored-By" list of the > original larger patch. > > The 'qRcmd' and 'm' commands are exceptions and do not accept this > reply format. The top of the "Standard Replies" section already says: > > "All commands support these, except as noted in the individual > command descriptions." > > So this adds a note to the description of 'qRcmd' and 'm', explicitly > stating that they do not support this error reply format. > > Change-Id: Ie4fee3d00d82ede39e439bf162e8cb7485532fd8 > Co-Authored-By: Jim Blandy > Co-Authored-By: Mike Wrighton > Co-Authored-By: Nathan Sidwell > Co-Authored-By: Hafiz Abid Qadeer > --- > gdb/doc/gdb.texinfo | 23 +++++++++++++---------- > 1 file changed, 13 insertions(+), 10 deletions(-) > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 9781ce76226..f55ada29e9c 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -42559,6 +42559,11 @@ number. In almost all cases, the protocol does not specify the > meaning of the error numbers; @value{GDBN} usually ignores the > numbers, or displays them to the user without further interpretation. > > +@anchor{textual error reply} > +@item @samp{E.@var{errtext}} > +An error has occurred; @var{errtext} is the textual error message, > +encoded in @sc{ascii}. > + > @end table > > @node Packets > @@ -42885,6 +42890,10 @@ The reply may contain fewer addressable memory units than requested if the > server was able to read only part of the region of memory. > @end table > > +Unlike most packets, this packet does not support > +@samp{E.@var{errtext}}-style textual error replies (@pxref{textual > +error reply}). > + > @item M @var{addr},@var{length}:@var{XX@dots{}} > @cindex @samp{M} packet > Write @var{length} addressable memory units starting at address @var{addr} > @@ -44399,6 +44408,10 @@ A command response with no output. > A command response with the hex encoded output string @var{OUTPUT}. > @end table > > +Unlike most packets, this packet does not support > +@samp{E.@var{errtext}}-style textual error replies (@pxref{textual > +error reply}). > + > (Note that the @code{qRcmd} packet's name is separated from the > command by a @samp{,}, not a @samp{:}, contrary to the naming > conventions above. Please don't use this packet as a model for new > @@ -45455,8 +45468,6 @@ Reply: > @table @samp > @item OK > Branch tracing has been enabled. > -@item E.errtext > -A badly formed request or an error was encountered. > @end table > > @item Qbtrace:pt > @@ -45466,8 +45477,6 @@ Reply: > @table @samp > @item OK > Branch tracing has been enabled. > -@item E.errtext > -A badly formed request or an error was encountered. > @end table > > @item Qbtrace:off > @@ -45477,8 +45486,6 @@ Reply: > @table @samp > @item OK > Branch tracing has been disabled. > -@item E.errtext > -A badly formed request or an error was encountered. > @end table > > @item Qbtrace-conf:bts:size=@var{value} > @@ -45489,8 +45496,6 @@ Reply: > @table @samp > @item OK > The ring buffer size has been set. > -@item E.errtext > -A badly formed request or an error was encountered. > @end table > > @item Qbtrace-conf:pt:size=@var{value} > @@ -45501,8 +45506,6 @@ Reply: > @table @samp > @item OK > The ring buffer size has been set. > -@item E.errtext > -A badly formed request or an error was encountered. > @end table > > @end table > > base-commit: 0e6747d2a638693ad2f20e7929c8364913c87279 > prerequisite-patch-id: 69a7241ff790954e07942cd212971bcfaa8f3a08 > prerequisite-patch-id: b398b6e111b68e06adccda7d9e016ebe39b5fd35