From 1e28adfe7595da953b39fe091747e1553eab56e2 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 25 Feb 2015 17:25:02 +0000 Subject: MacOSX symbol table change to combine the N_GSYM debug map entry with the "_OBJC_CLASS_$_", "_OBJC_METACLASS_$_", and "_OBJC_IVAR_$_" non debug symbols. This allows the symbol that represents the object file to contain the eSymbolTypeObjCClass and eSymbolTypeObjCMetaClass and will help us to be able to efficiently lookup the real definition of an objective C class without loading all .o files linearly to find the .o file that contains the true definition. llvm-svn: 230509 --- .../Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 102 +++++++++++++++------ 1 file changed, 74 insertions(+), 28 deletions(-) (limited to 'lldb/source/Plugins/ObjectFile') diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 7b49daa59ab..682a1c27096 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -2142,6 +2142,9 @@ ObjectFileMachO::ParseSymtab () uint32_t i; FileSpecList dylib_files; Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SYMBOLS)); + static const llvm::StringRef g_objc_v2_prefix_class ("_OBJC_CLASS_$_"); + static const llvm::StringRef g_objc_v2_prefix_metaclass ("_OBJC_METACLASS_$_"); + static const llvm::StringRef g_objc_v2_prefix_ivar ("_OBJC_IVAR_$_"); for (i=0; iGetFileAddress(); @@ -4267,7 +4310,10 @@ ObjectFileMachO::ParseSymtab () type = eSymbolTypeResolver; } } - else if (type == eSymbolTypeData) + else if (type == eSymbolTypeData || + type == eSymbolTypeObjCClass || + type == eSymbolTypeObjCMetaClass || + type == eSymbolTypeObjCIVar ) { // See if we can find a N_STSYM entry for any data symbols. // If we do find a match, and the name matches, then we @@ -4308,7 +4354,7 @@ ObjectFileMachO::ParseSymtab () sym[GSYM_sym_idx].GetAddress().SetSection (symbol_section); sym[GSYM_sym_idx].GetAddress().SetOffset (symbol_value); // We just need the flags from the linker symbol, so put these flags - // into the N_STSYM flags to avoid duplicate symbols in the symbol table + // into the N_GSYM flags to avoid duplicate symbols in the symbol table sym[GSYM_sym_idx].SetFlags (nlist.n_type << 16 | nlist.n_desc); sym[sym_idx].Clear(); continue; -- cgit v1.2.3