diff options
| author | Greg Clayton <gclayton@apple.com> | 2010-12-07 07:37:38 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2010-12-07 07:37:38 +0000 |
| commit | 65e364e5da5e3b2814f1583a7b99c440d7a3fd50 (patch) | |
| tree | 48bed418b97e56d05abb3eef9ef361c2aac13904 | |
| parent | 75dbe3c799e426e145bf4d21df1b0012a0f5b1d8 (diff) | |
| download | bcm5719-llvm-65e364e5da5e3b2814f1583a7b99c440d7a3fd50.tar.gz bcm5719-llvm-65e364e5da5e3b2814f1583a7b99c440d7a3fd50.zip | |
Fixed an issue when debugging with DWARF in the .o files where
if two functions had the same demangled names (constructors where
we have the in charge and not in charge version) we could end up
mixing the two up when making the function in the DWARF. This was
because we need to lookup the symbol by name and we need to use the
mangled name if there is one. This ensures we get the correct address
and that we resolve the linked addresses correctly for DWARf with debug
map.
llvm-svn: 121116
| -rw-r--r-- | lldb/lldb.xcodeproj/project.pbxproj | 1 | ||||
| -rw-r--r-- | lldb/source/Core/Section.cpp | 6 | ||||
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 8 |
3 files changed, 6 insertions, 9 deletions
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 1ee8b4494f4..c330730f039 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -2459,7 +2459,6 @@ isa = PBXProject; buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */; compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( en, diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 28935b2249c..df4dc258b10 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -272,7 +272,7 @@ Section::Dump (Stream *s, Target *target) const addr = m_linked_section->GetFileAddress() + m_linked_offset; } - int indent = (sizeof(void*) + 1 + sizeof(user_id_t) + 1) * 2 + 3 + s->GetIndentLevel(); + int indent = 26 + s->GetIndentLevel(); s->Printf("%*.*s", indent, indent, ""); VMRange linked_range(addr, addr + m_byte_size); linked_range.Dump (s, 0); @@ -289,9 +289,7 @@ Section::Dump (Stream *s, Target *target) const void Section::DumpName (Stream *s) const { - if (m_linked_section) - return m_linked_section->DumpName(s); - else if (m_parent == NULL) + if (m_parent == NULL) { // The top most section prints the module basename const char *module_basename = m_module->GetFileSpec().GetFilename().AsCString(); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 754fba8625b..62e6d58933b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -282,7 +282,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit // correctly to the new addresses in the main executable. // First we find the original symbol in the .o file's symbol table - Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeCode, Symtab::eDebugNo, Symtab::eVisibilityAny); + Symbol *oso_fun_symbol = oso_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), eSymbolTypeCode, Symtab::eDebugNo, Symtab::eVisibilityAny); if (oso_fun_symbol) { // If we found the symbol, then we @@ -301,7 +301,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit SectionSP oso_fun_section_sp (new Section (const_cast<Section *>(oso_fun_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection()), oso_module, // Module (the .o file) sect_id++, // Section ID starts at 0x10000 and increments so the section IDs don't overlap with the standard mach IDs - exe_symbol->GetMangled().GetName(), // Name the section the same as the symbol for which is was generated! + exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), // Name the section the same as the symbol for which is was generated! eSectionTypeDebug, oso_fun_symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset(), // File VM address offset in the current section exe_symbol->GetByteSize(), // File size (we need the size from the executable) @@ -333,7 +333,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit #if 0 // First we find the non-stab entry that corresponds to the N_GSYM in the executable - Symbol *exe_gsym_symbol = exe_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(), eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny); + Symbol *exe_gsym_symbol = exe_symtab->FindFirstSymbolWithNameAndType(exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), eSymbolTypeData, Symtab::eDebugNo, Symtab::eVisibilityAny); #else // The mach-o object file parser already matches up the N_GSYM with with the non-stab // entry, so we shouldn't have to do that. If this ever changes, enable the code above @@ -352,7 +352,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo (CompileUnitInfo *comp_unit SectionSP oso_gsym_section_sp (new Section (const_cast<Section *>(oso_gsym_symbol->GetAddressRangePtr()->GetBaseAddress().GetSection()), oso_module, // Module (the .o file) sect_id++, // Section ID starts at 0x10000 and increments so the section IDs don't overlap with the standard mach IDs - exe_symbol->GetMangled().GetName(), // Name the section the same as the symbol for which is was generated! + exe_symbol->GetMangled().GetName(Mangled::ePreferMangled), // Name the section the same as the symbol for which is was generated! eSectionTypeDebug, oso_gsym_symbol->GetAddressRangePtr()->GetBaseAddress().GetOffset(), // File VM address offset in the current section 1, // We don't know the size of the global, just do the main address for now. |

