public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
To: Aaron Merey <amerey@redhat.com>
Cc: aburgess@redhat.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/4 v7] gdb: Buffer output streams during events that might download debuginfo
Date: Tue, 26 Dec 2023 13:28:55 -0300	[thread overview]
Message-ID: <87mstxexmg.fsf@linaro.org> (raw)
In-Reply-To: <20231028002008.1105723-2-amerey@redhat.com>


Hello,

Nice feature! Just a few small nits:

Aaron Merey <amerey@redhat.com> writes:

> +buffered_streams::buffered_streams (buffer_group *group, ui_out *uiout)
> +    : m_buffered_stdout (group, gdb_stdout),
> +      m_buffered_stderr (group, gdb_stderr),
> +      m_buffered_stdlog (group, gdb_stdlog),
> +      m_buffered_stdtarg (group, gdb_stdtarg),
> +      m_buffered_stdtargerr (group, gdb_stdtargerr),
> +      m_uiout (uiout)
> +  {

This curly brace should be at column 0. Which naturally affects the
indentation of the whole method.

> +    gdb_stdout = &m_buffered_stdout;
> +    gdb_stderr = &m_buffered_stderr;
> +    gdb_stdlog = &m_buffered_stdlog;
> +    gdb_stdtarg = &m_buffered_stdtarg;
> +    gdb_stdtargerr = &m_buffered_stdtargerr;
> +
> +    ui_file *stream = current_uiout->current_stream ();
> +    if (stream != nullptr)
> +      {
> +	m_buffered_current_uiout.emplace (group, stream);
> +	current_uiout->redirect (&(*m_buffered_current_uiout));
> +      }
> +
> +    stream = m_uiout->current_stream ();
> +    if (stream != nullptr && current_uiout != m_uiout)
> +      {
> +	m_buffered_uiout.emplace (group, stream);
> +	m_uiout->redirect (&(*m_buffered_uiout));
> +      }
> +
> +    m_buffers_in_place = true;
> +  };

There's a stray semicolon here.

> +
> +/* See ui-out.h.  */
> +
> +void
> +buffered_streams::remove_buffers ()
> +  {

This curly brace should be at column 0.

> +    if (!m_buffers_in_place)
> +      return;
> +
> +    m_buffers_in_place = false;
> +
> +    gdb_stdout = m_buffered_stdout.stream ();
> +    gdb_stderr = m_buffered_stderr.stream ();
> +    gdb_stdlog = m_buffered_stdlog.stream ();
> +    gdb_stdtarg = m_buffered_stdtarg.stream ();
> +    gdb_stdtargerr = m_buffered_stdtargerr.stream ();
> +
> +    if (m_buffered_current_uiout.has_value ())
> +      current_uiout->redirect (nullptr);
> +
> +    if (m_buffered_uiout.has_value ())
> +      m_uiout->redirect (nullptr);
> +  }
> +
> +buffer_group::buffer_group (ui_out *uiout)
> +  : m_buffered_streams (new buffered_streams (this, uiout))
> +{ /* Nothing.  */ }
> +
> +buffer_group::~buffer_group ()
> +{ /* Nothing.  */ }

If the destructor does nothing, can it be removed?

-- 
Thiago

  parent reply	other threads:[~2023-12-26 16:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  0:20 [PATCH 0/4] On-demand debuginfo downloading Aaron Merey
2023-10-28  0:20 ` [PATCH 1/4 v7] gdb: Buffer output streams during events that might download debuginfo Aaron Merey
2023-11-12 20:20   ` Aaron Merey
2023-11-20 18:38     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:29       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:00         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:57           ` [PING*5][PATCH " Aaron Merey
2023-12-26 16:28   ` Thiago Jung Bauermann [this message]
2024-01-17 17:49     ` [PATCH " Aaron Merey
2024-01-17 18:05   ` Andrew Burgess
2023-10-28  0:20 ` [PATCH 2/4 v2] gdb/progspace: Add reverse safe iterator and template for unwrapping iterator Aaron Merey
2023-11-12 20:20   ` Aaron Merey
2023-11-20 18:39     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:30       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:01         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:57           ` [PING*5][PATCH " Aaron Merey
2023-12-26 17:09   ` [PATCH " Thiago Jung Bauermann
2023-10-28  0:20 ` [PATCH 3/4 v4] gdb/debuginfod: Support on-demand debuginfo downloading Aaron Merey
2023-11-12 20:20   ` Aaron Merey
2023-11-20 18:39     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:30       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:01         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:57           ` [PING*5][PATCH " Aaron Merey
2023-12-26 18:35   ` [PATCH " Thiago Jung Bauermann
2023-10-28  0:20 ` [PATCH 4/4 v5] gdb/debuginfod: Add .debug_line downloading Aaron Merey
2023-11-12 20:21   ` Aaron Merey
2023-11-20 18:40     ` [PING*2][PATCH " Aaron Merey
2023-11-30 16:30       ` [PING*3][PATCH " Aaron Merey
2023-12-12 15:08         ` [PING*4][PATCH " Aaron Merey
2023-12-20 14:58           ` [PING*5][PATCH " Aaron Merey
2023-12-27  0:30   ` [PATCH " Thiago Jung Bauermann

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=87mstxexmg.fsf@linaro.org \
    --to=thiago.bauermann@linaro.org \
    --cc=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).