Commit Graph

1571 Commits

Author SHA1 Message Date
Filipe Cabecinhas c5041918dd Added SBDebugger's log callbacks to Python-land
- Tweaked a parameter name in SBDebugger.h so my typemap will catch it;
- Added a SBDebugger.Create(bool, callback, baton) to the swig interface;
- Added SBDebugger.SetLoggingCallback to the swig interface;
- Added a callback utility function for log callbacks;
- Guard against Py_None on both callback utility functions;

- Added a FIXME to the SBDebugger API test;
- Added a __del__() stub for SBDebugger.

We need to be able to get both the log callback and baton from an
SBDebugger if we want to protect against memory leaks (or make the user
responsible for holding another reference to the callback).
Additionally, it's impossible to revert from a callback-backed log
mechanism to a file-backed log mechanism.

llvm-svn: 162633
2012-08-25 00:29:07 +00:00
Johnny Chen 6d675243b4 rdar://problem/11811338
Add 'attach <pid>|<process-name>' command to lldb, as well as 'detach' which is an alias of 'process detach'.
Add two completion test cases for "attach" and "detach".

llvm-svn: 162573
2012-08-24 18:15:45 +00:00
Johnny Chen 039330c292 Take '--help' as well as '-h' as hint to emit the usage output.
llvm-svn: 162502
2012-08-23 23:45:26 +00:00
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