summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-12-08 03:09:00 +0000
committerJason Molenda <jmolenda@apple.com>2014-12-08 03:09:00 +0000
commite589e7e3368701245a32dbeb7d7d94a91072c015 (patch)
tree23a9d9618b359595eba4913ffcc271155be8110d /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
parent2b6e66267283215c7c5078d1df997df1380084f7 (diff)
downloadbcm5719-llvm-e589e7e3368701245a32dbeb7d7d94a91072c015.tar.gz
bcm5719-llvm-e589e7e3368701245a32dbeb7d7d94a91072c015.zip
The lldb unwinder can now use the unwind information from the compact-unwind
section for x86_64 and i386 targets on Darwin systems. Currently only the compact unwind encoding for normal frame-using functions is supported but it will be easy handle frameless functions when I have a bit more free time to test it. The LSDA and personality routines for functions are also retrieved correctly for functions from the compact unwind section. This new code is very fresh -- it passes the lldb testsuite and I've done by-hand inspection of many functions and am getting correct behavior for all of them. There may need to be some bug fixing over the next couple weeks as I exercise and test it further. But I think it's fine right now so I'm committing it. <rdar://problem/13220837> llvm-svn: 223625
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 796b92c966c..5aaf90a314e 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -1276,7 +1276,9 @@ ObjectFileMachO::GetAddressClass (lldb::addr_t file_addr)
const lldb::SectionType section_type = section_sp->GetType();
switch (section_type)
{
- case eSectionTypeInvalid: return eAddressClassUnknown;
+ case eSectionTypeInvalid:
+ return eAddressClassUnknown;
+
case eSectionTypeCode:
if (m_header.cputype == llvm::MachO::CPU_TYPE_ARM)
{
@@ -1287,7 +1289,9 @@ ObjectFileMachO::GetAddressClass (lldb::addr_t file_addr)
}
return eAddressClassCode;
- case eSectionTypeContainer: return eAddressClassUnknown;
+ case eSectionTypeContainer:
+ return eAddressClassUnknown;
+
case eSectionTypeData:
case eSectionTypeDataCString:
case eSectionTypeDataCStringPointers:
@@ -1300,6 +1304,7 @@ ObjectFileMachO::GetAddressClass (lldb::addr_t file_addr)
case eSectionTypeDataObjCMessageRefs:
case eSectionTypeDataObjCCFStrings:
return eAddressClassData;
+
case eSectionTypeDebug:
case eSectionTypeDWARFDebugAbbrev:
case eSectionTypeDWARFDebugAranges:
@@ -1317,12 +1322,17 @@ ObjectFileMachO::GetAddressClass (lldb::addr_t file_addr)
case eSectionTypeDWARFAppleNamespaces:
case eSectionTypeDWARFAppleObjC:
return eAddressClassDebug;
- case eSectionTypeEHFrame: return eAddressClassRuntime;
+
+ case eSectionTypeEHFrame:
+ case eSectionTypeCompactUnwind:
+ return eAddressClassRuntime;
+
case eSectionTypeELFSymbolTable:
case eSectionTypeELFDynamicSymbols:
case eSectionTypeELFRelocationEntries:
case eSectionTypeELFDynamicLinkInfo:
- case eSectionTypeOther: return eAddressClassUnknown;
+ case eSectionTypeOther:
+ return eAddressClassUnknown;
}
}
}
@@ -1745,6 +1755,7 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list)
static ConstString g_sect_name_dwarf_apple_namespaces ("__apple_namespac");
static ConstString g_sect_name_dwarf_apple_objc ("__apple_objc");
static ConstString g_sect_name_eh_frame ("__eh_frame");
+ static ConstString g_sect_name_compact_unwind ("__unwind_info");
static ConstString g_sect_name_text ("__text");
static ConstString g_sect_name_data ("__data");
@@ -1785,6 +1796,8 @@ ObjectFileMachO::CreateSections (SectionList &unified_section_list)
sect_type = eSectionTypeDataObjCMessageRefs;
else if (section_name == g_sect_name_eh_frame)
sect_type = eSectionTypeEHFrame;
+ else if (section_name == g_sect_name_compact_unwind)
+ sect_type = eSectionTypeCompactUnwind;
else if (section_name == g_sect_name_cfstring)
sect_type = eSectionTypeDataObjCCFStrings;
else if (section_name == g_sect_name_objc_data ||
OpenPOWER on IntegriCloud