On 6/14/21 10:22 PM, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> ISTM that the ancestor implementation is confusing and fragile, and should > Tom> go. Furthermore, it seems that keeping track of the m_builder in scope can be > Tom> handled simply with a global variable. > > I'd rather not have any global variables. > > Maybe a new member of dwarf2_per_objfile would be equivalent. > Done. [ My concern here was problems with inter-obj references, but I've tested with target board cc-with-dwz-m and didn't run into any problems. ] > Tom> + gdb_assert (dwarf2_cu::sym_cu == nullptr); > Tom> + scoped_restore restore_sym_cu = make_scoped_restore (&dwarf2_cu::sym_cu); > Tom> + dwarf2_cu::sym_cu = cu; > > You can pass 'cu' as a second argument to make_scoped_restore. Also done, and retested in both test configurations. Any further comments? Thanks, - Tom