public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 06/15] Add "maint set dwarf synchronous"
Date: Sun, 29 Oct 2023 19:50:03 +0200	[thread overview]
Message-ID: <835y2pb9o4.fsf@gnu.org> (raw)
In-Reply-To: <20231029173839.471514-7-tom@tromey.com> (message from Tom Tromey on Sun, 29 Oct 2023 11:35:25 -0600)

> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Sun, 29 Oct 2023 11:35:25 -0600
> 
> For testing, it's sometimes convenient to be able to request that
> DWARF reading be done synchronously.  This patch adds a new "maint"
> setting for this purpose.
> ---
>  gdb/NEWS            |  3 +++
>  gdb/doc/gdb.texinfo | 14 ++++++++++++++
>  gdb/dwarf2/read.c   | 23 +++++++++++++++++++++++
>  3 files changed, 40 insertions(+)

Thanks.

> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -9,6 +9,9 @@
>  * GDB index now contains information about the main function.  This speeds up
>    startup when it is being used for some large binaries.
>  
> +* DWARF reading is now done in the background, resulting in faster startup.
> +  This can be controlled using "maint set dwarf synchronous".

I'm guessing this isn't supported in all build configurations, and if
so, this text should say so, and should give some indication which
configurations don't support this feature.

> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -41692,6 +41692,20 @@ compilation units will be stored in memory longer, and more total
>  memory will be used.  Setting it to zero disables caching, which will
>  slow down @value{GDBN} startup, but reduce memory consumption.
>  
> +@kindex maint set dwarf synchronous
> +@kindex maint show dwarf synchronous
> +@item maint set dwarf synchronous
> +@itemx maint show dwarf synchronous
> +Control whether DWARF is read asynchronously.
> +
> +By default, the DWARF reader is mostly asynchronous with respect to
> +the rest of @value{GDBN}.  That is, the bulk of the reading is done in
> +the background, and @value{GDBN} will only pause for completion of
> +this task when absolutely necessary.
> +
> +When this setting is enabled, @value{GDBN} will instead wait for DWARF
> +processing to complete before continuing.

Same here.  I'm guessing on platforms where this doesn't work, this
setting doesn't have effect, and the default value is "synchronous"?

> +/* Wait for DWARF reading to be complete.  */
> +static bool dwarf_synchronous = false;
> +static void
> +show_dwarf_synchronous (struct ui_file *file, int from_tty,
> +			struct cmd_list_element *c, const char *value)
> +{
> +  gdb_printf (file, _("Whether DWARF reading is synchronous is %s.\n"),
> +	      value);
> +}

The comment seems to describe a different function?

> +  add_setshow_boolean_cmd ("synchronous", class_obscure,
> +			    &dwarf_synchronous, _("\
> +Set whether DWARF is read synchronously."), _("\
> +Show DWARF is read synchronously."), _("\
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"Show whether DWARF is read synchronously."

> +By default, DWARF information is read in worker threads,\n\
> +and gdb will not generally wait for this process to complete.\n\
> +Enabling this setting will cause the DWARF reader to always wait\n\
> +for completion before gdb can proceed."),

This could use some clarifications.  The "wait for this process to
complete" and "wait for completion before gdb can proceed" parts are
somewhat mysterious: what exactly does "proceed" mean, and when it is
important to wait for this to complete?

IOW, this doc string leaves unsaid what processing needs DWARF reading
to complete.

  reply	other threads:[~2023-10-29 17:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 17:35 [PATCH 00/15] Index DWARF in the background Tom Tromey
2023-10-29 17:35 ` [PATCH 01/15] Add thread-safety to gdb's BFD wrappers Tom Tromey
2023-10-29 17:35 ` [PATCH 02/15] Refactor complaint thread-safety approach Tom Tromey
2023-10-29 17:35 ` [PATCH 03/15] Add quick_symbol_functions::compute_main_name Tom Tromey
2023-10-29 17:35 ` [PATCH 04/15] Add gdb::task_group Tom Tromey
2023-10-29 17:35 ` [PATCH 05/15] Move cooked_index_storage to cooked-index.h Tom Tromey
2023-10-29 17:35 ` [PATCH 06/15] Add "maint set dwarf synchronous" Tom Tromey
2023-10-29 17:50   ` Eli Zaretskii [this message]
     [not found]     ` <87v89tfz40.fsf@tromey.com>
2023-11-23  6:08       ` Eli Zaretskii
2023-10-29 17:35 ` [PATCH 07/15] Change how cooked index waits for threads Tom Tromey
2023-10-29 17:35 ` [PATCH 08/15] Do more DWARF reading in the background Tom Tromey
2023-10-29 17:35 ` [PATCH 09/15] Simplify the public DWARF API Tom Tromey
2023-10-29 17:35 ` [PATCH 10/15] Remove two quick_symbol_functions methods Tom Tromey
2023-10-29 17:35 ` [PATCH 11/15] Change current_language to be a macro Tom Tromey
2023-10-29 17:35 ` [PATCH 12/15] Lazy language setting Tom Tromey
2023-10-29 17:35 ` [PATCH 13/15] Optimize lookup_minimal_symbol_text Tom Tromey
2023-10-29 17:35 ` [PATCH 14/15] Avoid language-based lookups in startup path Tom Tromey
2023-10-29 17:35 ` [PATCH 15/15] Back out some parallel_for_each features 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=835y2pb9o4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --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).