aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-24 15:50:57 -0700
committerTom Tromey <tom@tromey.com>2020-02-24 15:50:57 -0700
commit7693576838f4fe66b2a2380425b5ad950c671b34 (patch)
tree856f7ac09f04d833f8826d69ddd431e9bd84c901 /gdb/dwarf2
parente56d7f1e194d09180469548d7ebb3726f1af22ab (diff)
downloadgdb-7693576838f4fe66b2a2380425b5ad950c671b34.zip
gdb-7693576838f4fe66b2a2380425b5ad950c671b34.tar.gz
gdb-7693576838f4fe66b2a2380425b5ad950c671b34.tar.bz2
Simplify setting of reading_partial_symbols
This simplifies the setting and clearing of reading_partial_symbols, by using scoped_restore in the function that reads partial symbols. gdb/ChangeLog 2020-02-24 Tom Tromey <tom@tromey.com> * dwarf2read.c (dwarf2_build_psymtabs_hard): Use make_scoped_restore. (dwarf2_psymtab::read_symtab): Don't clear reading_partial_symbols.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/read.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 46d510e..701d19e 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7718,7 +7718,9 @@ dwarf2_build_psymtabs_hard (struct dwarf2_per_objfile *dwarf2_per_objfile)
objfile_name (objfile));
}
- dwarf2_per_objfile->reading_partial_symbols = 1;
+ scoped_restore restore_reading_psyms
+ = make_scoped_restore (&dwarf2_per_objfile->reading_partial_symbols,
+ true);
dwarf2_per_objfile->info.read (objfile);
@@ -8692,8 +8694,6 @@ dwarf2_psymtab::read_symtab (struct objfile *objfile)
= dpo_backlink->has_section_at_zero;
}
- dwarf2_per_objfile->reading_partial_symbols = 0;
-
expand_psymtab (objfile);
process_cu_includes (dwarf2_per_objfile);