public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 18/19] Minor comment updates in utils.h
Date: Thu, 24 Mar 2022 18:05:45 +0000	[thread overview]
Message-ID: <82655a78-dbee-1ee6-a2aa-0d620ea21aeb@palves.net> (raw)
In-Reply-To: <20220122013801.666659-19-tom@tromey.com>

Just some nits.

On 2022-01-22 01:38, Tom Tromey wrote:

>  /* Truly global ui_file streams.  These are all defined in main.c.  */
>  
> -/* Target output that should bypass normal stdout/stderr filtering.
> -   For moment, always call this stream using *_unfiltered.  In the
> -   very near future that restriction shall be removed - either call
> -   shall be unfiltered.  (cagney 1999-07-02).  */
> +/* Target output that should bypass the pager, if one is in use.  */
>  extern struct ui_file *gdb_stdtarg;
>  extern struct ui_file *gdb_stdtargerr;
>  extern struct ui_file *gdb_stdtargin;
> @@ -224,12 +217,6 @@ extern struct ui_file *gdb_stdtargin;
>  
>  extern void set_screen_width_and_height (int width, int height);
>  
> -/* More generic printf like operations.  Filtered versions may return
> -   non-locally on error.  As an extension over plain printf, these
> -   support some GDB-specific format specifiers.  Particularly useful
> -   here are the styling formatters: '%p[', '%p]' and '%ps'.  See
> -   ui_out::message for details.  */
> -

This comment might have been originally put here and not close to gdb_printf
(old printf_filtered) because it was alluding to the whole family of
stdio.h functions, puts, putc, etc.

Maybe leave such a comment here, like:

/* Generic stdio-like operations.  */


>  extern void gdb_puts (const char *, struct ui_file *);
>  
>  extern int gdb_putc (int c, struct ui_file *);
> @@ -245,6 +232,11 @@ extern void gdb_vprintf (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
>  extern void gdb_vprintf (struct ui_file *, const char *, va_list)
>    ATTRIBUTE_PRINTF (2, 0);

Since GDB-specific format specifiers apply to gdb_vprintf as well at least,
then it seems to me from the diff context that the comment should be above it,
not below.

You may want to hyphenate "printf like" as printf-like instead to make it a bit clearer.
Maybe remove the "More" as well, I'm not sure why it is there, is there some
preceding comment talking about generic printf like operations, such that here we'd
have more of the same?

>  
> +/* More generic printf like operations.  As an extension over plain
> +   printf, these support some GDB-specific format specifiers.
> +   Particularly useful here are the styling formatters: '%p[', '%p]'
> +   and '%ps'.  See ui_out::message for details.  */
> +
>  extern void gdb_printf (struct ui_file *, const char *, ...)
>    ATTRIBUTE_PRINTF (2, 3);
>  


  reply	other threads:[~2022-03-24 18:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  1:37 [PATCH 00/19] Simplify GDB output functions Tom Tromey
2022-01-22  1:37 ` [PATCH 01/19] Use unfiltered output in annotate.c Tom Tromey
2022-01-22  1:37 ` [PATCH 02/19] Remove some uses of printf_unfiltered Tom Tromey
2022-01-22  1:37 ` [PATCH 03/19] Only have one API for unfiltered output Tom Tromey
2022-01-22  1:37 ` [PATCH 04/19] Add puts_unfiltered method to ui_file Tom Tromey
2022-01-22  1:37 ` [PATCH 05/19] Add style-escape methods " Tom Tromey
2022-01-22  1:37 ` [PATCH 06/19] Remove vfprintf_styled_no_gdbfmt Tom Tromey
2022-01-22  1:37 ` [PATCH 07/19] Change the pager to a ui_file Tom Tromey
2022-01-22  1:37 ` [PATCH 08/19] Remove fputs_styled_unfiltered Tom Tromey
2022-01-22  1:37 ` [PATCH 09/19] Unify vprintf functions Tom Tromey
2022-01-22  1:37 ` [PATCH 10/19] Unify gdb puts functions Tom Tromey
2022-01-22  1:37 ` [PATCH 11/19] Unify gdb putc functions Tom Tromey
2022-01-22  1:37 ` [PATCH 13/19] Rename print_spaces_filtered Tom Tromey
2022-01-22  1:37 ` [PATCH 14/19] Rename puts_filtered_tabular Tom Tromey
2022-01-22  1:37 ` [PATCH 15/19] Rename fprintf_symbol_filtered Tom Tromey
2022-01-22  1:37 ` [PATCH 16/19] Remove ui_out_flag::unfiltered_output Tom Tromey
2022-01-22  1:37 ` [PATCH 17/19] Remove vfprintf_styled Tom Tromey
2022-01-22  1:38 ` [PATCH 18/19] Minor comment updates in utils.h Tom Tromey
2022-03-24 18:05   ` Pedro Alves [this message]
2022-03-28 20:29     ` Tom Tromey
2022-01-22  1:38 ` [PATCH 19/19] Remove unnecessary calls to wrap_here and gdb_flush Tom Tromey
2022-01-22 17:40 ` [PATCH 00/19] Simplify GDB output functions John Baldwin
2022-03-24 16:25 ` Tom Tromey
2022-03-24 18:08 ` Pedro Alves
2022-03-29 19:38   ` Tom Tromey

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=82655a78-dbee-1ee6-a2aa-0d620ea21aeb@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.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).