Commit Graph

1607 Commits

Author SHA1 Message Date
Enrico Granata 6c61cbbc49 Better error message for invalid argument to --category - silenced the printout of the raw args when not in verbose mode
llvm-svn: 166514
2012-10-23 22:52:49 +00:00
Sean Callanan 7fcf0c131b Added a testcase for runtime types in Objective-C.
llvm-svn: 166507
2012-10-23 22:14:39 +00:00
Jim Ingham a7dfb665e3 Watchpoints remember the type of the expression or variable they were set with, and use
it to print the old and new values.
Temporarily disable the "out of scope" checking since it didn't work correctly, and was
not what people generally expected watchpoints to be doing.  

llvm-svn: 166472
2012-10-23 07:20:06 +00:00
Enrico Granata bc08ab450a <rdar://problem/12500212> Test case for the new plugin feature
llvm-svn: 166453
2012-10-23 00:09:02 +00:00
Sean Callanan ec979baef7 Added support for zero-length arrays at the end
of structures, and added a testcase.

<rdar://problem/12551591>

llvm-svn: 166450
2012-10-22 23:56:48 +00:00
Enrico Granata e3e91517ff <rdar://problem/12437442>
Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar*
If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was
no trivial way for us to change the SP inside an SBValue on the fly
This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM)
As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython
Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases)

llvm-svn: 166426
2012-10-22 18:18:36 +00:00
Greg Clayton 453925530d <rdar://problem/12462048>
LLDB changes argv[0] when debugging a symlink. Now we have the notion of argv0 in the target settings:

target.arg0 (string) = 

There is also the program argument that are separate from the first argument that have existed for a while:

target.run-args (arguments) =

When running "target create <exe>", we will place the untouched "<exe>" into target.arg0 to ensure when we run, we run with what the user typed. This has been added to the ProcessLaunchInfo and all other needed places so we always carry around the:
- resolved executable path
- argv0
- program args

Some systems may not support separating argv0 from the resolved executable path and the ProcessLaunchInfo needs to carry all of this information along so that each platform can make that decision.

llvm-svn: 166137
2012-10-17 22:57:12 +00:00
Sean Callanan aa0f9cbc9a Added support for "bool", "true", and "false" to
the expression parser (also wchar_t) and added a
test case.

llvm-svn: 166131
2012-10-17 22:09:59 +00:00
Greg Clayton cced1566e2 API cleanup.
llvm-svn: 166070
2012-10-16 22:58:25 +00:00
Jim Ingham 35e1bda695 Add the ability to set timeout & "run all threads" options both from the "expr" command and from
the SB API's that evaluate expressions.

<rdar://problem/12457211>

llvm-svn: 166062
2012-10-16 21:41:58 +00:00
Enrico Granata cd4d24d5e9 <rdar://problem/12446320> Fixing an issue with our Driver where setting an immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands
llvm-svn: 166058
2012-10-16 20:57:12 +00:00
Sean Callanan 794baf6fb7 If a full path to a compiler is provided on the
command line to dotest.py, replace / with _ in
the logfile names that mention that compiler so
that we don't try to put log files in weird
places.

llvm-svn: 166038
2012-10-16 18:22:04 +00:00
Jim Ingham 5d88a068ee Patch from Matt Kopec <matt.kopec@intel.com> to fix the problem that if two breakpoints were set on consecutive addresses, the continue from the
first breakpoint would skip the second.

llvm-svn: 166000
2012-10-16 00:09:33 +00:00
Jim Ingham 28eb57114d Bunch of cleanups for warnings found by the llvm static analyzer.
llvm-svn: 165808
2012-10-12 17:34:26 +00:00
Greg Clayton 85c2a72f2a Fixed the redo.py script to emit correct arch and compiler options after dotest.py was switched over to use argparse.
llvm-svn: 165507
2012-10-09 16:54:55 +00:00
Enrico Granata e3fcd2bb53 <rdar://problem/12426557> Fixing the NSIndexSet data formatter
llvm-svn: 165341
2012-10-05 22:58:46 +00:00
Jim Ingham ca36cd16e4 Add one-shot breakpoints (-o option to "break set") and a tbreak alias for our gdb friends.
llvm-svn: 165328
2012-10-05 19:16:31 +00:00
Jim Ingham 874f43cadc Fix a test failure caused by checkin 165274.
llvm-svn: 165327
2012-10-05 19:14:57 +00:00
Enrico Granata f175ad152c <rdar://problem/12099592> Adding back a bunch of code-running summaries
llvm-svn: 165186
2012-10-03 23:53:45 +00:00
Sean Callanan 4ca7389925 Added support for the DebugClang configuration to the
testsuite.

llvm-svn: 164723
2012-09-26 21:16:15 +00:00
Sean Callanan 32a5ba5b47 Made TestHiddenIvars an expected failure with
"frame variable".  "expr" finds hidden ivars
correctly.

llvm-svn: 164558
2012-09-24 21:34:40 +00:00
Jim Ingham 43de0f95ed Remove a couple of debugging printf's from the testsuite.
llvm-svn: 164544
2012-09-24 18:11:54 +00:00
Jim Ingham 493dffe2b1 Missed a few places where I didn't delete the obsolete (commented out) version of the breakpoint creation.
llvm-svn: 164436
2012-09-22 00:14:47 +00:00
Jim Ingham 63dfc725a7 Fix all the test case breakages caused by folks writing tests all over the place that depended explicitly
on the output of "break set".  Please don't do this sort of thing!!!!!

llvm-svn: 164433
2012-09-22 00:05:11 +00:00
Enrico Granata 165f8af8c5 Initial commit of a new testsuite feature: test categories.
This feature allows us to group test cases into logical groups (categories), and to only run a subset of test cases based on these categories.

Each test-case can have a new method getCategories(self): which returns a list of strings that are the categories to which the test case belongs.
If a test-case does not provide its own categories, we will look for categories in the class that contains the test case.
If that fails too, the default implementation looks for a .category file, which contains a comma separated list of strings.
The test suite will recurse look for .categories up until the top level directory (which we guarantee will have an empty .category file).

The driver dotest.py has a new --category <foo> option, which can be repeated, and specifies which categories of tests you want to run.
(example: ./dotest.py --category objc --category expression)

All tests that do not belong to any specified category will be skipped. Other filtering options still exist and should not interfere with category filtering.
A few tests have been categorized. Feel free to categorize others, and to suggest new categories that we could want to use.

All categories need to be validly defined in dotest.py, or the test suite will refuse to run when you use them as arguments to --category.

In the end, failures will be reported on a per-category basis, as well as in the usual format.

This is the very first stage of this feature. Feel free to chime in with ideas for improvements!

llvm-svn: 164403
2012-09-21 19:10:53 +00:00
Greg Clayton 0c9773c6d5 Compile shared libraries with dSYM files when requested on darwin. Prior to this, we never had dSYM files for shared libraries unless it was a dylib only Makefile.
llvm-svn: 164322
2012-09-20 21:43:11 +00:00
Greg Clayton 48e0c2c82d <rdar://problem/12315386>
Test suite to catch fragile base class ivar issues.

llvm-svn: 164321
2012-09-20 21:38:45 +00:00
Enrico Granata 69277bac23 <rdar://problem/12161825> Rephrase formatter for NSIndexSet in terms of indexes instead of objects
llvm-svn: 164149
2012-09-18 18:06:37 +00:00
Enrico Granata 97fca507f4 <rdar://problem/11988289> Making C++ synthetic children provider for NSDictionary and related classes
llvm-svn: 164144
2012-09-18 17:43:16 +00:00
Enrico Granata b2698cdf59 <rdar://problem/11086338> Implementing support for synthetic children generated by running C++ code instead of Python scripts ; Adding a bunch of value-generating APIs to our private code layer ; Providing synthetic children for NSArray
llvm-svn: 163818
2012-09-13 18:27:09 +00:00
Filipe Cabecinhas 7d4c68a6ae Make TestAddDsymCommand not fail since bundles were accepted as add-dsym arguments.
llvm-svn: 163712
2012-09-12 14:43:45 +00:00
Jim Ingham 927bfa3fd9 Shortcut ThreadPlanStepRange::MischiefManaged - if we have pushed new plans and they are not done, then we aren't done either.
<rdar://problem/12259124>

llvm-svn: 163572
2012-09-10 23:42:44 +00:00
Jim Ingham 3a4599f6cb A bunch of test cases for inlined stepping.
llvm-svn: 163436
2012-09-07 23:58:16 +00:00
Enrico Granata 3467d80ba3 <rdar://problem/11485744> Implement important data formatters in C++. Have the Objective-C language runtime plugin expose class descriptors objects akin to the objc_runtime.py Pythonic implementation. Rewrite the data formatters for some core Cocoa classes in C++ instead of Python.
llvm-svn: 163155
2012-09-04 18:47:54 +00:00
Greg Clayton 5ec9645f83 Patch from Filipe Cabecinhas that uses argparse in dotest.py instead of a hand coded option. I made a few modifications:
Changed the '-A' option to also have a long option of '--arch'. This is now specified multiple times to get multiple architectures.

Old: -A i386^x86_64
New: -A i386 -A x86_64
     --arch i386 --arch x86_64
     
Changed the '-C' option to also have a long option of '--compiler'. This is now specified multiple times to get multiple compiler.

Old: -C clang^gcc
New: -C clang -C gcc
     --compiler clang --compiler gcc
llvm-svn: 163141
2012-09-04 15:42:49 +00:00
Greg Clayton 1f7460716b <rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". 
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()

Cleaned up header includes a bit as well.

llvm-svn: 162860
2012-08-29 21:13:06 +00:00
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