[Lldb-commits] [lldb] r121116 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Core/Section.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
Greg Clayton
gclayton at apple.com
Mon Dec 6 23:37:38 PST 2010
Author: gclayton
Date: Tue Dec 7 01:37:38 2010
New Revision: 121116
URL: http://llvm.org/viewvc/llvm-project?rev=121116&view=rev
Log:
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.
Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/Core/Section.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=121116&r1=121115&r2=121116&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Dec 7 01:37:38 2010
@@ -2459,7 +2459,6 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.1";
- developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
Modified: lldb/trunk/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Section.cpp?rev=121116&r1=121115&r2=121116&view=diff
==============================================================================
--- lldb/trunk/source/Core/Section.cpp (original)
+++ lldb/trunk/source/Core/Section.cpp Tue Dec 7 01:37:38 2010
@@ -272,7 +272,7 @@
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 @@
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();
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=121116&r1=121115&r2=121116&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Tue Dec 7 01:37:38 2010
@@ -282,7 +282,7 @@
// 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 @@
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 @@
#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 @@
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.
More information about the lldb-commits
mailing list