diff options
| author | Greg Clayton <gclayton@apple.com> | 2015-02-05 02:10:29 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2015-02-05 02:10:29 +0000 |
| commit | 68c00bd2057e3a1a8f8320c35e30fd42a1ef3e02 (patch) | |
| tree | d2cd47e7814071e575bf35c03c6d5876d9eb7ee6 | |
| parent | 17177d1e8445e573ea86d962f5239ff91b100e33 (diff) | |
| download | bcm5719-llvm-68c00bd2057e3a1a8f8320c35e30fd42a1ef3e02.tar.gz bcm5719-llvm-68c00bd2057e3a1a8f8320c35e30fd42a1ef3e02.zip | |
Keep the user data for compile units up to date since we often create lldb_private::CompileUnit objects without creating the DWARFCompileUnit objects when we do DWARF in .o files.
Now we make sure to update our DWARFCompileUnit -> lldb_private::CompileUnit user data when it isn't set to ensure quick transitions between the two.
<rdar://problem/18371367>
llvm-svn: 228264
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index e2aefd13fee..7ba4f52ac29 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -893,13 +893,22 @@ SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) // only 1 compile unit which is at offset zero in the DWARF. // TODO: modify to support LTO .o files where each .o file might // have multiple DW_TAG_compile_unit tags. - return info->GetCompileUnit(0).get(); + + DWARFCompileUnit *dwarf_cu = info->GetCompileUnit(0).get(); + if (dwarf_cu && dwarf_cu->GetUserData() == NULL) + dwarf_cu->SetUserData(comp_unit); + return dwarf_cu; } else { // Just a normal DWARF file whose user ID for the compile unit is // the DWARF offset itself - return info->GetCompileUnit((dw_offset_t)comp_unit->GetID()).get(); + + DWARFCompileUnit *dwarf_cu = info->GetCompileUnit((dw_offset_t)comp_unit->GetID()).get(); + if (dwarf_cu && dwarf_cu->GetUserData() == NULL) + dwarf_cu->SetUserData(comp_unit); + return dwarf_cu; + } } return NULL; |

