public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Gustavo Romero <gustavo.romero@linaro.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, luis.machado@arm.com,
	thiago.bauermann@linaro.org, tom@tromey.com
Subject: Re: [PATCH v4 8/8] gdb: Document qIsAddressTagged packet
Date: Tue, 16 Apr 2024 20:10:43 -0300	[thread overview]
Message-ID: <e0790dea-3323-c426-ac2c-5a0b459bb188@linaro.org> (raw)
In-Reply-To: <86y19didft.fsf@gnu.org>

Hi Eli,

Thanks a lot for the review. I just have one question.

On 4/16/24 11:34 AM, Eli Zaretskii wrote:
>> From: Gustavo Romero <gustavo.romero@linaro.org>
>> Cc: luis.machado@arm.com,
>> 	thiago.bauermann@linaro.org,
>> 	eliz@gnu.org,
>> 	tom@tromey.com,
>> 	gustavo.romero@linaro.org
>> Date: Tue, 16 Apr 2024 14:07:28 +0000
>>
>> This commit documents the qIsAddressTagged packet.
> 
> Thanks.
> 
>> diff --git a/gdb/NEWS b/gdb/NEWS
>> index feb3a37393a..1693a7a15f8 100644
>> --- a/gdb/NEWS
>> +++ b/gdb/NEWS
>> @@ -192,6 +192,16 @@ QThreadOptions in qSupported
>>     QThreadOptions packet, and the qSupported response can contain the
>>     set of thread options the remote stub supports.
>>   
>> +qIsAddressTagged
>> +  This new packet allows GDB to query the stub about a given address to check
>> +  if it is tagged or not.  Many memory tagging-related GDB commands need to
>> +  perform this check before they read/write the allocation tag related to an
>> +  address.  Currently, however, this is done through a 'vFile' request to read
>> +  the file /proc/<PID>/smaps and check if the address is in a region reported
>> +  as memory tagged.  Since not all targets have a notion of what the smaps
>> +  file is about, this new packet provides a more generic way to perform such
>> +  a check.
>> +
>>   *** Changes in GDB 14
> 
> This part is okay.
> 
>> +@item qIsAddressTagged:@var{address}
>> +@cindex check if a given address is in a memory tagged region.
>                                                                  ^
> Index entries should not end in a period.
> 
>> +Check if address @var{address} is in a memory tagged region; if it is, it's
>> +said to be tagged.  The target is responsible for checking it, as this is
> 
> I suggest to use @dfn{tagged}, since this is new terminology.  It will
> then look nicer in print (and will be quoted in Info).
> 
>> +@item @var{01}
>> +Address @var{address} is tagged.
>> +
>> +@item @var{00}
>> +Address @var{address} is not tagged.
> 
> I think 01 and 00 should not be in @var here, since they are literal
> strings.  The @samp markup of the @table will do here.
> 
>> +@item E @var{nn}
>> +An error occurred.  This means that address could not be checked for some
>> +reason.
> 
> Here "nn" is the error value, right?  If so, I suggest to say
> 
>    @item E @var{nn}
>    An error occurred whose code is @var{nn}.

Do you mean remove the "This means that address could not be checked for some reason."
text completely or just s/An error occurred/An error occurred whose code is @var{nn}/?

I'd like to keep the text because the error codes actually don't tell much about
the reason of the error -- usually -- in this context, so I'd like to inform users
that in any case the address could not be checked if an error (any error) occurs.
For example, in the gdbserver we can find comments like:

gdbserver/remote-utils.cc-1020-void
gdbserver/remote-utils.cc-1021-write_enn (char *buf)
gdbserver/remote-utils.cc-1022-{
gdbserver/remote-utils.cc:1023:  /* Some day, we should define the meanings of the error codes... */
gdbserver/remote-utils.cc-1024-  buf[0] = 'E';
gdbserver/remote-utils.cc-1025-  buf[1] = '0';
gdbserver/remote-utils.cc-1026-  buf[2] = '1';
gdbserver/remote-utils.cc-1027-  buf[3] = '\0';
gdbserver/remote-utils.cc-1028-}


Cheers,
Gustavo

  reply	other threads:[~2024-04-16 23:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 14:07 [PATCH v4 0/8] Add another way to check tagged addresses on remote targets Gustavo Romero
2024-04-16 14:07 ` [PATCH v4 1/8] gdb: aarch64: Remove MTE address checking from get_memtag Gustavo Romero
2024-04-16 14:07 ` [PATCH v4 2/8] gdb: aarch64: Move MTE address check out of set_memtag Gustavo Romero
2024-04-16 16:30   ` Luis Machado
2024-04-16 14:07 ` [PATCH v4 3/8] gdb: aarch64: Remove MTE address checking from memtag_matches_p Gustavo Romero
2024-04-16 14:07 ` [PATCH v4 4/8] gdb: Use passed gdbarch instead of calling current_inferior Gustavo Romero
2024-04-16 14:07 ` [PATCH v4 5/8] gdb: Introduce is_address_tagged target hook Gustavo Romero
2024-04-17  9:22   ` Luis Machado
2024-04-16 14:07 ` [PATCH v4 6/8] gdb: Add qIsAddressTagged packet Gustavo Romero
2024-04-16 18:04   ` Luis Machado
2024-04-17 20:57     ` Gustavo Romero
2024-04-16 14:07 ` [PATCH v4 7/8] gdb/testsuite: Add unittest for " Gustavo Romero
2024-04-17  9:38   ` Luis Machado
2024-04-17 19:03     ` Gustavo Romero
2024-04-17 19:11       ` Gustavo Romero
2024-04-16 14:07 ` [PATCH v4 8/8] gdb: Document " Gustavo Romero
2024-04-16 14:34   ` Eli Zaretskii
2024-04-16 23:10     ` Gustavo Romero [this message]
2024-04-17 12:09       ` Eli Zaretskii
2024-04-17 18:21         ` Gustavo Romero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0790dea-3323-c426-ac2c-5a0b459bb188@linaro.org \
    --to=gustavo.romero@linaro.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@arm.com \
    --cc=thiago.bauermann@linaro.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).