aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-10-21 15:22:09 -0600
committerTom Tromey <tom@tromey.com>2024-01-08 18:40:21 -0700
commit9b595a264168cdd950c19dafe4663ca25d22234b (patch)
tree9f4060d4320eead8bd16d625e0c54271a169b2b6 /gdb/dwarf2
parenta274da12ea9a4ea8bbb75489845c53be268fb450 (diff)
downloadgdb-9b595a264168cdd950c19dafe4663ca25d22234b.zip
gdb-9b595a264168cdd950c19dafe4663ca25d22234b.tar.gz
gdb-9b595a264168cdd950c19dafe4663ca25d22234b.tar.bz2
Add "maint set dwarf synchronous"
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. Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index eef0b06..507b152 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -736,6 +736,18 @@ show_dwarf_max_cache_age (struct ui_file *file, int from_tty,
"DWARF compilation units is %s.\n"),
value);
}
+
+/* When true, wait for DWARF reading to be complete. */
+static bool dwarf_synchronous = false;
+
+/* "Show" callback for "maint set dwarf synchronous". */
+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);
+}
/* local function prototypes */
@@ -21938,6 +21950,21 @@ caching, which can slow down startup."),
&set_dwarf_cmdlist,
&show_dwarf_cmdlist);
+ add_setshow_boolean_cmd ("synchronous", class_obscure,
+ &dwarf_synchronous, _("\
+Set whether 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 the reading to complete\n\
+before continuing with other work, for example presenting a\n\
+prompt to the user.\n\
+Enabling this setting will cause the DWARF reader to always wait\n\
+for debug info processing to be finished before gdb can proceed."),
+ nullptr,
+ show_dwarf_synchronous,
+ &set_dwarf_cmdlist,
+ &show_dwarf_cmdlist);
+
add_setshow_zuinteger_cmd ("dwarf-read", no_class, &dwarf_read_debug, _("\
Set debugging of the DWARF reader."), _("\
Show debugging of the DWARF reader."), _("\