aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-12-06 08:32:52 -0700
committerTom Tromey <tom@tromey.com>2024-01-18 08:20:16 -0700
commit6f49611564662fe56255359cd7d227b5b5fc64dc (patch)
tree8547ae856aa780a2a29f02c20e030fe62ae6baad /gdb/dwarf2
parent0d656dfe5b406289faef7f35fb87fb0a00dd64f3 (diff)
downloadgdb-6f49611564662fe56255359cd7d227b5b5fc64dc.zip
gdb-6f49611564662fe56255359cd7d227b5b5fc64dc.tar.gz
gdb-6f49611564662fe56255359cd7d227b5b5fc64dc.tar.bz2
Refactor 'maint set dwarf synchronous' handling
The new .debug_names reader will reuse the background reading infrastructure of the cooked index code. In order to share the handling of 'maint set dwarf synchronous' -- and to avoid having to export this global -- this patch refactors this to be handled directly in dwarf2_initialize_objfile.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 8f2b7a3..e0eb1f9 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -3267,6 +3267,10 @@ dwarf2_initialize_objfile (struct objfile *objfile,
global_index_cache.miss ();
objfile->qf.push_front (make_cooked_index_funcs (per_objfile));
}
+
+ if (dwarf_synchronous && per_bfd->index_table != nullptr)
+ per_bfd->index_table->wait_completely ();
+
return true;
}
@@ -16920,9 +16924,6 @@ make_cooked_index_funcs (dwarf2_per_objfile *per_objfile)
avoids races. */
idx->start_reading ();
- if (dwarf_synchronous)
- idx->wait_completely ();
-
return quick_symbol_functions_up (new cooked_index_functions);
}