@@ -668,20 +668,12 @@ void DWARFRewriter::updateDebugInfo() {
668
668
auto processSplitCU = [&](DWARFUnit &Unit, DWARFUnit &SplitCU,
669
669
DIEBuilder &DIEBlder,
670
670
DebugRangesSectionWriter &TempRangesSectionWriter,
671
- DebugAddrWriter &AddressWriter) {
671
+ DebugAddrWriter &AddressWriter,
672
+ const std::string &DWOName,
673
+ const std::optional<std::string> &DwarfOutputPath) {
672
674
DIEBuilder DWODIEBuilder (BC, &(SplitCU).getContext (), DebugNamesTable,
673
675
&Unit);
674
676
DWODIEBuilder.buildDWOUnit (SplitCU);
675
- std::string DWOName = " " ;
676
- std::optional<std::string> DwarfOutputPath =
677
- opts::DwarfOutputPath.empty ()
678
- ? std::nullopt
679
- : std::optional<std::string>(opts::DwarfOutputPath.c_str ());
680
- {
681
- std::lock_guard<std::mutex> Lock (AccessMutex);
682
- DWOName = DIEBlder.updateDWONameCompDir (
683
- *StrOffstsWriter, *StrWriter, Unit, DwarfOutputPath, std::nullopt);
684
- }
685
677
DebugStrOffsetsWriter DWOStrOffstsWriter (BC);
686
678
DebugStrWriter DWOStrWriter ((SplitCU).getContext (), true );
687
679
DWODIEBuilder.updateDWONameCompDirForTypes (
@@ -759,8 +751,14 @@ void DWARFRewriter::updateDebugInfo() {
759
751
DebugRangesSectionWriter *TempRangesSectionWriter =
760
752
CU->getVersion () >= 5 ? RangeListsWritersByCU[*DWOId].get ()
761
753
: LegacyRangesWritersByCU[*DWOId].get ();
754
+ std::optional<std::string> DwarfOutputPath =
755
+ opts::DwarfOutputPath.empty ()
756
+ ? std::nullopt
757
+ : std::optional<std::string>(opts::DwarfOutputPath.c_str ());
758
+ std::string DWOName = DIEBlder.updateDWONameCompDir (
759
+ *StrOffstsWriter, *StrWriter, *CU, DwarfOutputPath, std::nullopt);
762
760
processSplitCU (*CU, **SplitCU, DIEBlder, *TempRangesSectionWriter,
763
- AddressWriter);
761
+ AddressWriter, DWOName, DwarfOutputPath );
764
762
}
765
763
for (DWARFUnit *CU : DIEBlder.getProcessedCUs ())
766
764
processMainBinaryCU (*CU, DIEBlder);
0 commit comments