public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb/doc: update syntax of -data-disassemble command arguments
Date: Sun,  2 Oct 2022 13:15:18 +0000 (GMT)	[thread overview]
Message-ID: <20221002131518.38654385841F@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=48883ade64759b72aa876d6255796c8e66429be8

commit 48883ade64759b72aa876d6255796c8e66429be8
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Thu Jun 23 13:57:57 2022 +0100

    gdb/doc: update syntax of -data-disassemble command arguments
    
    The argument documentation for -data-disassemble looks like this:
    
       -data-disassemble
          [ -s @var{start-addr} -e @var{end-addr} ]
        | [ -a @var{addr} ]
        | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
        -- @var{mode}
    
    However, I believe, according to the 'Notation and Terminology'
    section, this means that the there are 3 optional location
    specification argument groups for the command, followed by a
    non-optional '-- mode'.
    
    However, this is not true, one of the location specifications must be
    given, i.e. we can't choose to give NO location specification, which
    is what the above implies.
    
    I propose that we change this to instead be:
    
       -data-disassemble
        ( -s @var{start-addr} -e @var{end-addr}
        | -a @var{addr}
        | -f @var{filename} -l @var{linenum} [ -n @var{lines} ] )
        -- @var{mode}
    
    By placing all the location specifications within '( ... )' we
    indication that these are a group, from which one of the options,
    separated by '|', must be selected.
    
    However, the 'Notation and Terminology' section only describes two
    uses for parenthesis: '( GROUP )*' and '( GROUP )+', in the first case
    GROUP is repeated zero or more times, and in the second GROUP is
    repeated 1 or more times.
    
    Neither of those exactly describe what I want, which is GROUP must
    appear exactly once.  I propose to extend 'Notation and Terminology'
    to include '( GROUP )' which means that GROUP should appear exactly
    once.
    
    This change is important because, in a later commit, I want to add
    additional optional arguments to the -data-disassemble command, and
    things start to get confusing with the original syntax.

Diff:
---
 gdb/doc/gdb.texinfo | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 596e5873558..afe29a9a025 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -29910,6 +29910,10 @@ may repeat zero or more times.
 @code{( @var{group} )+} means that @var{group} inside the parentheses
 may repeat one or more times.
 
+@item
+@code{( @var{group} )} means that @var{group} inside the parentheses
+occurs exactly once.
+
 @item
 @code{"@var{string}"} means a literal @var{string}.
 @end itemize
@@ -34580,9 +34584,9 @@ For details about what an addressable memory unit is,
 
 @smallexample
  -data-disassemble
-    [ -s @var{start-addr} -e @var{end-addr} ]
-  | [ -a @var{addr} ]
-  | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
+  ( -s @var{start-addr} -e @var{end-addr}
+  | -a @var{addr}
+  | -f @var{filename} -l @var{linenum} [ -n @var{lines} ] )
   -- @var{mode}
 @end smallexample

                 reply	other threads:[~2022-10-02 13:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221002131518.38654385841F@sourceware.org \
    --to=aburgess@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /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).