Commit Graph

573 Commits

Author SHA1 Message Date
Johnny Chen 93b0c8b2aa Remove the expectedFailure decorator for the fixed bug:
rdar://problem/8435794
    settings set target.process.output-path does not seem to work

Also change the test case from test_set_output_path to test_set_error_output_path
as it now exercises both setting target.process.error-path and target.process.output-path.

llvm-svn: 124198
2011-01-25 17:39:43 +00:00
Johnny Chen 109941b078 Fix wrong order of "import lldbutil" statement and its usage in the failure case.
llvm-svn: 124196
2011-01-25 17:17:45 +00:00
Greg Clayton 6f907e69e9 Deprecated old forms of SBTarget::Launch. There is not just one and no
SWIG renaming done to work around deprecated APIs.

llvm-svn: 124075
2011-01-23 17:46:22 +00:00
Johnny Chen 661ba65dd8 Add test cases for the scenario of selecting a frame index while stopped, and
then doing a thread step-out.  This should lead us to the caller frame of the
frame we just selected.

llvm-svn: 123984
2011-01-21 18:23:16 +00:00
Johnny Chen af5fe69860 Remove the expectedFailure decorators. The bug:
rdar://problem/8875425 Found mySource->isa local variable assertion failed

has been fixed.

llvm-svn: 123924
2011-01-20 17:40:51 +00:00
Johnny Chen 2a67aa721f Add the cmdline to invoke the Python profile reporting module.
llvm-svn: 123844
2011-01-19 19:48:29 +00:00
Johnny Chen f249090d7b Print out the command line used to invoke the test suite so I don't get confused
since different options can affect the run time.

llvm-svn: 123843
2011-01-19 19:31:46 +00:00
Johnny Chen d2047fa6af Fix a typo in the comment.
llvm-svn: 123840
2011-01-19 18:18:47 +00:00
Johnny Chen 30775d0107 Added special logic to faciliate profiling the test suite run with the cProfile.py
module.

On my MBP running SnowLeopard:

$ DOTEST_PROFILE=YES DOTEST_SCRIPT_DIR=/Volumes/data/lldb/svn/trunk/test /System/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/cProfile.py -o my.profile ./dotest.py -v -w 2> ~/Developer/Log/lldbtest.log

After that, I used the pstats.py module to browse the statistics recorded in the my.profile file. 

llvm-svn: 123807
2011-01-19 02:10:40 +00:00
Johnny Chen cf7f74e31c The test suite was unnecessarily doing a time.sleep() after performing the
"process launch" or "run" interpreter command.  Let's do the sleep only if
the process launch failed.  This saves about 135 seconds from the whole test
suite run time.

llvm-svn: 123806
2011-01-19 02:02:08 +00:00
Johnny Chen d077e4595c Decorated two new expected failures:
rdar://problem/8875425 Found mySource->isa local variable assertion failed

llvm-svn: 123792
2011-01-19 00:31:52 +00:00
Johnny Chen 07b289221f Terminate the current process being debugged.
The test framework was relying on detecting either "run" or
"process launch" command to automatically kill the inferior.

llvm-svn: 123683
2011-01-17 22:35:39 +00:00
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
Johnny Chen ded0a2c05a Converted to use Makefile.rules.
llvm-svn: 123471
2011-01-14 21:55:29 +00:00
Johnny Chen fa38041dac Add makefile debugging rule for printing out the value of a variable.
From http://blog.melski.net/tag/debugging-makefiles/.

Example:

[13:14:59] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-CC
CC=gcc
  origin = file
  flavor = recursive
   value = gcc
[13:15:09] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-LD
LD=  g++
  origin = file
  flavor = recursive
   value = $(call cxx_linker,$(CC))
[13:15:21] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-CXX
CXX=  g++
  origin = file
  flavor = recursive
   value = $(call cxx_compiler,$(CC))
[13:15:29] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $

llvm-svn: 123469
2011-01-14 21:18:12 +00:00
Johnny Chen 6055b44b04 Added comments.
llvm-svn: 123463
2011-01-14 20:55:13 +00:00
Johnny Chen d43e208bb4 Make CC defaults to gcc. The cxx_compiler and cxx_linker functions rely on substituting "g++"
for "gcc".

llvm-svn: 123461
2011-01-14 20:46:49 +00:00
Johnny Chen 15a42aefa4 Add an expression command:
expression (int)[nil_mutable_array count]

within NSArray_expr() function and expect a return of 0.

llvm-svn: 123454
2011-01-14 19:19:30 +00:00
Johnny Chen bdb4efcf17 The cxx_compiler function should not blindly return clang++ as the C++ compiler if $(CC) contains "clang".
Instead, it should perform a textual replacement of $(CC) from "clang" to "clang++".  The same is true
for "llvm-gcc" to "llvm-g++" and for "gcc" to "g++".  This way, we keep the path component of the $(CC)
passed in from the user and do not end up with a mixed toolchains with different paths.

Ditto for a newly added function called cxx_linker.

llvm-svn: 123451
2011-01-14 18:19:53 +00:00
Greg Clayton ca512b397c Fixed an error in the type map for "char **" that was a bad memory smasher.
Anytime we had a valid python list that was trying to go from Python down into
our C++ API, it was allocating too little memory and it ended up smashing
whatever was next to the allocated memory.

Added typemap conversions for "void *, size_t" so we can get 
SBProcess::ReadMemory() working. Also added a typemap for "const void *, size_t"
so we can get SBProcess::WriteMemory() to work.

Fixed an issue in the DWARF parser where we weren't correctly calculating the
DeclContext for all types and classes. We now should be a lot more accurate.
Fixes include: enums should now be setting their parent decl context correctly.
We saw a lot of examples where enums in classes were not being properly
namespace scoped. Also, classes within classes now get properly scoped.

Fixed the objective C runtime pointer checkers to let "nil" pointers through
since these are accepted by compiled code. We also now don't call "abort()"
when a pointer doesn't validate correctly since this was wreaking havoc on
the process due to the way abort() works. We now just dereference memory
which should give us an exception from which we can easily and reliably 
recover.

llvm-svn: 123428
2011-01-14 04:54:56 +00:00
Johnny Chen 7ad4ac47ca Fix wrong test case in main.c. Oops!
llvm-svn: 123181
2011-01-10 17:44:08 +00:00
Johnny Chen d32110895b Blacklisted testclass STLTestCase for a known crasher <rdar://problem/8837118>.
llvm-svn: 123049
2011-01-08 01:37:33 +00:00
Greg Clayton 46595b9ae2 Added a recursive loop stress test for the unwinder. Not a real world test
by any means, but something to stress test our unwinder with 260,000+ frames
on a standard darwin thread.

llvm-svn: 123037
2011-01-07 22:10:25 +00:00
Johnny Chen 117ff9005c Modify disassemble_call_stack_python() to not rely on the "disassemble -n function_name"
command to do the disassembly.  Instead, use the Python API.

llvm-svn: 123029
2011-01-07 20:34:32 +00:00
Johnny Chen b13ee84c26 Print out a more meaningful exception message when/if CFBundleVersion matching failed.
llvm-svn: 122985
2011-01-07 00:17:44 +00:00
Johnny Chen 849398910f Modify test_help_version() test case to be more precise in matching the version
number string as found in the resources/LLDB-info.plist file.

llvm-svn: 122930
2011-01-06 00:03:01 +00:00
Johnny Chen 64e3868cf0 Properly indent the short description of the test case to make it align with the
previously added ordinal number of the currently running test case.

llvm-svn: 122922
2011-01-05 22:50:11 +00:00
Johnny Chen 77c81d3ee7 Enhance the test framework to be able to emit a counter value in verbose mode
describing the ordinal number of the currently running test case.

llvm-svn: 122901
2011-01-05 20:24:11 +00:00
Johnny Chen c77e5b2f44 Fix typo of the test method name.
llvm-svn: 122770
2011-01-03 20:40:08 +00:00
Johnny Chen 9ebe1724e3 Updated comment.
llvm-svn: 122767
2011-01-03 19:55:37 +00:00
Johnny Chen d71ffbcb24 Uncomment the two failed 'expression' commands regarding fully qualified namespace variables.
And decorate the test cases as @expectedFailure.

llvm-svn: 122525
2010-12-23 23:26:05 +00:00
Johnny Chen 31c39dac6d Add a simple command: 'version' to the command interpreter, and an accompanying
test case test_help_version().

llvm-svn: 122515
2010-12-23 20:21:44 +00:00
Johnny Chen d5f66fcbac Add a test case for the SBFrame APIs. In particular, it uses the frame API to
get the argument values of the call stacks when stopped on the breakpoint.

Radar has been filed for the expected failures:
test failure: ./dotest.py -v -w -t -p TestFrames (argument values are wrong)

llvm-svn: 122460
2010-12-23 01:12:19 +00:00
Johnny Chen cdbe594841 No need to pass an empty string as an arg or as an env string to the SBTarget.LaunchProcess() API.
llvm-svn: 122450
2010-12-22 22:56:19 +00:00
Johnny Chen 858718a9e2 Simplify the breakpoint command function. Instead of fetching the command interpreter
and run the "process continue" command, use the SBProcess.Continue() API.

llvm-svn: 122434
2010-12-22 20:36:29 +00:00
Johnny Chen 73f7fa82e5 Modify one assertion message.
llvm-svn: 122428
2010-12-22 19:23:44 +00:00
Johnny Chen 77c4697735 Fix some typos in the docstrings and also update the test method names.
llvm-svn: 122382
2010-12-22 00:56:47 +00:00
Johnny Chen f2df189b72 Add test cases for registering a listener object with the broadcaster of a process
and waiting for two expected state changed events to arrive: "running" followed by
"stopped".

llvm-svn: 122380
2010-12-22 00:32:54 +00:00
Johnny Chen 3635eae697 Rename the test methods to be more meaningful.
llvm-svn: 122352
2010-12-21 19:52:54 +00:00
Johnny Chen 4f8caab924 Set the debugger to asynchronous mode before using the Python API call to kill
the process.  The custom thread started before this point is running in a loop
waiting for events to come.

llvm-svn: 122316
2010-12-21 05:43:37 +00:00
Johnny Chen 0b0c57806b Fix typo.
llvm-svn: 122306
2010-12-21 02:10:18 +00:00
Johnny Chen f667ab526b Added python_api/event/TestEvents.py to get the listener object associated with the
debugger and to exercise some event APIs.

llvm-svn: 122304
2010-12-21 02:06:56 +00:00
Johnny Chen 622220b66d Change the test case test_set_prompt() to no longer require quotes around lldb2 in:
# Set prompt to 'lldb2'.
   self.runCmd("settings set prompt lldb2")

llvm-svn: 122272
2010-12-20 21:29:34 +00:00
Johnny Chen 9633214507 Fix wrong test logic -- should pass "-s address" option to "image dump symtab"
in order to sort the output by address.

llvm-svn: 122071
2010-12-17 18:02:08 +00:00
Johnny Chen 62f68ee564 Use SBModule.GetDescription(SBStream) API to get the module description to match
against.

llvm-svn: 121989
2010-12-16 18:37:46 +00:00
Johnny Chen de442a6878 Update the comment section of blacklist.py with the command line to reproduce the crash.
llvm-svn: 121986
2010-12-16 18:10:16 +00:00
Johnny Chen 6becf1c924 Add python_api/symbol-context to test getting the symbol context while stopped
on a frame and to exercise the methods of SBSymbolContext.

llvm-svn: 121941
2010-12-16 01:41:37 +00:00
Johnny Chen 8e74416cd5 Fix one of the golden output of "frame variable -t *self" to be:
"(MyString) *self"

llvm-svn: 121907
2010-12-15 22:50:54 +00:00
Johnny Chen 763d1a17a1 Fix typos in SBBreakpoint::GetThreadIndex()/GetThreadName(), and test sequences
for the two API calls.

llvm-svn: 121898
2010-12-15 21:39:37 +00:00
Jim Ingham 5949cfe11b Added a test for finding the correct values for ivars when a property causes the ivar offsets
in the DWARF to be incorrect.

llvm-svn: 121894
2010-12-15 20:47:34 +00:00