Change increment_reading_symtab to return a scoped_restore

This changes increment_reading_symtab to return a scoped_restore, then
fixes up the users.

gdb/ChangeLog
2017-04-12  Tom Tromey  <tom@tromey.com>

	* symfile.h (increment_reading_symtab): Update type.
	* symfile.c (decrement_reading_symtab): Remove.
	(increment_reading_symtab): Return a scoped_restore_tmpl<int>.
	* psymtab.c (psymtab_to_symtab): Update.
	* dwarf2read.c (dw2_instantiate_symtab): Update.
This commit is contained in:
Tom Tromey
2017-04-06 20:27:10 -06:00
parent 0e8621a0be
commit c83dd86726
5 changed files with 15 additions and 17 deletions

View File

@@ -770,10 +770,9 @@ psymtab_to_symtab (struct objfile *objfile, struct partial_symtab *pst)
/* If it has not yet been read in, read it. */
if (!pst->readin)
{
struct cleanup *back_to = increment_reading_symtab ();
scoped_restore decrementer = increment_reading_symtab ();
(*pst->read_symtab) (pst, objfile);
do_cleanups (back_to);
}
return pst->compunit_symtab;