Commit Graph

1668 Commits

Author SHA1 Message Date
Johnny Chen 892943f9dd Cope with the case where the user-supplied callbacks want the watchpoint itself to be disabled!
Previously we put a WatchpointSentry object within StopInfo.cpp to disable-and-then-enable the watchpoint itself
while we are performing the actions associated with the triggered watchpoint, which can cause the user-initiated
watchpoint disabling action to be negated.

Add a test case to verify that a watchpoint can be disabled during the callbacks.

llvm-svn: 162483
2012-08-23 22:28:26 +00:00
Johnny Chen 8ccba980e6 Make the substring un-matching more robust.
llvm-svn: 162467
2012-08-23 20:25:04 +00:00
Johnny Chen 53311c3cb1 Make a test scenario stronger, since, by default, the setting interpreter.expand-regex-aliases is false.
llvm-svn: 162465
2012-08-23 20:22:16 +00:00
Johnny Chen cfe38aab25 Fix the test suite failures as a result of r162418 check-in.
llvm-svn: 162462
2012-08-23 19:36:03 +00:00
Johnny Chen b417dcdbee rdar://problem/12022371
Make it so that "b 245" should set a breakpoint at line 245 of the current file.
Also add a simple test file.

llvm-svn: 162419
2012-08-23 00:32:22 +00:00
Johnny Chen e3fe26c5dd Fix wrong directory pathname.
llvm-svn: 162372
2012-08-22 17:53:02 +00:00
Greg Clayton 67cc06366c Reimplemented the code that backed the "settings" in lldb. There were many issues with the previous implementation:
- no setting auto completion
- very manual and error prone way of getting/setting variables
- tons of code duplication
- useless instance names for processes, threads

Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing".

llvm-svn: 162366
2012-08-22 17:17:09 +00:00
Filipe Cabecinhas 9e10605d6b Added a test for the Python part of SBInputReader callbacks.
llvm-svn: 162357
2012-08-22 13:25:58 +00:00
Filipe Cabecinhas 6eb31e7391 Added a typemap and wrappers for SBInputReader callbacks
Now it's possible to use SBInputReader callbacks in Python.

We leak the callback object, unfortunately. A __del__ method can be added
to SBInputReader, but we have no way to check the callback function that
is on the reader. So we can't call Py_DECREF on it when we have our
PythonCallback function. One way to do it is to assume that reified
SBInputReaders always have a Python callback (and always call Py_DECREF).
Another one is to add methods or properties to SBInputReader (or make the
m_callback_function property public).

llvm-svn: 162356
2012-08-22 13:25:10 +00:00
Johnny Chen 82e5a26240 rdar://problem/11324515
'add-dsym' (aka 'target symbols add') should display error messages when dsym file is not found
or the dsym uuid does not match any existing modules. Add TestAddDsymCommand.py test file.

llvm-svn: 162332
2012-08-22 00:18:43 +00:00
Johnny Chen 393fbf6c53 Comment change.
llvm-svn: 162308
2012-08-21 20:18:21 +00:00
Johnny Chen d773139bbc Fix the wrong comment in TestUUIDMismatchWarnings.py.
llvm-svn: 162239
2012-08-20 22:36:58 +00:00
Johnny Chen 9b832fe40d Fix a crash (_wrap_SBDebugger_SetInputFileHandle -> PyString_AsString) running the test suite.
Also modify the boundary condition test case SBDebugger.DispatchInput(None) to be wrapped inside a try-except clause for now.

llvm-svn: 162228
2012-08-20 21:16:02 +00:00
Filipe Cabecinhas c30199917a A baton isn't needed to dispatch input.
I also added a typemap to make DispatchInput usable in Python.

llvm-svn: 162204
2012-08-20 16:21:04 +00:00
Johnny Chen a60c5ad819 Catch timestamps for the beginning and end of the test suite run.
llvm-svn: 162040
2012-08-16 19:15:21 +00:00
Johnny Chen eb46f78b08 rdar://problem/12096295
Add an lldb command line option to specify a core file: --core/-c.
For consistency, change the "target create" command to also use --core.

llvm-svn: 161993
2012-08-15 22:10:42 +00:00
Johnny Chen 25c0eb4a38 When trying to take snapshots of a watched variable, if the frame is unable to evaluate the variable expression,
do not take the sanpshot and forget about the stop info.  It is possible that the variable expression has gone
out of scope, we'll revise the hit count due to the false alarms.

llvm-svn: 161892
2012-08-14 20:56:37 +00:00
Enrico Granata 273d177bdf <rdar://problem/11589605> Making a
'type category enable *' command
to match 'type category disable *'

llvm-svn: 161882
2012-08-14 18:18:07 +00:00
Johnny Chen 88fc73b8f7 Simplify the "Watchpoint ... hit" printout, make it more terse.
Change the test case, too. 

llvm-svn: 161806
2012-08-13 23:27:50 +00:00
Johnny Chen 209bd65ea4 rdar://problem/12007576
Record the snapshot of our watched value when the watchpoint is set or hit.
And report the old/new values when watchpoint is triggered.  Add some test scenarios.

llvm-svn: 161785
2012-08-13 21:09:54 +00:00
Jim Ingham 0e41084ad1 Add an option to "process continue" to ignore the next <N> crossings of the breakpoint under
the currently selected thread.

<rdar://problem/10458225>

llvm-svn: 161723
2012-08-11 01:27:55 +00:00
Johnny Chen 01c0d4ec1f Add command completion test case for 'watchpoint command'.
llvm-svn: 161684
2012-08-10 19:05:48 +00:00
Johnny Chen e9a5627e7a rdar://problem/11457143 [ER] need "watchpoint command ..."
Add 'watchpoint command add/delete/list' to lldb, plus two .py test files.

llvm-svn: 161638
2012-08-09 23:09:42 +00:00
Enrico Granata 17b1174911 <rdar://problem/11578397> Adding a new --summary-string option for the frame variable command which allows the user to provide a summary string with which he wants to display the variables without having to make a named summary first
llvm-svn: 161623
2012-08-09 22:02:51 +00:00
Jim Ingham 462227b08b Turn on function args by default in thread & frame formats.
<rdar://problem/11703715>

llvm-svn: 161611
2012-08-09 20:29:34 +00:00
Enrico Granata 7ec18e3d10 <rdar://problem/10449092> Adding a new uppercase hex format specifier. This commit also changes the short names for formats so that uppercase hex can be 'X', which was previously assigned to hex float. hex float now has no short name.
llvm-svn: 161606
2012-08-09 19:33:34 +00:00
Enrico Granata 2b2631c915 <rdar://problem/11505459> Stripping off the object's type from the output of the 'po' command
llvm-svn: 161592
2012-08-09 16:51:25 +00:00
Sean Callanan 91e776d132 Now that the testcase is fixed, it is no longer
an expected failure.

llvm-svn: 161556
2012-08-09 00:40:16 +00:00
Enrico Granata 6656e6c2b6 <rdar://problem/12061386> Fixing data-formatter-cpp test case - previous version had an unfortunate dependency on the value of uninitialized memory
llvm-svn: 161555
2012-08-09 00:35:41 +00:00
Sean Callanan 5fbbc5bfe8 The C++ data formatter tests are flaky. Marking
them as expected failures until they are fixed.

llvm-svn: 161547
2012-08-09 00:01:48 +00:00
Filipe Cabecinhas f2bac60f74 Indentation fix for dotest.py.
llvm-svn: 161493
2012-08-08 15:23:24 +00:00
Filipe Cabecinhas d6cab1f6af Make dotest.py runnable from a directory other than lldb/test
llvm-svn: 161492
2012-08-08 15:05:04 +00:00
Enrico Granata 40d557107f <rdar://problem/11975483> Removing user-visible references to 'dict' as a parameter name for Python summary-generating functions since it is a Python keyword.
llvm-svn: 161467
2012-08-08 02:06:30 +00:00
Filipe Cabecinhas 1a62bf4d55 Start working on the test suite in FreeBSD
llvm-svn: 161419
2012-08-07 15:40:30 +00:00
Johnny Chen 552d6719f2 Silence the "Command ... failed!" message when not running in trace mode.
You run with trace mode by passing '-t' to the test driver.

llvm-svn: 161130
2012-08-01 19:56:04 +00:00
Filipe Cabecinhas f4156d496e Make git not delete some empty dirs. Otherwise a git checkout would be different from an svn checkout.
llvm-svn: 160717
2012-07-25 10:34:53 +00:00
Filipe Cabecinhas e6dc330748 Make git not delete my_working_dir. Otherwise a git checkout would be different from an svn checkout.
llvm-svn: 160506
2012-07-19 13:53:12 +00:00
Sean Callanan 6b76bc76fa Removed a hack that gives zero-length arrays a
single element.  Also modified our struct test
case to test this.

llvm-svn: 160449
2012-07-18 20:39:26 +00:00
Enrico Granata 4b7b5aa0bc <rdar://problem/11773899> Formatters for BOOL* and BOOL&
llvm-svn: 160181
2012-07-13 18:55:41 +00:00
Enrico Granata 4ed7ef1f72 <rdar://problem/11628688> Making sure to use the ostype format for OSType values
llvm-svn: 160180
2012-07-13 18:54:40 +00:00
Enrico Granata 811e9055fd <rdar://problem/11753405> Making sure we deal correctly with signed NSNumber values
llvm-svn: 160179
2012-07-13 18:53:14 +00:00
Filipe Cabecinhas 0c251adf75 Provide more information when process launch can't change directory to the
path passed with -w

Test this functionality.

llvm-svn: 160130
2012-07-12 14:09:25 +00:00
Filipe Cabecinhas 5d261b0601 Fix a wrong variable name.
llvm-svn: 159832
2012-07-06 16:20:13 +00:00
Enrico Granata 2e6dea3928 <rdar://problem/11755446> Making sure to provide summaries for one more NSString subclass
llvm-svn: 159389
2012-06-28 23:05:43 +00:00
Filipe Cabecinhas 0eec15acf2 Continue the cleanup started on r158737
Adds a utility class method to TestBase that checks and removes a temp
file.
Removed every use of system() to execute rm -f.

llvm-svn: 158809
2012-06-20 10:13:40 +00:00
Johnny Chen 59ceee7933 Test suite cleanup: use Python API to remove files as part of cleanup instead of running OS commands.
llvm-svn: 158737
2012-06-19 20:29:50 +00:00
Johnny Chen 9a63cfaf8d rdar://problem/11649610
lldb confused by single quote in executable path

Also add a test case.

llvm-svn: 158693
2012-06-19 00:56:55 +00:00
Johnny Chen 6097245436 Add a test case for r158222.
llvm-svn: 158232
2012-06-08 21:46:18 +00:00
Filipe Cabecinhas 89d91fcf1d Fixed TestCompletion, broken by r158173
llvm-svn: 158207
2012-06-08 16:16:19 +00:00
Johnny Chen 3f476c4a72 rdar://problem/11597911
Fix confusing error message about "expression did not evaluate to an address" when doing 'watchpoint set expression".
Instead of using 0 as the fail_value when invoking ValueObject::GetValueAsUnsigned(), modify the API to take an addition
bool pointer (defaults to NULL) to indicate success/failure of value conversion.

llvm-svn: 158016
2012-06-05 19:37:43 +00:00
Johnny Chen b90827e66c rdar://problem/11584012
Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee()
now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the
operation.  Update 'watchpoint set variable/expression' commands to take advantage of that.

Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for
SBTarget::WatchAddress() by passing an invalid watch_size.

llvm-svn: 157964
2012-06-04 23:19:54 +00:00
Filipe Cabecinhas 22889540dc Mark the test as failing on both architectures, since LLDB won't handle the function to clang.
llvm-svn: 157679
2012-05-30 05:44:59 +00:00
Filipe Cabecinhas 51c277876a Make the test suite work again on Mac OS X without the LLDB_BUILD_TYPE env var
llvm-svn: 157678
2012-05-30 05:40:23 +00:00
Filipe Cabecinhas f96964b6ef Clean all files when executing 'make clean'
llvm-svn: 157677
2012-05-30 05:35:14 +00:00
Filipe Cabecinhas 9f84da9b52 Clean renamed files on 'make clean'
llvm-svn: 157669
2012-05-30 02:52:29 +00:00
Johnny Chen 6d4d4f7db3 rdar://problem/11541676
Do not show the derived registers like "eax", ... for the vanilla "register read" command.
Also add a test scenario for that.

llvm-svn: 157647
2012-05-29 21:55:08 +00:00
Filipe Cabecinhas 54d730430c Update the Makefile to expect the lldb package
llvm-svn: 157620
2012-05-29 14:06:40 +00:00
Filipe Cabecinhas 2137c928b0 Remove all written files
llvm-svn: 157562
2012-05-28 04:07:56 +00:00
Johnny Chen ca7835c685 rdar://problem/11535045
Make 'help arch' return the list of supported architectures.
Add a convenience method StringList::Join(const char *separator) which is called from the help function for 'arch'.
Also add a simple test case.

llvm-svn: 157507
2012-05-26 00:32:39 +00:00
Johnny Chen 7d49c9c861 rdar://problem/11533713
Allow setting conditions inline with breakpoints.  Add test cases.

llvm-svn: 157497
2012-05-25 21:10:46 +00:00
Johnny Chen a95ce623d8 rdar://problem/11457634
Supports the use-case scenario of immediately continuing the process once attached.
Add a simple completion test case from "process attach --con" to "process attach --continue ".

llvm-svn: 157361
2012-05-24 00:43:00 +00:00
Johnny Chen f9ef60d236 Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it through the Python scripting bridge.
Add/modify some test cases.

llvm-svn: 157353
2012-05-23 22:34:34 +00:00
Johnny Chen 6463720505 Add the capability to display the number of supported hardware watchpoints to the "watchpoint list" command.
Add default Process::GetWatchpointSupportInfo() impl which returns an error of "not supported".
Add "qWatchpointSupportInfo" packet to the gdb communication layer to support this, and modify TestWatchpointCommands.py to test it.

llvm-svn: 157345
2012-05-23 21:09:52 +00:00
Johnny Chen ebffd2e7fd Add more convenience registers to x86_64 and a simple test scenario:
self.expect("expr -- $ax == (($ah << 8) | $al)",
            substrs = ['true'])

llvm-svn: 157302
2012-05-22 23:32:12 +00:00
Johnny Chen 6c26f0b2a7 Fix a typo.
llvm-svn: 157278
2012-05-22 19:41:53 +00:00
Johnny Chen 819b35daf7 Add a test case to check that eax's content equals the lower half of rax.
Plus fix the test class name as well as wrong directory path.

llvm-svn: 157277
2012-05-22 19:37:01 +00:00
Johnny Chen 058bb9908f Fix a bug where if I just run:
./dotest.py

No progress bar appears.

llvm-svn: 157226
2012-05-22 00:22:18 +00:00
Sean Callanan ce8af862ae Added support for rvalue references in debug information
(actually, mainly just hooked up support that was already
there).  Added a test case, although it's expected to fail
right now unless you're using top-of-tree LLVM.

llvm-svn: 157220
2012-05-21 23:31:51 +00:00
Sean Callanan 0061222ed8 Fixed the new-syntax testcase to reflect how we
print string literals.

llvm-svn: 157213
2012-05-21 22:25:12 +00:00
Sean Callanan 0259e51287 Fixed a nasty bug where JIT expressions didn't work
when stopped in a const method.  Also updated our
testsuite to ensure that JIT is forced in this case.

llvm-svn: 157208
2012-05-21 21:29:52 +00:00
Enrico Granata fd4c84ee9f <rdar://problem/11355592> Fixing a bug where we would incorrectly try and determine a dynamic type for a variable of a pointer type that is not a valid generic type for dynamic pointers.
llvm-svn: 157190
2012-05-21 16:51:35 +00:00
Johnny Chen 90830703b2 Add test cases where we start three worker threads, with a write watchpoint set. As soon as a watchpoint is hit in either of the worker thread,
we delete the watchpoint.  The test succeeds when no more watchpoint hit event fires after the deletion of the watchpoint.

related to rdar://problem/11320188

llvm-svn: 157084
2012-05-18 23:30:57 +00:00
Filipe Cabecinhas 5158f3de24 Cleanup a custom thread-format so we don't fail TestLoadUnload when running the
test suite for two architectures (the full path to d.c would appear).

llvm-svn: 157077
2012-05-18 21:35:43 +00:00
Filipe Cabecinhas 518549e28d Fixed the test for the new process launch abbreviation.
llvm-svn: 157050
2012-05-18 13:21:05 +00:00
Sean Callanan 4407880666 I have updated Clang to include support for Objective-C
boxed expressions returning numbers and strings.

I also added boxed expressions to our testcases, and
enabled boxed expressions when libarclite is linked into
the inferior.

llvm-svn: 157026
2012-05-17 23:29:56 +00:00
Filipe Cabecinhas af1537f57c Warn the user when several commands match the input given.
Added a testcase.

llvm-svn: 156961
2012-05-16 23:25:54 +00:00
Johnny Chen c98892ec1f Update the comments for lldbtest module. The test driver is the only way to run the test suite.
llvm-svn: 156943
2012-05-16 20:41:28 +00:00
Johnny Chen b8684b3c82 Make the script more friendly when running under python debugger.
llvm-svn: 156939
2012-05-16 19:43:14 +00:00
Johnny Chen a620e376e1 The redo.py script can take no argument where it uses heuristics to find the latest session directory.
llvm-svn: 156931
2012-05-16 18:32:05 +00:00
Filipe Cabecinhas 4d16c4c669 Cleanup after functionalities/alias/TestAliases.py
This test is run after TestAbbreviations and was making runCmd("h") fail
in that test, on the second tested architecture (two commands would be
avilable for "h": "help" and "hello").

Later I'm sending a patch for review to add some information to the error
message for that case.

llvm-svn: 156918
2012-05-16 15:07:07 +00:00
Johnny Chen e7ae16fa83 Fix Makefile to pass the correct -arch flag to the toolchains.
llvm-svn: 156882
2012-05-16 00:33:34 +00:00
Johnny Chen 5604c98fec Add i386-only expectedFailure decorators for current ToT.
llvm-svn: 156855
2012-05-15 21:27:40 +00:00
Enrico Granata bd5a7a9f03 Fixing a bug where the summary for certain NSStrings was being returned as empty in spite of the string actually having a content
llvm-svn: 156793
2012-05-15 01:22:45 +00:00
Jim Ingham 7ba6e99158 Found one more place where the OkayToDiscard needs to be consulted.
Also changed the defaults for SBThread::Step* to not delete extant plans.
Also added some test cases to test more complex stepping scenarios.

llvm-svn: 156667
2012-05-11 23:47:32 +00:00
Filipe Cabecinhas 0c543ea186 Make issue_11588/Test11588 work with a recent swig that converts ints to PyLongObjects
llvm-svn: 156637
2012-05-11 20:37:34 +00:00
Jim Ingham 18de2fdc55 If the ObjC Step Through Trampoline plan causes a target crash, properly propagate the error back to
the controlling plans so that they don't lose control.

Also change "ThreadPlanStepThrough" to take the return StackID for its backstop breakpoint as an argument
to the constructor rather than having it try to figure it out itself, since it might get it wrong whereas
the caller always knows where it is coming from.

rdar://problem/11402287

llvm-svn: 156529
2012-05-10 01:35:39 +00:00
Johnny Chen a21bd407e5 Option processing fix: should match '-F' exactly, instead.
llvm-svn: 156509
2012-05-09 21:00:03 +00:00
Filipe Cabecinhas 3a9b6e7140 Make redo.py more error-proof
Deal with being passed no parameters
Remove the infinite loop when it's passed something like --help

llvm-svn: 156504
2012-05-09 19:02:19 +00:00
Enrico Granata a777dc2abe <rdar://problem/11338654> Fixing a bug where having a summary for a bitfield without a format specified would in certain cases crash LLDB - This has also led to refactoring the by-type accessors for the data formatter subsystem. These now belong in our internal layer, and are just invoked by the public API stratum
llvm-svn: 156429
2012-05-08 21:49:57 +00:00
Greg Clayton 7051231709 <rdar://problem/11358639>
Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples.

Also make the selection process for auto selecting platforms based off of an arch much better.

llvm-svn: 156354
2012-05-08 01:45:38 +00:00
Johnny Chen 5ec8fcbf0c Fix the problem that 'help breakpoint set' is printing a lot of redundant lines.
Correctly specify the LLDB_OPT_SET's that the 'shlib' command option belongs to by using a newly added macro like this:

    #define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM(1, 10) & ~LLDB_OPT_SET_10 )

rdar://problem/11393864

llvm-svn: 156337
2012-05-07 23:04:49 +00:00
Johnny Chen ddb149069e Add an -F option to the redo.py script to selectively re-run only those failed sessions whose filenames contain the component(s)
specified.  For example:

    ./redo.py -F x86_64 -n 2012-05-07-15_28_24

will redo the failed sessions under the 2012-05-07-15_28_24 directory, but only for session names which contain 'x86_64' in it.

llvm-svn: 156335
2012-05-07 22:59:00 +00:00
Enrico Granata 78453eed12 Adding a new 'type category disable *' feature that disables all categories - This is intended as a quick kill switch for data formatters for cases where the user wants as little extra processing as possible to be done on their target, or to override major data formatters bug, should they occur
llvm-svn: 156044
2012-05-03 01:08:44 +00:00
Enrico Granata 73076f9269 Automatically enabling the Cocoa formatter categories for command-line LLDB. Previously, the categories were filled in but disabled by default. Tweaking test cases appropriately to keep working and do the right thing
llvm-svn: 155605
2012-04-26 01:40:38 +00:00
Johnny Chen 6381f01012 Renaming to rid of the '++' in the test file name and simplify the Makefile.
llvm-svn: 155521
2012-04-25 01:20:15 +00:00
Sean Callanan dd42e097eb Removed a binary that I accidentally committed.
llvm-svn: 155516
2012-04-25 01:04:34 +00:00
Sean Callanan 7457f8d7c9 Recognize Objective-C classes with runtime class
ObjCPlusPlus as Objective-C classes.  Really the
compiler should say they have Objective-C runtime
class, but we should be a little more resilient
(we were refusing to find ivars in those classes
before).

Also added a test case.

llvm-svn: 155515
2012-04-25 01:03:57 +00:00
Greg Clayton 6d98f56c58 Maked LLDB into a package so we can import things without poluting the global namespace.
Enrico will follow this up with fixing the data formatter test cases that are failing.

llvm-svn: 155514
2012-04-25 00:58:03 +00:00
Sean Callanan 374bd0c9e5 Made it safe to re-import a Python module, allowing
the same test to be run multiple times in the same
session.

llvm-svn: 155511
2012-04-25 00:21:42 +00:00
Enrico Granata 45034810aa Fixing a bunch of i386 testsuite failures
llvm-svn: 155510
2012-04-25 00:13:06 +00:00
Johnny Chen c4f4d056ab Make the test case more robust in terms of remote testsuite execution.
rdar://problem/11312971

llvm-svn: 155505
2012-04-24 23:33:16 +00:00
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