hanchenye-llvm-project/lldb/source/Target
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
..
ABI.cpp
CPPLanguageRuntime.cpp
ExecutionContext.cpp Fixed issues with RegisterContext classes and the subclasses. There was 2011-01-06 22:15:06 +00:00
LanguageRuntime.cpp
Makefile
ObjCLanguageRuntime.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
PathMappingList.cpp
Process.cpp Do not prematurely invalidate thread handle. 2011-01-14 21:07:56 +00:00
RegisterContext.cpp Put more smarts into the RegisterContext base class. Now the base class has 2011-01-09 21:07:35 +00:00
SectionLoadList.cpp RegisterContextLLDB.cpp (InitializeNonZerothFrame): If we get a 2010-12-22 02:02:45 +00:00
StackFrame.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
StackFrameList.cpp Fixed issues with RegisterContext classes and the subclasses. There was 2011-01-06 22:15:06 +00:00
StackID.cpp
StopInfo.cpp Added the ability to get more information on the SBThread's stop reason 2010-11-18 18:52:36 +00:00
Target.cpp Implemented a major overhaul of the way variables are handled 2011-01-13 08:53:35 +00:00
TargetList.cpp Fixed up the error message for when a file is not supported. 2010-12-08 04:55:11 +00:00
Thread.cpp Added the following functions to SBThread to allow threads to be suspended when a process is resumed: 2011-01-12 02:25:42 +00:00
ThreadList.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
ThreadPlan.cpp Fixed issues with RegisterContext classes and the subclasses. There was 2011-01-06 22:15:06 +00:00
ThreadPlanBase.cpp The thread plan destructors may call Thread virtual methods. That means they have to get cleaned up in the derived class's destructor. Make sure that happens. 2010-11-18 02:47:07 +00:00
ThreadPlanCallFunction.cpp Fixed issues with RegisterContext classes and the subclasses. There was 2011-01-06 22:15:06 +00:00
ThreadPlanCallUserExpression.cpp Added support for generating expressions that have 2010-12-13 22:46:15 +00:00
ThreadPlanRunToAddress.cpp Moved the code in ClangUserExpression that set up & ran the thread plan with timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming. 2010-11-30 02:22:11 +00:00
ThreadPlanShouldStopHere.cpp
ThreadPlanStepInRange.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
ThreadPlanStepInstruction.cpp Add ThreadPlanTracer class to allow instruction step tracing of execution. 2010-11-11 19:26:09 +00:00
ThreadPlanStepOut.cpp Add ThreadPlanTracer class to allow instruction step tracing of execution. 2010-11-11 19:26:09 +00:00
ThreadPlanStepOverBreakpoint.cpp Add ThreadPlanTracer class to allow instruction step tracing of execution. 2010-11-11 19:26:09 +00:00
ThreadPlanStepOverRange.cpp Modified all logging calls to hand out shared pointers to make sure we 2010-11-06 01:53:30 +00:00
ThreadPlanStepRange.cpp Add ThreadPlanTracer class to allow instruction step tracing of execution. 2010-11-11 19:26:09 +00:00
ThreadPlanStepThrough.cpp Add ThreadPlanTracer class to allow instruction step tracing of execution. 2010-11-11 19:26:09 +00:00
ThreadPlanStepUntil.cpp Add ThreadPlanTracer class to allow instruction step tracing of execution. 2010-11-11 19:26:09 +00:00
ThreadPlanTestCondition.cpp Modified LLDB expressions to not have to JIT and run code just to see variable 2010-12-14 02:59:59 +00:00
ThreadPlanTracer.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
ThreadSpec.cpp Fixed an error where the thread index was being returned as zero in "uint32_t SBBreakpoint::GetThreadIndex() const" even when it isn't specified. It should be UINT32_MAX to indicate there is no thread index set for the breakpoint (the breakpoint isn't thread specific). Also fixed the ThreadSpec.cpp to use UINT32_MAX instead of -1. Fixed the logging Printf statement in "uint32_t SBBreakpoint::GetThreadIndex() const" to not print the address of the "index" function from <string.h>! 2010-12-15 20:50:06 +00:00
UnixSignals.cpp Change the default signal setting for SIBABRT to SUPPRESS the signal. Why? 2011-01-10 03:47:25 +00:00