hanchenye-llvm-project/lldb/source/Commands
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
..
CommandCompletions.cpp Spelling changes applied from lldb_spelling.diffs from Bruce Mitchener. 2011-01-08 20:28:42 +00:00
CommandObjectApropos.cpp
CommandObjectApropos.h
CommandObjectArgs.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
CommandObjectArgs.h
CommandObjectBreakpoint.cpp Documentation fix - explain how to unset conditions. Also fix unsetting -x and -t so they work. 2010-12-03 23:04:19 +00:00
CommandObjectBreakpoint.h Documentation fix - explain how to unset conditions. Also fix unsetting -x and -t so they work. 2010-12-03 23:04:19 +00:00
CommandObjectBreakpointCommand.cpp Add the ability to catch and do the right thing with Interrupts (often control-c) 2010-11-19 20:47:54 +00:00
CommandObjectBreakpointCommand.h
CommandObjectCommands.cpp Fix small bugs: 2010-12-14 18:51:39 +00:00
CommandObjectCommands.h
CommandObjectCrossref.cpp
CommandObjectDisassemble.cpp
CommandObjectDisassemble.h
CommandObjectExpression.cpp Implemented a major overhaul of the way variables are handled 2011-01-13 08:53:35 +00:00
CommandObjectExpression.h
CommandObjectFile.cpp
CommandObjectFile.h
CommandObjectFrame.cpp "frame variable" requires that the process be running and paused or there aren't any frames... So mark the command properly as such. 2010-12-23 02:17:54 +00:00
CommandObjectFrame.h
CommandObjectHelp.cpp - Fix alias-building & resolving to properly handle optional arguments for command options. 2010-12-07 19:58:26 +00:00
CommandObjectHelp.h
CommandObjectImage.cpp Added the ability to dump sections to a certain depth (for when sections 2010-12-08 05:08:21 +00:00
CommandObjectImage.h
CommandObjectLog.cpp
CommandObjectLog.h
CommandObjectMemory.cpp
CommandObjectMemory.h
CommandObjectMultiword.cpp Make CommandObjectMultiword::GetSubcommandSP() more robust by appending the 2010-12-01 01:04:22 +00:00
CommandObjectProcess.cpp process launch now asks to kill the current process if it is alive, and if you affirm, does so for you. 2010-12-09 18:58:16 +00:00
CommandObjectProcess.h
CommandObjectQuit.cpp
CommandObjectQuit.h
CommandObjectRegister.cpp
CommandObjectRegister.h
CommandObjectSettings.cpp Recent modifications to the Python script interpreter caused some problems 2011-01-14 21:09:29 +00:00
CommandObjectSettings.h
CommandObjectSource.cpp
CommandObjectSource.h
CommandObjectSyntax.cpp
CommandObjectSyntax.h
CommandObjectTarget.cpp
CommandObjectTarget.h
CommandObjectThread.cpp
CommandObjectThread.h
CommandObjectVersion.cpp Add a simple command: 'version' to the command interpreter, and an accompanying 2010-12-23 20:21:44 +00:00
CommandObjectVersion.h Add a simple command: 'version' to the command interpreter, and an accompanying 2010-12-23 20:21:44 +00:00
Makefile