Commit Graph

1517 Commits

Author SHA1 Message Date
Sean Callanan dfc066d274 Forgo the selector test on i386, where we can't
test whether an object responds to a selector
from outside the process.

llvm-svn: 155504
2012-04-24 23:31:54 +00:00
Sean Callanan 72546f01d3 Create an NSAutoreleasePool correctly in a test
case so that the Objective-C runtime doesn't
complain about lack of one, causing the test case
to fail.

llvm-svn: 155503
2012-04-24 23:18:47 +00:00
Johnny Chen 8da4ddf990 Add a suffix rule for compiling objc++ files and a sample directory under test/lang/objcxx.
llvm-svn: 155501
2012-04-24 23:05:07 +00:00
Johnny Chen 8f198c96fd Add a '-R' option, which is similar to '-r', except that the relocated directory, if exists, will be removed entirely
before running the test suite.  A usage example looks like this:

test $ ./dotest.py -A x86_64 -R /tmp/x86_64 &
test $ ./dotest.py -A i386 -R /tmp/i386 &

where we would want to run the x86_64 and i386 archs concurrently but relocate the test suite to different directory
hierarchies in order not to stump on each other's intermediate files.

llvm-svn: 155491
2012-04-24 21:44:10 +00:00
Enrico Granata fe945e83e0 Fixing the test case so that it runs correctly on i386 as well as on x86_64
llvm-svn: 155420
2012-04-24 02:01:17 +00:00
Enrico Granata f1dfbad036 Removing the @expectedFailurei386 decorator from test cases that now work as a result of the latest changes to Value.cpp
llvm-svn: 155419
2012-04-24 01:45:19 +00:00
Johnny Chen 7debd16c95 Test file renaming.
llvm-svn: 155369
2012-04-23 17:54:40 +00:00
Johnny Chen 910667004f Remove the expectedFailure decorator as the bug has been fixed.
llvm-svn: 155264
2012-04-21 01:02:50 +00:00
Jim Ingham 6d66ce67d7 Make sure the "synchronous breakpoint callbacks" get called before the thread plan logic gets invoked, and if they
ask to continue that should short-circuit the thread plans for that thread.  Also add a bit more explanation for
how this machinery is supposed to work.  
Also pass eExecutionPolicyOnlyWhenNeeded, not eExecutionPolicyAlways when evaluating the expression for breakpoint
conditions.

llvm-svn: 155236
2012-04-20 21:16:56 +00:00
Johnny Chen 6acfb690b5 Tests decorated with @benchmarks_test do not participate in the remote-macosx test suite run.
But, still, tearDown() should call super.tearDown(), not super.setUp(). :-)

llvm-svn: 155170
2012-04-19 23:50:00 +00:00
Johnny Chen c9cb71a0b3 LLDB test suite should also output the config info string along with the stack trace.
rdar://problem/11283401

Example:

Collected 1 test

1: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function. ... FAIL

======================================================================
FAIL: test_with_dwarf (TestCallStdStringFunction.ExprCommandCallFunctionTestCase)
   Test calling std::String member function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 427, in wrapper
    return func(self, *args, **kwargs)
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 34, in test_with_dwarf
    self.call_function()
  File "/Volumes/data/lldb/svn/ToT/test/expression_command/call-function/TestCallStdStringFunction.py", line 48, in call_function
    substrs = ['Hello world'])
  File "/Volumes/data/lldb/svn/ToT/test/lldbtest.py", line 1235, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'Hello world' returns expected result
Config=i386-clang
----------------------------------------------------------------------
Ran 1 test in 1.148s

FAILED (failures=1)

llvm-svn: 155157
2012-04-19 21:33:55 +00:00
Johnny Chen 39b8c3567a Simplify the progress bar display when neither "-v" nor "-t" is passed to the test driver.
llvm-svn: 155152
2012-04-19 20:09:44 +00:00
Johnny Chen 92f162a798 The session file name should be tagged with (architecture, compiler) in addition
to the already existing (test result, test id) to avoid collision and to
facilitate postmortem analysis.

llvm-svn: 155148
2012-04-19 19:39:11 +00:00
Johnny Chen 4fdc339db5 Not a test failure for i386; instead, the test case should be modified to not over-expect type fields for the synthetic childs.
rdar://problem/11277013

llvm-svn: 155144
2012-04-19 18:36:11 +00:00
Johnny Chen 61f305cdb8 Add expected failure decorators for test cases which are failing for i386 architecture.
Plus fix some test cases to skip/succeed for i386.

llvm-svn: 155087
2012-04-19 01:07:54 +00:00
Johnny Chen 44d2497138 Add the capability of supplying the pre/post-flight functions to the test suite such that
the pre-flight code gets executed during setUp() after the debugger instance is available
and the post-flight code gets executed during tearDown() after the debugger instance has
done killing the inferior and deleting all the target programs.

Example:

[11:32:48] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight  functionalities/watchpoint/hello_watchpoint
config: {'pre_flight': <function pre_flight at 0x1098541b8>, 'post_flight': <function post_flight at 0x109854230>}
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-139
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154753
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154730
Last Changed Date: 2012-04-13 18:42:46 -0700 (Fri, 13 Apr 2012)


lldb.pre_flight: def pre_flight(test):
    __import__("lldb")
    __import__("lldbtest")
    print "\nRunning pre-flight function:"
    print "for test case:", test

lldb.post_flight: def post_flight(test):
    __import__("lldb")
    __import__("lldbtest")
    print "\nRunning post-flight function:"
    print "for test case:", test


Session logs for test failures/errors/unexpected successes will go into directory '2012-04-16-11_34_08'
Command invoked: python ./dotest.py -A x86_64 -v -c ../examples/test/.lldb-pre-post-flight functionalities/watchpoint/hello_watchpoint
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... 
Running pre-flight function:
for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)

Running post-flight function:
for test case: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
ok
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... 
Running pre-flight function:
for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)

Running post-flight function:
for test case: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
ok

----------------------------------------------------------------------
Ran 2 tests in 1.584s

OK

llvm-svn: 154847
2012-04-16 18:55:15 +00:00
Johnny Chen 9a27713a74 First step to make the test suite runnable for remote platforms.
For the types directory, we were running lldbtest.system() to execute the compiled program
on the test host to collect golden output in order to compare with the output of various
lldb debugger commands as performed later.  This won't work for the remote platform
scenario where the architecture of the target and host platforms are different.

Modify the AbstractBase class to use lldb to launch the inferior while specifying the
output file, from which the golden output is collected and grokked.  How to bootstrap and
to connect to the remote platform is still being worked at.

llvm-svn: 154699
2012-04-13 20:40:52 +00:00
Johnny Chen 18104239b4 Ditto 'requires modern objc runtime' for TestRealDefinition.py -- fix test suite errors for i386.
llvm-svn: 154638
2012-04-13 00:23:26 +00:00
Johnny Chen 97ccf9f3b2 Ditto 'requires modern objc runtime' for TestObjCProperty.py -- fix test suite errors for i386.
llvm-svn: 154636
2012-04-13 00:18:17 +00:00
Johnny Chen 45872c01ff Fix some test suite errors. TestForwardDecl.py errors were due to bad Makefile.rules, while TestHiddenIvars.py errors due to features only available in modern objc runtime.
llvm-svn: 154635
2012-04-13 00:13:35 +00:00
Johnny Chen b127f00b51 Make the default architectures to run as both 64 and 32-bit.
rdar://problem/11031264

llvm-svn: 154573
2012-04-12 00:55:57 +00:00
Sean Callanan d13c23c393 Changed some tabs to spaces to make Python like
this file.

llvm-svn: 154222
2012-04-06 23:02:44 +00:00
Johnny Chen 7bba2c6d64 The final batch of adding @dsym_test/@dwarf_test decorators.
llvm-svn: 154211
2012-04-06 21:33:58 +00:00
Johnny Chen 24086bc93b Second batch of adding @dsym_test/@dwarf_test decorators to existing test cases.
Plus some minor cleanup of test method names.
Third and final batch is coming.

llvm-svn: 154197
2012-04-06 19:54:10 +00:00
Johnny Chen f1548d4f74 Add a new option to the test driver, -N dsym or -N dwarf, in order to exclude tests decorated with
either @dsym_test or @dwarf_test to be executed during the testsuite run.  There are still lots of
Test*.py files which have not been decorated with the new decorator.

An example:

# From TestMyFirstWatchpoint.py ->
class HelloWatchpointTestCase(TestBase):

    mydir = os.path.join("functionalities", "watchpoint", "hello_watchpoint")

    @dsym_test
    def test_hello_watchpoint_with_dsym_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDsym(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()

    @dwarf_test
    def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
        """Test a simple sequence of watchpoint creation and watchpoint hit."""
        self.buildDwarf(dictionary=self.d)
        self.setTearDownCleanup(dictionary=self.d)
        self.hello_watchpoint()


# Invocation ->
[17:50:14] johnny:/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-137
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 154133
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 154109
Last Changed Date: 2012-04-05 10:43:02 -0700 (Thu, 05 Apr 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-04-05-17_50_49'
Command invoked: python ./dotest.py -N dsym -v -p TestMyFirstWatchpoint.py
compilers=['clang']

Configuration: arch=x86_64 compiler=clang
----------------------------------------------------------------------
Collected 2 tests

1: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... skipped 'dsym tests'
2: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
   Test a simple sequence of watchpoint creation and watchpoint hit. ... ok

----------------------------------------------------------------------
Ran 2 tests in 1.138s

OK (skipped=1)
Session logs for test failures/errors/unexpected successes can be found in directory '2012-04-05-17_50_49'
[17:50:50] johnny:/Volumes/data/lldb/svn/ToT/test $ 

llvm-svn: 154154
2012-04-06 00:56:05 +00:00
Greg Clayton 7fdf9ef15d Added a new Host class: ReadWriteLock
This abstracts read/write locks on the current host system. It is currently backed by pthread_rwlock_t objects so it should work on all unix systems.

We also need a way to control multi-threaded access to the process through the public API when it is running. For example it isn't a good idea to try and get stack frames while the process is running. To implement this, the lldb_private::Process class now contains a ReadWriteLock member variable named m_run_lock which is used to control the public process state. The public process state represents the state of the process as the client knows it. The private is used to control the actual current process state. So the public state of the process can be stopped, yet the private state can be running when evaluating an expression for example. 

Adding the read/write lock where readers are clients that want the process to stay stopped, and writers are clients that run the process, allows us to accurately control multi-threaded access to the process.

Switched the SBThread and SBFrame over to us shared pointers to the ExecutionContextRef class instead of making their own class to track this. This fixed an issue with assigning on SBFrame to another and will also centralize the code that tracks weak references to execution context objects into one location.

llvm-svn: 154099
2012-04-05 16:12:35 +00:00
Enrico Granata 8d4a8010cf Adding a new --python-function (-F) option to breakpoint command add. The option allows the user to specify a Python function name instead of a Python oneliner or interactive script input as a breakpoint command
llvm-svn: 154026
2012-04-04 17:30:31 +00:00
Johnny Chen b58337cd45 Add a Test case to make sure that __apple_types section does get produced by dsymutil.
This is supposed to succeed even with rdar://problem/11166975.

llvm-svn: 153919
2012-04-03 01:07:24 +00:00
Johnny Chen 1b8af41116 Add some more debug prints and retrieve the debug subsections from the DWARF section.
llvm-svn: 153915
2012-04-03 00:41:25 +00:00
Johnny Chen d6fbc8ff66 Add testcase that verifies that __apple_types is a valid section in a .o file generated by clang.
rdar://problem/11167268

llvm-svn: 153891
2012-04-02 19:46:14 +00:00
Enrico Granata 7f3296a6e1 Disabling blocks support because of rdar://problem/11024417 - This is hopefully just a temporary countermeasure
llvm-svn: 153758
2012-03-30 16:58:37 +00:00
Enrico Granata 86ea8d821a Fixing an issue where Unicode characters in an NSString were printed as escape sequences by the summary provider shipping with LLDB - Added relevant test case code. Bonus points for identifying the source of the quotes :-)
llvm-svn: 153624
2012-03-29 01:34:34 +00:00
Enrico Granata 770eb05aa5 Fixing an issue where saying 'po foo' made both the summary and the description for foo come out. If one is po'ing something they most probably only care about the description - We will not omit the summary
llvm-svn: 153608
2012-03-28 22:17:37 +00:00
Enrico Granata bf70ee97b1 adding a summary for Objective-C type 'Class'
llvm-svn: 153541
2012-03-27 21:49:20 +00:00
Enrico Granata c5bc412cf6 Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching

llvm-svn: 153495
2012-03-27 02:35:13 +00:00
Greg Clayton 84db9105d2 <rdar://problem/11113279>
Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 

This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.

This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.

llvm-svn: 153482
2012-03-26 23:03:23 +00:00
Eric Christopher ffe318dbb3 Fix method name for output.
llvm-svn: 153416
2012-03-25 19:30:08 +00:00
Enrico Granata 86027e954c Adding a new API call IsTypeComplete() to SBType. This call is meant to check if the type has been previously completed or not (which is mostly interesting from a performance point of view)
Adding a test case that checks that we do not complete types before due time. This should help us track cases similar to the cascading data formatters.

llvm-svn: 153363
2012-03-24 01:11:14 +00:00
Enrico Granata 4a3274af96 Removing cascading through inheritance chains for data formatters
This is the feature that allowed the user to have things like:

class Base { ... };
class Derived : public Base { ... };

and have formatters defined for Base work automatically for Derived.

This feature turned out to be too expensive since it requires completing types.

This patch takes care of removing cascading (other than typedefs chain cascading), updating the test suite accordingly, and adding required Cocoa class names to keep the AppKit formatters working

llvm-svn: 153272
2012-03-22 19:55:55 +00:00
Johnny Chen fd4177d9fd Check in main.c modified for testing hardware watchpoints on arm architectures.
llvm-svn: 153268
2012-03-22 18:51:59 +00:00
Johnny Chen e344486e63 Add a '-E' option to the test driver for the purpose of specifying some extra CFLAGS
to pass to the toolchain in order to build the inferior programs to be run/debugged
duirng the test suite.  The architecture might dictate some special CFLAGS which are
more easily specified in a central place (like the command line) instead of inside
make rules.

For Example,

./dotest.py -v -r /shared/phone -A armv7 -E "-isysroot your_sdk_root" functionalities/watchpoint/hello_watchpoint

will relocate the particular test directory ('functionalities/watchpoint/hello_watchpoint' in this case) to a
new directory named '/shared/phone'.  The particular incarnation of the architecture-compiler combination of the
test support files are therefore to be found under:

/shared/phone.arch=armv7-compiler=clang/functionalities/watchpoint/hello_watchpoint

The building of the inferior programs under testing is now working.

The actual launching/debugging of the inferior programs are not yet working,
neither is the setting of a watchpoint on the phone.

llvm-svn: 153070
2012-03-20 00:33:51 +00:00
Enrico Granata 86cc982974 Massive enumeration name changes: a number of enums in ValueObject were not following the naming pattern
Changes to synthetic children:
 - the update(self): function can now (optionally) return a value - if it returns boolean value True, ValueObjectSyntheticFilter will not clear its caches across stop-points
   this should allow better performance for Python-based synthetic children when one can be sure that the child ValueObjects have not changed
 - making a difference between a synthetic VO and a VO with a synthetic value: now a ValueObjectSyntheticFilter will not return itself as its own synthetic value, but will (correctly)
   claim to itself be synthetic
 - cleared up the internal synthetic children architecture to make a more consistent use of pointers and references instead of shared pointers when possible
 - major cleanup of unnecessary #include, data and functions in ValueObjectSyntheticFilter itself
 - removed the SyntheticValueType enum and replaced it with a plain boolean (to which it was equivalent in the first place)
Some clean ups to the summary generation code
Centralized the code that clears out user-visible strings and data in ValueObject
More efficient summaries for libc++ containers

llvm-svn: 153061
2012-03-19 22:58:49 +00:00
Johnny Chen 1b72f09150 Export the APIs submitted by Dawn to the Python bindings. Add a simple test case for the SBModule.compile_unit_iter() API.
llvm-svn: 152952
2012-03-16 21:55:42 +00:00
Johnny Chen 531c085815 Fix a bug in getRunOptions() where there was no space between the arch spec and the compiler spec.
llvm-svn: 152941
2012-03-16 20:44:00 +00:00
Johnny Chen 3bc8ae4014 Add a test case to go with <rdar://problem/11052829> and svn check-in r152809.
llvm-svn: 152825
2012-03-15 19:10:00 +00:00
Johnny Chen f087c8255e Add test case associated with:
rdar://problem/11034702

For the time being, skip the relevant disassemble action which resulted in a crash.

Minor modification (print out format) to the existing TestDisassembleRawBytes.py test file.

llvm-svn: 152822
2012-03-15 18:23:59 +00:00
Johnny Chen 24b5b8b7b8 Remove a debug statement.
llvm-svn: 152732
2012-03-14 18:35:38 +00:00
Enrico Granata 8c69c96dc9 Changed several of the Cocoa formatters to match the output style that Xcode uses internally to provide summaries
This has been done for those summaries where the difference is only cosmetic (e.g. naming things as items instead of values, ...)
The LLDB output style has been preserved when it provides more information (e.g. telling the type as well as the value of an NSNumber)

Test cases have been updated to reflect the updated output style where necessary

llvm-svn: 152592
2012-03-13 00:25:59 +00:00
Enrico Granata c7f873064b Added formatters for libc++ (http://libcxx.llvm.org):
std::string has a summary provider
 std::vector std::list and std::map have both a summary and a synthetic children provider
Given the usage of a custom namespace (std::__1::classname) for the implementation of libc++, we keep both libstdcpp and libc++ formatters enabled at the same time since that raises no conflicts and enabled for seamless transition between the two
The formatters for libc++ reside in a libcxx category, and are loaded from libcxx.py (to be found in examples/synthetic)

The formatters-stl test cases have been divided to be separate for libcxx and libstdcpp. This separation is necessary because
 (a) we need different compiler flags for libc++ than for libstdcpp
 (b) libc++ inlines a lot more than libstdcpp and some code changes were required to accommodate this difference

llvm-svn: 152570
2012-03-12 19:47:17 +00:00
Sean Callanan ddcda28fee Disabled the i386 tests pending fixes in the JIT.
llvm-svn: 152568
2012-03-12 18:54:10 +00:00
Johnny Chen 934c05d284 Add the capability on OS X to utilize 'xcrun' to locate the compilers used for building the inferior programs
to be debugged while running the test suite.  By default, compilers is set to ['clang'] and can be overridden
using the "-C compilerA^compilerB" option.

llvm-svn: 152367
2012-03-09 02:11:37 +00:00
Johnny Chen 5a9a9883be Change the test driver so that, by default, it takes into consideration of both 'x86_64' and 'i386' architectures
when building the inferior programs.

Example:

/Volumes/data/lldb/svn/ToT/test $ ./dotest.py -v functionalities/watchpoint
LLDB build dir: /Volumes/data/lldb/svn/ToT/build/Debug
LLDB-123
Path: /Volumes/data/lldb/svn/ToT
URL: https://johnny@llvm.org/svn/llvm-project/lldb/trunk
Repository Root: https://johnny@llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 152244
Node Kind: directory
Schedule: normal
Last Changed Author: gclayton
Last Changed Rev: 152244
Last Changed Date: 2012-03-07 13:03:09 -0800 (Wed, 07 Mar 2012)



Session logs for test failures/errors/unexpected successes will go into directory '2012-03-08-16_43_51'
Command invoked: python ./dotest.py -v functionalities/watchpoint

Configuration: arch=x86_64
----------------------------------------------------------------------
Collected 21 tests

 1: test_hello_watchlocation_with_dsym (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 2: test_hello_watchlocation_with_dwarf (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 3: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 4: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 5: test_watchpoint_multiple_threads_with_dsym (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 6: test_watchpoint_multiple_threads_with_dwarf (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 7: test_rw_disable_after_first_stop__with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 8: test_rw_disable_after_first_stop_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 9: test_rw_disable_then_enable_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
10: test_rw_disable_then_enable_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
11: test_rw_watchpoint_delete_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
12: test_rw_watchpoint_delete_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
13: test_rw_watchpoint_set_ignore_count_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
14: test_rw_watchpoint_set_ignore_count_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
15: test_rw_watchpoint_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
16: test_rw_watchpoint_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
17: test_watchpoint_cond_with_dsym (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
18: test_watchpoint_cond_with_dwarf (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
19: test_watchlocation_with_dsym_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
20: test_watchlocation_with_dwarf_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
21: test_error_cases_with_watchpoint_set (TestWatchpointSetErrorCases.WatchpointSetErrorTestCase)
    Test error cases with the 'watchpoint set' command. ... ok

----------------------------------------------------------------------
Ran 21 tests in 74.590s

OK

Configuration: arch=i386
----------------------------------------------------------------------
Collected 21 tests

 1: test_hello_watchlocation_with_dsym (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 2: test_hello_watchlocation_with_dwarf (TestWatchLocation.HelloWatchLocationTestCase)
    Test watching a location with '-x size' option. ... ok
 3: test_hello_watchpoint_with_dsym_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 4: test_hello_watchpoint_with_dwarf_using_watchpoint_set (TestMyFirstWatchpoint.HelloWatchpointTestCase)
    Test a simple sequence of watchpoint creation and watchpoint hit. ... ok
 5: test_watchpoint_multiple_threads_with_dsym (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 6: test_watchpoint_multiple_threads_with_dwarf (TestWatchpointMultipleThreads.WatchpointForMultipleThreadsTestCase)
    Test that lldb watchpoint works for multiple threads. ... ok
 7: test_rw_disable_after_first_stop__with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 8: test_rw_disable_after_first_stop_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint but disable it after the first stop. ... ok
 9: test_rw_disable_then_enable_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
10: test_rw_disable_then_enable_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint, disable initially, then enable it. ... ok
11: test_rw_watchpoint_delete_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
12: test_rw_watchpoint_delete_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test delete watchpoint and expect not to stop for watchpoint. ... ok
13: test_rw_watchpoint_set_ignore_count_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
14: test_rw_watchpoint_set_ignore_count_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test watchpoint ignore count and expect to not to stop at all. ... ok
15: test_rw_watchpoint_with_dsym (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
16: test_rw_watchpoint_with_dwarf (TestWatchpointCommands.WatchpointCommandsTestCase)
    Test read_write watchpoint and expect to stop two times. ... ok
17: test_watchpoint_cond_with_dsym (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
18: test_watchpoint_cond_with_dwarf (TestWatchpointConditionCmd.WatchpointConditionCmdTestCase)
    Test watchpoint condition. ... ok
19: test_watchlocation_with_dsym_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
20: test_watchlocation_with_dwarf_using_watchpoint_set (TestWatchLocationWithWatchSet.WatchLocationUsingWatchpointSetTestCase)
    Test watching a location with 'watchpoint set expression -w write -x size' option. ... ok
21: test_error_cases_with_watchpoint_set (TestWatchpointSetErrorCases.WatchpointSetErrorTestCase)
    Test error cases with the 'watchpoint set' command. ... ok

----------------------------------------------------------------------
Ran 21 tests in 67.059s

OK

llvm-svn: 152357
2012-03-09 00:44:59 +00:00
Sean Callanan 226b70c154 Updated the revision of LLVM/Clang used by LLDB.
This takes two important changes:

- Calling blocks is now supported.  You need to
  cast their return values, but that works fine.

- We now can correctly run JIT-compiled
  expressions that use floating-point numbers.

Also, we have taken a fix that allows us to
ignore access control in Objective-C as in C++.

llvm-svn: 152286
2012-03-08 02:39:03 +00:00
Johnny Chen c79c93ad96 rdar://problem/10611315
expression command doesn't handle xmm or stmm registers...

o Update ClangASTContext::GetBuiltinTypeForEncodingAndBitSize() to now handle eEncodingVector.

o Modify RegisterValue::SetFromMemoryData() to fix the subtle error due to unitialized variables.

o Add a test file for "expr $xmm0".

llvm-svn: 152190
2012-03-07 01:12:24 +00:00
Enrico Granata eb06e25242 Fixing some of the new Python formatters to report '1 object' instead of '1 objects'
llvm-svn: 152186
2012-03-07 00:56:09 +00:00
Enrico Granata 297e69f15e Fixing an issue where a ValueObject had changed its value but the 'value changed' flag was not being set. This was breaking one of our test cases
llvm-svn: 152161
2012-03-06 23:21:16 +00:00
Sean Callanan 75383bf34d Added support for calling blocks from expressions,
but gated by an #ifdef until we roll LLVM/Clang to
bring in the necessary parser support.

llvm-svn: 152149
2012-03-06 21:56:33 +00:00
Jim Ingham 97f7e81891 Add a test case and fix the C++ exception symbols.
llvm-svn: 152101
2012-03-06 03:52:02 +00:00
Johnny Chen 35e2ab6039 rdar://problem/10976649
Add SBFrame::IsEqual(const SBFrame &that) method and export it to the Python binding.
Alos add a test case test_frame_api_IsEqual() to TestFrames.py file.

llvm-svn: 152050
2012-03-05 19:53:24 +00:00
Johnny Chen d1adb79010 Add two expectedFailure decorators with radar number.
llvm-svn: 152049
2012-03-05 19:48:28 +00:00
Enrico Granata 7a3b1d9757 Correct wrong values in the test case
llvm-svn: 151982
2012-03-03 18:29:21 +00:00
Enrico Granata 89fd064582 Currently TestDataFormatterPythonSynth is failing because of an issue with children capping. Splitting the test case in two so we better isolate the issue and also for better logical separation
llvm-svn: 151966
2012-03-03 03:13:03 +00:00
Enrico Granata 385ad4e401 added a new formatter for CF(Mutable)BitVector
fixed a few potential NULL-pointer derefs in ValueObject
we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits
added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain

llvm-svn: 151962
2012-03-03 00:45:57 +00:00
Enrico Granata 242d9838c6 Adding a test case for a bug where types CFGregorianDate and CFRange were improperly uniqued by LLDB such that both where shown as having the same structure contents - The bug itself is fixed in TOT but we want to catch regressions ASAP
llvm-svn: 151929
2012-03-02 18:47:26 +00:00
Enrico Granata 8dfdd89433 having std::vector still show children even if it now has a builtin summary - having the std::vector test case deal with the fact that we now have said builtin summary
llvm-svn: 151870
2012-03-02 01:14:02 +00:00
Sean Callanan e8c0cfbb00 Improved the type's handling of anonymous structs,
so that the expression parser can look up members
of anonymous structs correctly.  This meant creating
all the proper IndirectFieldDecls in each Record
after it has been completely populated with members.

llvm-svn: 151868
2012-03-02 01:03:45 +00:00
Enrico Granata 8d5c83f6ef (a) adding formatters for:
NSTimeZone and CFTimeZonRef
 SEL and related types
 CFGregorianDate

llvm-svn: 151866
2012-03-02 00:55:53 +00:00
Enrico Granata 896cd1d3e6 (a) adding an introspection formatter for NS(Mutable)IndexSet
(b) fixes and improvements to the formatters for NSDate and NSString
(c) adding an introspection formatter for NSCountedSet
(d) making the Objective-C formatters test cases pass on both 64 and 32 bit
    one of the test cases is marked as expected failure on i386 - support needs to be added to the LLDB core for it to pass

llvm-svn: 151826
2012-03-01 19:32:33 +00:00
Enrico Granata 0c489f58cd 1) solving a bug where, after Jim's fixes to stack frames, synthetic children were not recalculated when necessary, causing them to get out of sync with live data
2) providing an updated list of tagged pointers values for the objc_runtime module - hopefully this one is final
3) changing ValueObject::DumpValueObject to use an Options class instead of providing a bulky list of parameters to pass around
   this change had been laid out previously, but some clients of DumpValueObject() were still using the old prototype and some arguments
   were treated in a special way and passed in directly instead of through the Options class
4) providing new GetSummaryAsCString() and GetValueAsCString() calls in ValueObject that are passed a formatter object and a destination string
   and fill the string by formatting themselves using the formatter argument instead of the default for the current ValueObject
5) removing the option to have formats and summaries stick to a variable for the current stoppoint
   after some debate, we are going with non-sticky: if you say frame variable --format hex foo, the hex format will only be applied to the current command execution and not stick when redisplaying foo
   the other option would be full stickiness, which means that foo would be formatted as hex for its whole lifetime
   we are open to suggestions on what feels "natural" in this regard

llvm-svn: 151801
2012-03-01 04:24:26 +00:00
Sean Callanan 6d1c372c04 Added a testcase verifying that forward declarations
of Objective-C classes in header files are correctly
resolved in the final type.

llvm-svn: 151790
2012-03-01 02:06:31 +00:00
Enrico Granata 7bc0ec3aad This commit:
a) adds a Python summary provider for NSDate
 b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around
 c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side
 d) contains much needed performance improvements:
    1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time
    2) redundant memory reads in the Python ObjC runtime wrapper are eliminated
    3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object
 e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure

llvm-svn: 151703
2012-02-29 03:28:49 +00:00
Johnny Chen 64e2e516bc Forgot to check in this file with r151593.
llvm-svn: 151640
2012-02-28 18:16:44 +00:00
Johnny Chen 1387839a9f Add more test scenarios for 'memory read': one for a successful command execution
and one for another error message.

llvm-svn: 151593
2012-02-27 23:44:26 +00:00
Johnny Chen be66898cd5 Modify the expected error message accordingly after the recent change to DataExtractor.cpp.
llvm-svn: 151587
2012-02-27 23:27:16 +00:00
Johnny Chen ac25713f60 During the test case tearDown(), give it one final blow to make sure the child process spawned by pexpect is terminated.
Fix the issue of many '(lldb)' zombie processes observed by Jim.

llvm-svn: 151583
2012-02-27 23:07:40 +00:00
Sean Callanan 0206094d43 Fixed an overly-specific testcase that depended
on libm being loaded.

llvm-svn: 151565
2012-02-27 21:08:54 +00:00
Johnny Chen 4500751b17 Create an additional watchpoint during the test run and verify that the watchpoint fired has the expected watchpoint id.
llvm-svn: 151404
2012-02-24 23:12:08 +00:00
Enrico Granata 9283444b8a Reworking the ObjC formatters test case not to test everything in one huge code block - better for maintenance and debugging
llvm-svn: 151390
2012-02-24 20:43:28 +00:00
Enrico Granata d2c15e4c8a commenting parts of std::map test case which would make the test case fail when using TOT clang, but succeed on older compiler releases
llvm-svn: 151309
2012-02-23 23:57:43 +00:00
Enrico Granata b7dba3f949 This patch provides a set of formatters for most of the commonly used Cocoa classes.
The formatter for NSString is an improved version of the one previously shipped as an example, the others are new in design and implementation.
A more robust and OO-compliant Objective-C runtime wrapper is provided for runtime versions 1 and 2 on 32 and 64 bit.
The formatters are contained in a category named "AppKit", which is not enabled at startup.

llvm-svn: 151301
2012-02-23 23:11:19 +00:00
Enrico Granata d3d444f811 This patch provides a set of formatters for most of the commonly used Cocoa classes.
The formatter for NSString is an improved version of the one previously shipped as an example, the others are new in design and implementation.
A more robust and OO-compliant Objective-C runtime wrapper is provided for runtime versions 1 and 2 on 32 and 64 bit.
The formatters are contained in a category named "AppKit", which is not enabled at startup.

llvm-svn: 151299
2012-02-23 23:10:03 +00:00
Sean Callanan 93831264b3 Made the hidden-ivar test a little more rigorous.
llvm-svn: 151221
2012-02-23 01:06:42 +00:00
Sean Callanan 7277284f87 Added support for looking up the complete type for
Objective-C classes.  This allows LLDB to find
ivars declared in class extensions in modules other
than where the debugger is currently stopped (we
already supported this when the debugger was
stopped in the same module as the definition).

This involved the following main changes:

- The ObjCLanguageRuntime now knows how to hunt
  for the authoritative version of an Objective-C
  type.  It looks for the symbol indicating a
  definition, and then gets the type from the
  module containing that symbol.

- ValueObjects now report their type with a
  potential override, and the override is set if
  the type of the ValueObject is an Objective-C
  class or pointer type that is defined somewhere
  other than the original reported type.  This
  means that "frame variable" will always use the
  complete type if one is available.

- The ClangASTSource now looks for the complete
  type when looking for ivars.  This means that
  "expr" will always use the complete type if one
  is available.

- I added a testcase that verifies that both
  "frame variable" and "expr" work.

llvm-svn: 151214
2012-02-22 23:57:45 +00:00
Johnny Chen 0afd64a8bb Add @expectedFailure decorator with radar number.
llvm-svn: 151212
2012-02-22 23:10:50 +00:00
Enrico Granata d3e45fc363 making it so that the std::map test case does a better job at checking for interference between expression parser and synthetic children; plus being more verbose in the comments
llvm-svn: 150854
2012-02-18 00:29:33 +00:00
Enrico Granata 864e3e8413 Adding formatters for several useful Objective-C/Cocoa data types. The new categories are not enabled at startup, but can be manually activated if desired.
Adding new API calls to SBValue to be able to retrieve the associated formatters
Some refactoring to FormatNavigator::Get() in order to shrink its size down to more manageable terms (a future, massive, refactoring effort will still be needed)
Test cases added for the above

llvm-svn: 150784
2012-02-17 03:18:30 +00:00
Johnny Chen 3517d12826 memory read -f X doesn't print anything (lldb should warn when encountering an unsupported byte size)
Also add a test sequence for it.

rdar://problem/10876841

llvm-svn: 150766
2012-02-16 23:09:08 +00:00
Johnny Chen 325fa8a77c memory read prints out duplicate entries when using vector formats
DataExtractor::Dump() needs to supply the correct cursor when delegating to the child DataExtractor::Dump() calls.
Add a regression test file.
 
rdar://problem/10872908

llvm-svn: 150729
2012-02-16 22:06:47 +00:00
Enrico Granata 1422d6760c adding a new test case for the SB formatters API
llvm-svn: 150559
2012-02-15 02:36:32 +00:00
Johnny Chen 973cf9e8ae Remove the functionality of using 'frame variable -w' to set a watchpoint now that 'watchpoint set variable/expression'
is working.  Also update the relevant test cases.

llvm-svn: 150514
2012-02-14 22:00:40 +00:00
Johnny Chen b2cde923cf Remove @expectedFailure decorators as the bug has been fixed.
llvm-svn: 150501
2012-02-14 20:04:26 +00:00
Johnny Chen 5e60e3904c Add test cases exercising SBValue.GetObjectDescription() with the SBValue from SBTarget.FindGlobalVariables()
as well as from SBFrame.GetVariables().  Both scenarios are expected to work.

llvm-svn: 150450
2012-02-14 01:02:41 +00:00
Johnny Chen 3e3f92eaf9 Add a test case for completion from 'settings set target.exec' to 'settings set target.exec-search-paths '.
llvm-svn: 150427
2012-02-13 23:25:06 +00:00
Enrico Granata 55031d28ba fixing a macro name mismatch that was making our test case succeed for the wrong reason; plus a minor code change to the CPP side of the test which eases debugging efforts
llvm-svn: 150213
2012-02-10 00:10:27 +00:00
Johnny Chen f4a75d880d Fix compile time warnings for the inferior program.
llvm-svn: 150205
2012-02-09 20:29:11 +00:00
Johnny Chen 235df4f687 Setting terminal type to 'xterm' on Darwin; otherwise, to 'vt100'.
llvm-svn: 150198
2012-02-09 19:34:25 +00:00
Johnny Chen acdde195fb Add error handling for missing option terminator "--" and a test scenario for it.
Also fix a logic error for a missing return stmt. Oops.

llvm-svn: 150195
2012-02-09 18:44:27 +00:00
Johnny Chen 57816730f0 Add safe guard for when the 'expect' program cannot be located and skip the test.
llvm-svn: 150133
2012-02-09 02:01:59 +00:00
Johnny Chen 177df6f35c Set the terminal type to 'xterm' before doing 'stty -a'.
llvm-svn: 150127
2012-02-09 01:16:04 +00:00
Johnny Chen 4dcad1437c Make the expect_prompt more strict.
llvm-svn: 150124
2012-02-09 00:51:41 +00:00