Optimize finding the Complete Definition of an ObjC class for debug with .o files...
authorGreg Clayton <gclayton@apple.com>
Wed, 25 Feb 2015 22:41:34 +0000 (22:41 +0000)
committerGreg Clayton <gclayton@apple.com>
Wed, 25 Feb 2015 22:41:34 +0000 (22:41 +0000)
commitbc63aaccf7df033abd1f1060c681fe4853433383
treee385259899e61666da36145e1ceb43d7b8b112a0
parent75dbd7ca3e20bf432a6b94e92df6c4537fa9f78f
Optimize finding the Complete Definition of an ObjC class for debug with .o files with lots of .o files.

When we have a debug map we have an executable with a bunch of STAB symbols and each source file has a N_SO symbol which scopes a bunch of symbols inside of it. We can use this to our advantage here when looking for the complete definition of an objective C class by looking for a symbol whose name matches the class name and whose type is eSymbolTypeObjCClass. If we find one, that symbol will be contained within a N_SO symbol. This symbol gets turned into a symbol whose type is eSymbolTypeSourceFile and that symbol will contain the eSymbolTypeObjCClass which helps us to locate the correct .o file and allows us to only look in that file.

To further accelerate things, if we are looking for the implementation, we can avoid looking at all .o files if we don't find a matching symbol because we have a debug map, which means the objective C symbol for the class can't have been stripped, so we can safely not search all remaining .o files. This will save us lots of time when trying to look for "NSObject" and any other AppKit and Foundation classes that we never have implementation definitions for.

<rdar://problem/19234225>

llvm-svn: 230562
lldb/include/lldb/Symbol/Symtab.h
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
lldb/source/Symbol/Symbol.cpp
lldb/source/Symbol/Symtab.cpp