public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Aaron Merey via Gdb-patches <gdb-patches@sourceware.org>,
	gdb-patches@sourceware.org
Cc: Aaron Merey <amerey@redhat.com>
Subject: Re: [PATCH 3/7] gdb/debuginfod: disable pagination during downloads
Date: Wed, 24 May 2023 10:38:04 +0100	[thread overview]
Message-ID: <87y1le6pdv.fsf@redhat.com> (raw)
In-Reply-To: <20230227194212.348003-3-amerey@redhat.com>

Aaron Merey via Gdb-patches <gdb-patches@sourceware.org> writes:

> Disable pagination during downloads in order to avoid inconvenient
> continue prompts "--Type <RET> for more, q to quit...".
>
> For more discussion on this issue see the following thread
> https://sourceware.org/pipermail/gdb-patches/2023-February/196674.html

Is this patch critical to the new functionality in this series?  If it's
not then you might be better spinning this patch into it's own thread.

I also echo Tom's query about why this change is needed.  I haven't read
the thread you reference above -- I want to review the rest of this
series first -- but if there's good justification for this change in
that thread then it would be nice to see that in the commit message, the
commit message is carried with the code, but the mail archive might
disappear in the future.

> ---
>  gdb/debuginfod-support.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c
> index 12025fcf0c0..f4969e94b0a 100644
> --- a/gdb/debuginfod-support.c
> +++ b/gdb/debuginfod-support.c
> @@ -292,6 +292,9 @@ debuginfod_source_query (const unsigned char *build_id,
>  			 const char *srcpath,
>  			 gdb::unique_xmalloc_ptr<char> *destname)
>  {
> +  scoped_restore save_count_lines_printed
> +   = make_scoped_restore (&pagination_enabled, false);

Given you have several uses of the same pattern, it might be nice to add
a new 'scoped_restore_pagination' class, we already have lots of
scoped_restore_XXX specialisation classes.

Thanks,
Andrew

> +
>    if (!debuginfod_is_enabled ())
>      return scoped_fd (-ENOSYS);
>  
> @@ -333,6 +336,9 @@ debuginfod_debuginfo_query (const unsigned char *build_id,
>  			    const char *filename,
>  			    gdb::unique_xmalloc_ptr<char> *destname)
>  {
> +  scoped_restore save_count_lines_printed
> +   = make_scoped_restore (&pagination_enabled, false);
> +
>    if (!debuginfod_is_enabled ())
>      return scoped_fd (-ENOSYS);
>  
> @@ -371,6 +377,9 @@ debuginfod_exec_query (const unsigned char *build_id,
>  		       const char *filename,
>  		       gdb::unique_xmalloc_ptr<char> *destname)
>  {
> +  scoped_restore save_count_lines_printed
> +   = make_scoped_restore (&pagination_enabled, false);
> +
>    if (!debuginfod_is_enabled ())
>      return scoped_fd (-ENOSYS);
>  
> @@ -412,6 +421,8 @@ debuginfod_section_query (const unsigned char *build_id,
>  #if !defined (HAVE_DEBUGINFOD_FIND_SECTION)
>    return scoped_fd (-ENOSYS);
>  #else
> +  scoped_restore save_count_lines_printed
> +    = make_scoped_restore (&pagination_enabled, false);
>  
>   if (debuginfod_enabled != debuginfod_lazy || !debuginfod_is_enabled ())
>      return scoped_fd (-ENOSYS);
> -- 
> 2.39.2


  parent reply	other threads:[~2023-05-24  9:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 19:42 [PATCH 1/7] gdb/debuginfod: Add debuginfod_section_query Aaron Merey
2023-02-27 19:42 ` [PATCH 2/7] gdb: add 'lazy' setting for command 'set debuginfod enabled' Aaron Merey
2023-02-27 19:54   ` Eli Zaretskii
2023-05-24  9:31   ` Andrew Burgess
2023-02-27 19:42 ` [PATCH 3/7] gdb/debuginfod: disable pagination during downloads Aaron Merey
2023-03-03 21:33   ` Tom Tromey
2023-03-06 23:07     ` Aaron Merey
2023-05-24  9:38   ` Andrew Burgess [this message]
2023-05-24 18:57     ` Aaron Merey
2023-02-27 19:42 ` [PATCH 4/7] gdb/ui-file: Add newline tracking Aaron Merey
2023-03-07 19:33   ` Tom Tromey
2023-03-07 20:30     ` Aaron Merey
2023-03-07 20:47       ` Tom Tromey
2023-02-27 19:42 ` [PATCH 5/7] gdb/debuginfod: Support on-demand debuginfo downloading Aaron Merey
2023-03-07 20:20   ` Tom Tromey
2023-03-09  0:22     ` Aaron Merey
2023-02-27 19:42 ` [PATCH 6/7] gdb/testsuite/gdb.debuginfod: Add lazy downloading tests Aaron Merey
2023-05-02 15:48   ` Andrew Burgess
2023-05-02 16:24     ` Aaron Merey
2023-05-24 10:12   ` Andrew Burgess
2023-02-27 19:42 ` [PATCH 7/7] gdb/debuginfod: Add .debug_line downloading Aaron Merey
2023-03-07 20:36   ` Tom Tromey
2023-03-09  0:26     ` Aaron Merey
2023-02-28 11:11 ` [PATCH 1/7] gdb/debuginfod: Add debuginfod_section_query Alexandra Petlanova Hajkova
2023-05-24  9:01 ` Andrew Burgess

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=87y1le6pdv.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=amerey@redhat.com \
    --cc=gdb-patches@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).