Commit Graph

31 Commits

Author SHA1 Message Date
Johnny Chen a8807f93b7 Modify the command passed to command interpreter from 'expr' (which is an alias of 'expression')
to 'expression' to avoid cases where 'expr' has been unaliased.

llvm-svn: 116780
2010-10-19 00:52:07 +00:00
Johnny Chen 2769a42731 Remove the @expectedFailure decorators, as rdar://problem/8542091 is supposed to be fixed.
Also change the expected matching pattern of the 'expr -o -- my' output.

llvm-svn: 116645
2010-10-15 23:35:32 +00:00
Johnny Chen 7987c6188a Remove the @skip("Skip due to deadlock?") decorators. Change the command to
'breakpoint delete 1' from 'breakpoint delete'.  With 'breakpoint delete', the
command interpreter was asking for a confirmation from the user, which there
isn't any.

llvm-svn: 116610
2010-10-15 19:29:15 +00:00
Johnny Chen 150c3cc825 This is an initial version of test driver enhanceent to be able to dump the
session info after a test case failure, allowing more direct inspection of
debugger session which leads to the test failure.

For a simple usage scenario:

[18:06:26] johnny:/Volumes/data/lldb/svn/trunk/test $ ./dotest.py -v . 2> ~/Developer/Log/lldbtest.log 

...

[18:14:43] johnny:/Volumes/data/lldb/svn/trunk/test $ ls -l .session-*
-rw-r--r--  1 johnny  admin  1359 Oct 14 18:06 .session-TestArrayTypes.ArrayTypesTestCase.test_with_dwarf_and_run_command
-rw-r--r--  1 johnny  admin  2054 Oct 14 18:07 .session-TestClassTypes.ClassTypesTestCase.test_with_dsym_and_expr_parser
-rw-r--r--  1 johnny  admin  2055 Oct 14 18:07 .session-TestClassTypes.ClassTypesTestCase.test_with_dwarf_and_expr_parser
-rw-r--r--  1 johnny  admin  1351 Oct 14 17:57 .session-TestClassTypes.ClassTypesTestCase.test_with_dwarf_and_run_command
[18:14:51] johnny:/Volumes/data/lldb/svn/trunk/test $ 

The test case which failed will have its recorded session info dumped to a
.session-* file in the current working directory.  For test suite using
relocated directory, expect to find the .session-* files there.

In this checkin, I also add @skip decorator to the two test methods in
test/foundation/TestObjCMethods.py as it looks like the test suite is
deadlocking when running the tests.  More investigations are needed.

llvm-svn: 116552
2010-10-15 01:18:29 +00:00
Johnny Chen aadcef54de Make calling the super class's setUp() method less fragile.
llvm-svn: 116490
2010-10-14 17:31:24 +00:00
Johnny Chen 456c9c343e Apply (query-replace "frame variable" "frame variable -t") and fix a comment about 'expr var',
not 'frame variable var'.

llvm-svn: 116419
2010-10-13 19:22:50 +00:00
Johnny Chen 6b66081626 Forgor to also check in this change with r116337.
llvm-svn: 116340
2010-10-12 21:24:25 +00:00
Johnny Chen f8afe89a75 Update the @expectedFailure decorator with additional bug info:
rdar://problem/8542091 test/foundation: expr -o -- my not working?

Add an additional test for 'frame variable *self' when stopped in '-[MyString initWithNSString:]'
and move the 'expr -o -- self' to after MyString has been constructed and change it to
'expr -o -- my'.

llvm-svn: 116337
2010-10-12 21:20:11 +00:00
Johnny Chen f062c2fb59 The 'regexp-break' command now prints out the command that results from
expanding the regular expression command.  So change the more stringent:

    self.expect(..., startstr = matching_string)

to:

    self.expect(..., substrs = [matched_string])

to pass the test.

llvm-svn: 116331
2010-10-12 19:29:49 +00:00
Johnny Chen 67af43f04f Make the test module with unique name instead of just the generic name TestDisassembly.
Add a utility function to lldbtest.py to get the native pointer size of the host os.

llvm-svn: 115652
2010-10-05 19:27:32 +00:00
Johnny Chen 68e37439a9 Filename renamings.
llvm-svn: 115636
2010-10-05 17:34:07 +00:00
Johnny Chen bb5f078ce0 Do 'disassemble -s start_addr -e end_addr' on stdc++ library function entries.
llvm-svn: 115574
2010-10-04 23:03:34 +00:00
Johnny Chen 1e190a552f Use a more robust regexp to search for the 'Code' symbol. Plus compile the
regexp once and use it within the for loop for some speedup.

llvm-svn: 115397
2010-10-02 01:23:40 +00:00
Johnny Chen 7fce877aa5 I committed too fast. Both "struct objc_selector *" and "SEL" are possible,
depending on the compiler used.  Former if gcc/llvm-gcc, and latter if clang.

llvm-svn: 115380
2010-10-01 23:34:28 +00:00
Johnny Chen 9eaa69699a Updated the expected match string when stopped on an objc instance method from:
ARG: (struct objc_selector *) _cmd

to

    ARG: (SEL) _cmd

The change most likely resulted from an update from the llvm tot with a newer clang.

llvm-svn: 115372
2010-10-01 23:21:20 +00:00
Johnny Chen b781cf0022 Commented out two debug prints.
llvm-svn: 115369
2010-10-01 23:05:03 +00:00
Johnny Chen da88434b39 o Added a new feature to the test framework to skip long running tests conditionally.
To not skip long running tests, pass '-l' to the test driver (dotest.py).

  An example:

    @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")
    def test_foundation_disasm(self):
        ...

o Added a long running disassemble test to the foundation directory, which iterates
  the code symbols from Foundation.framework and kicks off a disassemble command for
  for the named function symbol.  Found a crasher: rdar://problem/8504895.

o Plus added/updated some comments for the TestBase class.

llvm-svn: 115368
2010-10-01 22:59:49 +00:00
Johnny Chen ec67219617 Add a simple test for the lldb 'disassemble' command. The initial version just
sets some breakpoints and invokes 'disassemble' when the breakpoint hits, which
just disassembles the bytes in the current function, i.e., frame #0's function.

llvm-svn: 115249
2010-10-01 00:10:17 +00:00
Johnny Chen a92bf08038 Test new feature with r115115:
Add "-o" option to "expression" which prints the object description if available.

llvm-svn: 115182
2010-09-30 18:02:47 +00:00
Johnny Chen 2e566e040a Updated the comment section for running 'expr self->string' and 'expr self->date'.
The failures are similar in nature to the radar already filed:

        # rdar://problem/8492646
        # test/foundation fails after updating to tot r115023
        # self->str displays nothing as output

llvm-svn: 115052
2010-09-29 18:05:03 +00:00
Johnny Chen 8eb3850886 Added two @expectedFailure decorators for test_data_type_and_expr_with_dsym() and
test_data_type_and_expr_with_dwarf().

rdar://problem/8492646
test/foundation fails after updating to tot r115023: self->str displays nothing as output

llvm-svn: 115050
2010-09-29 17:58:12 +00:00
Johnny Chen 620f9d1548 Updated to reflect the updated tot r115023. Will be filing a bug next.
llvm-svn: 115046
2010-09-29 17:50:35 +00:00
Johnny Chen dd4da82c92 Removed the @expectedFailure decorators; it was fixed with r114258.
llvm-svn: 114305
2010-09-19 02:31:53 +00:00
Johnny Chen aa90292126 Fixed a typo and supplied a more appropriate assert message.
llvm-svn: 114232
2010-09-17 22:45:27 +00:00
Johnny Chen b330786d1f Added test cases to FoundationTestCase to exercise lookup of objc data types and
to evaluate expressions.  Marked with @expectedFailure decorators for the time
being.

Enhanced the lldbtest.TestBase.expect() API to allow an additional keyword arg
named "error".  If the client passes "error=True", it signifies that an error
while running the command is expected.  The golden input is then compared
against the return object's error output.

llvm-svn: 114228
2010-09-17 22:28:51 +00:00
Johnny Chen b219d281b0 Changed test case method names.
llvm-svn: 114210
2010-09-17 21:14:02 +00:00
Johnny Chen 2756d60563 Added extra test scenarios to break on a selector with:
(lldb) breakpoint set -S description

and a compilation unit defined instance method with:

(lldb) breakpoint set -n '-[MyString initWithNSString:]'

llvm-svn: 114134
2010-09-16 23:57:33 +00:00
Johnny Chen ce65073696 Fixed wrong doc strings from cut-and-paste.
llvm-svn: 114120
2010-09-16 21:01:39 +00:00
Johnny Chen 6c17c0807e Added a simple test case to set breakpoints on objc class/instance methods.
Modified Makefile.rules to allow for overwriting the ARCH make variable.

llvm-svn: 114118
2010-09-16 20:54:06 +00:00
Greg Clayton b0b9fe610a Added support for objective C built-in types: id, Class, and SEL. This
involved watching for the objective C built-in types in DWARF and making sure
when we convert the DWARF types into clang types that we use the appropriate
ASTContext types.

Added a way to find and dump types in lldb (something equivalent to gdb's 
"ptype" command):

    image lookup --type <TYPENAME>

This only works for looking up types by name and won't work with variables.
It also currently dumps out verbose internal information. I will modify it
to dump more appropriate user level info in my next submission.

Hookup up the "FindTypes()" functions in the SymbolFile and SymbolVendor so
we can lookup types by name in one or more images.

Fixed "image lookup --address <ADDRESS>" to be able to correctly show all
symbol context information, but it will only show this extra information when
the new "--verbose" flag is used.

Updated to latest LLVM to get a few needed fixes.

llvm-svn: 110089
2010-08-03 00:35:52 +00:00
Greg Clayton 2d5cdf0615 Added an objective C test case.
llvm-svn: 109798
2010-07-29 20:08:39 +00:00