public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Cc: gdb-patches@sourceware.org, aburgess@redhat.com, tom@tromey.com
Subject: Re: [PATCH v3 3/3] gdb: add the 'set/show suppress-notification-cli' command
Date: Thu, 03 Feb 2022 11:35:19 +0200	[thread overview]
Message-ID: <83v8xw47jc.fsf@gnu.org> (raw)
In-Reply-To: <d2f878605bf9ea5ac6bb2cc224cd523316575aba.1643876373.git.tankut.baris.aktemur@intel.com> (message from Tankut Baris Aktemur on Thu, 3 Feb 2022 09:30:41 +0100)

> From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
> Cc: aburgess@redhat.com,
> 	tom@tromey.com,
> 	eliz@gnu.org
> Date: Thu,  3 Feb 2022 09:30:41 +0100
> 
> +set suppress-notification-cli (on|off)
> +show suppress-notification-cli
> +  This controls whether printing the notification events is suppressed
> +  for CLI.

I think suppress-cli-notifications is a better name for this setting.

Also, I think NEWS should explain a bit what is mean by
"notifications" here.  The "events" part should be removed, since you
don't really "print events", right?

> +@noindent
> +@emph{User-selected context changes:} When you change the selected
> +context (i.e.@:  the current inferior, thread and/or the frame),
> +@value{GDBN} prints information about the new context.  For example,
> +the default behavior is below:
> +
> +@smallexample
> +(gdb) inferior 1
> +[Switching to inferior 1 [process 634] (/tmp/test)]
> +[Switching to thread 1 (process 634)]
> +#0  main () at test.c:3
> +3         return 0;
> +(gdb)
> +@end smallexample
> +
> +@noindent
> +When the events are suppressed, the new context is not printed:
> +
> +@smallexample
> +(gdb) set suppress-notification-cli on
> +(gdb) inferior 1
> +(gdb)
> +@end smallexample
> +
> +@noindent
> +@emph{The program being debugged stops:} When the program you are
> +debugging stops (e.g.@: because of hitting a breakpoint, completing
> +source-stepping, an interrupt, etc.), @value{GDBN} prints information
> +about the stop event.  For example, below is a breakpoint hit event:

This would be better formatted as a @table, I think.

> +@noindent
> +Suppressing CLI notification events may be useful in scripts to obtain
> +a reduced output from a list of commands.  For instance, suppose that
> +you want to add and set up a new inferior using the following
> +commands:
> +
> +@smallexample
> +define do-setup
> +  printf "Setting up Inferior 2...\n"
> +  add-inferior -exec a.out
> +  inferior 2
> +  break file.c:3
> +  run
> +  inferior 1
> +  printf "Done\n"
> +end
> +@end smallexample
> +
> +@noindent
> +When the CLI notification events are not suppressed, the output is as
> +follows:
> +
> +@smallexample
> +(gdb) do-setup
> +Setting up Inferior 2...
> +[New inferior 2]
> +Added inferior 2 on connection 1 (native)
> +[Switching to inferior 2 [<null>] (/tmp/a.out)]
> +Breakpoint 2 at 0x1155: file file.c, line 3.
> +
> +Thread 2.1 "a.out" hit Breakpoint 2, main () at file.c:3
> +3         return 0;
> +[Switching to inferior 1 [process 5714] (/tmp/test)]
> +[Switching to thread 1.1 (process 5714)]
> +#0  main () at test.c:2
> +2         int a = 1;
> +Done
> +@end smallexample
> +
> +@noindent
> +When suppressed, the output becomes
> +
> +@smallexample
> +(gdb) set suppress-notification-cli on
> +(gdb) do-setup
> +Setting up Inferior 2...
> +[New inferior 2]
> +Added inferior 2 on connection 1 (native)
> +Breakpoint 2 at 0x1155: file file.c, line 3.
> +Done
> +@end smallexample
> +
> +@kindex show suppress-notification-cli
> +@item show suppress-notification-cli
> +Displays whether printing CLI notification events is suppressed or
> +not.
> +@end table

The example part here is too long, and doesn't really say anything
new.  So I would delete it, leaving just the note explaining when and
why this would be useful.

Thanks, the documentation parts are OK with these nits fixed.

      reply	other threads:[~2022-02-03  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  8:30 [PATCH v3 0/3] Suppressing CLI notifications Tankut Baris Aktemur
2022-02-03  8:30 ` [PATCH v3 3/3] gdb: add the 'set/show suppress-notification-cli' command Tankut Baris Aktemur
2022-02-03  9:35   ` Eli Zaretskii [this message]

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=83v8xw47jc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tankut.baris.aktemur@intel.com \
    --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).