llvm-project/lldb/source/Core
Greg Clayton 6beaaa680a A few of the issue I have been trying to track down and fix have been due to
the way LLDB lazily gets complete definitions for types within the debug info.
When we run across a class/struct/union definition in the DWARF, we will only
parse the full definition if we need to. This works fine for top level types
that are assigned directly to variables and arguments, but when we have a 
variable with a class, lets say "A" for this example, that has a member:
"B *m_b". Initially we don't need to hunt down a definition for this class
unless we are ever asked to do something with it ("expr m_b->getDecl()" for
example). With my previous approach to lazy type completion, we would be able
to take a "A *a" and get a complete type for it, but we wouldn't be able to
then do an "a->m_b->getDecl()" unless we always expanded all types within a
class prior to handing out the type. Expanding everything is very costly and
it would be great if there were a better way.

A few months ago I worked with the llvm/clang folks to have the 
ExternalASTSource class be able to complete classes if there weren't completed
yet:

class ExternalASTSource {
....

    virtual void
    CompleteType (clang::TagDecl *Tag);
    
    virtual void 
    CompleteType (clang::ObjCInterfaceDecl *Class);
};

This was great, because we can now have the class that is producing the AST
(SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources
and the object that creates the forward declaration types can now also
complete them anywhere within the clang type system.

This patch makes a few major changes:
- lldb_private::Module classes now own the AST context. Previously the TypeList
  objects did.
- The DWARF parsers now sign up as an external AST sources so they can complete
  types.
- All of the pure clang type system wrapper code we have in LLDB (ClangASTContext,
  ClangASTType, and more) can now be iterating through children of any type,
  and if a class/union/struct type (clang::RecordType or ObjC interface) 
  is found that is incomplete, we can ask the AST to get the definition. 
- The SymbolFileDWARFDebugMap class now will create and use a single AST that
  all child SymbolFileDWARF classes will share (much like what happens when
  we have a complete linked DWARF for an executable).
  
We will need to modify some of the ClangUserExpression code to take more 
advantage of this completion ability in the near future. Meanwhile we should
be better off now that we can be accessing any children of variables through
pointers and always be able to resolve the clang type if needed.

llvm-svn: 123613
2011-01-17 03:46:26 +00:00
..
Address.cpp Spelling changes applied from lldb_spelling.diffs from Bruce Mitchener. 2011-01-08 20:28:42 +00:00
AddressRange.cpp Moved the section load list up into the target so we can use the target 2010-09-14 23:36:40 +00:00
AddressResolver.cpp
AddressResolverFileLine.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
AddressResolverName.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
ArchSpec.cpp Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
Baton.cpp
Broadcaster.cpp Broadcaster::AddListener(): Bail out early if the passed in Listener pointer is 2010-12-22 19:29:31 +00:00
Communication.cpp Do not pass an invalid thread to Thread{Cancel,Join}. 2011-01-12 04:22:54 +00:00
Connection.cpp
ConnectionFileDescriptor.cpp Patch from Stephen Wilson: 2010-12-20 21:07:54 +00:00
ConstString.cpp Made many ConstString functions inlined in the header file. 2010-10-15 22:48:33 +00:00
DataBufferHeap.cpp
DataBufferMemoryMap.cpp Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
DataExtractor.cpp Added complete complex support for displaying and parsing complex types. 2011-01-15 02:52:14 +00:00
Debugger.cpp Split up the Python script interpreter code to allow multiple script interpreter objects to 2011-01-14 00:29:16 +00:00
Disassembler.cpp Added the ability for Target::ReadMemory to prefer to read from the file 2011-01-07 01:57:07 +00:00
DynamicLoader.cpp General command line help cleanup: 2010-09-18 03:37:20 +00:00
Error.cpp Fixed an error in the type map for "char **" that was a bad memory smasher. 2011-01-14 04:54:56 +00:00
Event.cpp Added support for breakpoint conditions. I also had to separate the "run the expression" part of ClangFunction::Execute from the "Gather the expression result" so that in the case of the Breakpoint condition I can move the condition evaluation into the normal thread plan processing. 2010-10-14 23:45:03 +00:00
FileSpec.cpp Updated to latest LLVM/Clang for external AST source changes that allow 2010-12-02 23:20:03 +00:00
FileSpecList.cpp Add missing includes. 2010-06-09 08:50:27 +00:00
InputReader.cpp Add the ability to catch and do the right thing with Interrupts (often control-c) 2010-11-19 20:47:54 +00:00
Language.cpp Created lldb::LanguageType by moving an enumeration from the 2010-07-28 02:04:09 +00:00
Listener.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
Log.cpp Cleaned up code that wasn't using the Initialize and Terminate paradigm by 2010-11-18 23:32:35 +00:00
Makefile Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
Mangled.cpp Move the demangle-failed indication out a bit so other failing cases 2010-12-15 04:27:04 +00:00
Module.cpp A few of the issue I have been trying to track down and fix have been due to 2011-01-17 03:46:26 +00:00
ModuleChild.cpp
ModuleList.cpp Remove an assertion that is causing crashes. We do need to find a way to reproduce when this assertion asserts, but we should crash our debug session because of it. For now we log to stderr in hope of tracking it down. 2010-12-20 23:42:12 +00:00
PluginManager.cpp Committing the skeleton of Language runtime plugin classes. 2010-09-23 02:01:19 +00:00
RegularExpression.cpp Improved our argument parsing abilities to be able to handle stuff more like 2010-12-19 03:41:24 +00:00
Scalar.cpp Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong. 2010-06-15 19:49:27 +00:00
SearchFilter.cpp Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
Section.cpp Added the ability to dump sections to a certain depth (for when sections 2010-12-08 05:08:21 +00:00
SourceManager.cpp Fixed an issue in our source manager where we were permanently caching source 2010-12-08 20:16:12 +00:00
State.cpp Fixed debugserver to properly attach to a process by name with the 2010-10-18 01:45:30 +00:00
Stream.cpp Updated the lldb_private::Flags class to have better method names and made 2010-10-27 03:32:59 +00:00
StreamFile.cpp We now have SBStream that mirrors the generic stream classes we 2010-09-17 17:42:16 +00:00
StreamString.cpp Add missing includes. 2010-06-09 08:50:27 +00:00
StringList.cpp Merged Eli Friedman's linux build changes where he added Makefile files that 2010-07-09 20:39:50 +00:00
TTYState.cpp
Timer.cpp Added a setting to "log timer" so you can see the incremental timings as well: 2010-11-04 23:19:21 +00:00
UUID.cpp Remove unused uuid_t constructor for lldb_private::UUID. 2010-06-10 03:08:05 +00:00
UserID.cpp Move trivial parts of UserID into the header. 2010-06-22 10:44:12 +00:00
UserSettingsController.cpp Improved our argument parsing abilities to be able to handle stuff more like 2010-12-19 03:41:24 +00:00
VMRange.cpp Added support for inlined stack frames being represented as real stack frames 2010-08-24 00:45:41 +00:00
Value.cpp Modified LLDB expressions to not have to JIT and run code just to see variable 2010-12-14 02:59:59 +00:00
ValueObject.cpp A few of the issue I have been trying to track down and fix have been due to 2011-01-17 03:46:26 +00:00
ValueObjectChild.cpp A few of the issue I have been trying to track down and fix have been due to 2011-01-17 03:46:26 +00:00
ValueObjectConstResult.cpp A few of the issue I have been trying to track down and fix have been due to 2011-01-17 03:46:26 +00:00
ValueObjectList.cpp StackFrame objects now own ValueObjects for any frame variables (locals, args, 2010-09-02 02:59:18 +00:00
ValueObjectRegister.cpp A few of the issue I have been trying to track down and fix have been due to 2011-01-17 03:46:26 +00:00
ValueObjectVariable.cpp A few of the issue I have been trying to track down and fix have been due to 2011-01-17 03:46:26 +00:00