[Lldb-commits] [lldb] r243344 - Make sure we detect symbols in the new __DATA_DIRTY and __DATA_CONST segments and classify them correctly.
Greg Clayton
gclayton at apple.com
Mon Jul 27 16:21:05 PDT 2015
Author: gclayton
Date: Mon Jul 27 18:21:05 2015
New Revision: 243344
URL: http://llvm.org/viewvc/llvm-project?rev=243344&view=rev
Log:
Make sure we detect symbols in the new __DATA_DIRTY and __DATA_CONST segments and classify them correctly.
<rdar://problem/20942073>
Modified:
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=243344&r1=243343&r2=243344&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Jul 27 18:21:05 2015
@@ -1028,6 +1028,20 @@ ObjectFileMachO::GetSegmentNameDATA()
}
const ConstString &
+ObjectFileMachO::GetSegmentNameDATA_DIRTY()
+{
+ static ConstString g_segment_name ("__DATA_DIRTY");
+ return g_segment_name;
+}
+
+const ConstString &
+ObjectFileMachO::GetSegmentNameDATA_CONST()
+{
+ static ConstString g_segment_name ("__DATA_CONST");
+ return g_segment_name;
+}
+
+const ConstString &
ObjectFileMachO::GetSegmentNameOBJC()
{
static ConstString g_segment_name_OBJC ("__OBJC");
@@ -2442,10 +2456,14 @@ ObjectFileMachO::ParseSymtab ()
const ConstString &g_segment_name_TEXT = GetSegmentNameTEXT();
const ConstString &g_segment_name_DATA = GetSegmentNameDATA();
+ const ConstString &g_segment_name_DATA_DIRTY = GetSegmentNameDATA_DIRTY();
+ const ConstString &g_segment_name_DATA_CONST = GetSegmentNameDATA_CONST();
const ConstString &g_segment_name_OBJC = GetSegmentNameOBJC();
const ConstString &g_section_name_eh_frame = GetSectionNameEHFrame();
SectionSP text_section_sp(section_list->FindSectionByName(g_segment_name_TEXT));
SectionSP data_section_sp(section_list->FindSectionByName(g_segment_name_DATA));
+ SectionSP data_dirty_section_sp(section_list->FindSectionByName(g_segment_name_DATA_DIRTY));
+ SectionSP data_const_section_sp(section_list->FindSectionByName(g_segment_name_DATA_CONST));
SectionSP objc_section_sp(section_list->FindSectionByName(g_segment_name_OBJC));
SectionSP eh_frame_section_sp;
if (text_section_sp.get())
@@ -3298,7 +3316,9 @@ ObjectFileMachO::ParseSymtab ()
else
type = eSymbolTypeCode;
}
- else if (symbol_section->IsDescendant(data_section_sp.get()))
+ else if (symbol_section->IsDescendant(data_section_sp.get()) ||
+ symbol_section->IsDescendant(data_dirty_section_sp.get()) ||
+ symbol_section->IsDescendant(data_const_section_sp.get()))
{
if (symbol_sect_name && ::strstr (symbol_sect_name, "__objc") == symbol_sect_name)
{
@@ -4148,7 +4168,9 @@ ObjectFileMachO::ParseSymtab ()
type = eSymbolTypeCode;
}
else
- if (symbol_section->IsDescendant(data_section_sp.get()))
+ if (symbol_section->IsDescendant(data_section_sp.get()) ||
+ symbol_section->IsDescendant(data_dirty_section_sp.get()) ||
+ symbol_section->IsDescendant(data_const_section_sp.get()))
{
if (symbol_sect_name && ::strstr (symbol_sect_name, "__objc") == symbol_sect_name)
{
Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h?rev=243344&r1=243343&r2=243344&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h Mon Jul 27 18:21:05 2015
@@ -223,6 +223,8 @@ protected:
llvm::MachO::mach_header m_header;
static const lldb_private::ConstString &GetSegmentNameTEXT();
static const lldb_private::ConstString &GetSegmentNameDATA();
+ static const lldb_private::ConstString &GetSegmentNameDATA_DIRTY();
+ static const lldb_private::ConstString &GetSegmentNameDATA_CONST();
static const lldb_private::ConstString &GetSegmentNameOBJC();
static const lldb_private::ConstString &GetSegmentNameLINKEDIT();
static const lldb_private::ConstString &GetSectionNameEHFrame();
More information about the lldb-commits
mailing list