hanchenye-llvm-project/lldb/test
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
..
abbreviation_tests Modify the test case to run under ['gcc', 'llvm-gcc', 'clang'] x ['x86_64', 'i386'] 2010-12-15 00:58:49 +00:00
alias_tests Add test cases to test various aspect of the 'alias' command. 2010-12-15 19:04:51 +00:00
array_types Modify test cases to accomodate Python API change: 2010-12-14 18:59:15 +00:00
attic Move two files to the 'attic'. 2010-10-05 00:08:08 +00:00
bitfields Modify test cases to accomodate Python API change: 2010-12-14 18:59:15 +00:00
breakpoint_command Modify one assertion message. 2010-12-22 19:23:44 +00:00
breakpoint_conditions No need to pass an empty string as an arg or as an env string to the SBTarget.LaunchProcess() API. 2010-12-22 22:56:19 +00:00
breakpoint_ignore_count No need to pass an empty string as an arg or as an env string to the SBTarget.LaunchProcess() API. 2010-12-22 22:56:19 +00:00
breakpoint_locations Fix wrong test logic with regard to hit count and resolved status of disabled/enabled breakpoints. 2010-10-20 17:26:59 +00:00
class_static Modify test cases to accomodate Python API change: 2010-12-14 18:59:15 +00:00
class_types 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
command_source Changed the test case class names to be noun-like instead of verb-like. 2010-09-01 19:59:58 +00:00
conditional_break Simplify the breakpoint command function. Instead of fetching the command interpreter 2010-12-22 20:36:29 +00:00
dead-strip The StateType representation has been changed. Modify the test cases to accommodate. 2010-10-18 15:44:42 +00:00
enum_types The StateType representation has been changed. Modify the test cases to accommodate. 2010-10-18 15:44:42 +00:00
example Changed the test case class names to be noun-like instead of verb-like. 2010-09-01 19:59:58 +00:00
expression_command Change the golden output so that merely evaluating an existing persistent variable 2010-12-14 17:48:26 +00:00
forward Fixed the "expression" command object to use the StackFrame::GetValueForExpressionPath() 2010-12-15 05:08:08 +00:00
foundation Add an expression command: 2011-01-14 19:19:30 +00:00
function_types The StateType representation has been changed. Modify the test cases to accommodate. 2010-10-18 15:44:42 +00:00
global_variables Add test sequences for 'frame variable' address-of operator and 'frame variable' fully-qualified name variable. 2010-11-15 18:27:57 +00:00
hello_world Add @python_api_test decorator to the remaining Test*.py files. 2010-12-10 01:21:27 +00:00
help Print out a more meaningful exception message when/if CFBundleVersion matching failed. 2011-01-07 00:17:44 +00:00
inlined_breakpoints Add a test case for a bug fixed: 2010-11-02 19:46:35 +00:00
inlines Converted to Makefile.rules. 2010-08-24 20:54:26 +00:00
load_unload Execute the test case teardown hooks in a LIFO (last in, first out) order. 2010-12-14 23:13:03 +00:00
macosx/universal Remove @expectedFailure decorator as the bug has been fixed. 2010-12-01 23:15:58 +00:00
make Add makefile debugging rule for printing out the value of a variable. 2011-01-14 21:18:12 +00:00
namespace Uncomment the two failed 'expression' commands regarding fully qualified namespace variables. 2010-12-23 23:26:05 +00:00
objc Converted to use Makefile.rules. 2011-01-14 21:55:29 +00:00
objc-stepping Fix typo of the test method name. 2011-01-03 20:40:08 +00:00
order Fix wrong test logic -- should pass "-s address" option to "image dump symtab" 2010-12-17 18:02:08 +00:00
plugins Make the string matching for 'frame variable' more stringent with respect to 2010-11-17 00:52:41 +00:00
print-obj
python_api Fix wrong test case in main.c. Oops! 2011-01-10 17:44:08 +00:00
recurse Added a recursive loop stress test for the unwinder. Not a real world test 2011-01-07 22:10:25 +00:00
set_values Remove comment no longer applied. 2010-12-07 20:22:32 +00:00
settings Change the test case test_set_prompt() to no longer require quotes around lldb2 in: 2010-12-20 21:29:34 +00:00
signal 'thread backtrace', not 'thread backtrac'. 2010-12-07 17:10:46 +00:00
signed_types Add TestSignedTypes.py to test that variables with signed types display correctly. 2010-11-19 20:35:15 +00:00
source-manager Make the test case SourceManagerTestCase.display_source_python stronger by also 2010-12-13 18:59:27 +00:00
stl The StateType representation has been changed. Modify the test cases to accommodate. 2010-10-18 15:44:42 +00:00
struct_types Make calling the super class's setUp() method less fragile. 2010-10-14 17:31:24 +00:00
threads For SBTarget.Launch()/LaunchProcess(), there's no need to pass an empty string 2010-12-08 01:25:21 +00:00
types On second thought, inserting a delay of 1.0 second slows down the test suite 2010-12-02 18:03:37 +00:00
unittest2 o Added unittest2 which has added the new features in unittest for Python 2.7 2010-08-05 23:42:46 +00:00
unsigned_types The StateType representation has been changed. Modify the test cases to accommodate. 2010-10-18 15:44:42 +00:00
Makefile
README-TestSuite Move two files to the 'attic'. 2010-10-05 00:08:08 +00:00
blacklist.py Blacklisted testclass STLTestCase for a known crasher <rdar://problem/8837118>. 2011-01-08 01:37:33 +00:00
dotest.py Properly indent the short description of the test case to make it align with the 2011-01-05 22:50:11 +00:00
lldbtest.py Add a test case for the SBFrame APIs. In particular, it uses the frame API to 2010-12-23 01:12:19 +00:00
lldbutil.py Add more docstring for the lldb_iter() utility function which provides a compact 2010-12-08 19:19:08 +00:00