Commit Graph

152 Commits

Author SHA1 Message Date
Enrico Granata b294fd2037 <rdar://problem/14035604>
Fixing an issue where formats would not propagate from parents to children in all cases
Details follow:
an SBValue has children and those are fetched along with their values
Now, one calls SBValue::SetFormat() on the parent
Technically, the format choices should propagate onto the children (see ValueObject::GetFormat())
But if the children values are already fetched, they won't notice the format change and won't update themselves
This commit fixes that by making ValueObject::GetValueAsCString() check if any format change intervened from the previous call to the current one
A test case is also added

llvm-svn: 183030
2013-05-31 19:18:19 +00:00
Ashok Thirumurthi 6eb0cadda7 Refactors to provide two variants for evaluation of text_list:
- The original test now passes on Linux with clang because a breakpoint is hit prior to evaluation of text_list, which improves text coverage.
- The new test fails because 4 steps are requested, and only two occur prior to evaluation of text_list.
--- Note that the loss of every second "next" command can be reproduced using lldb manually with this script.

llvm-svn: 182860
2013-05-29 14:58:27 +00:00
Daniel Malea e8bdd1f5c0 Clean up linux test decorators and add links to known bugs
- s/skipOnLinux/skipIfLinux/ to match style of every other decorator
- linkify bugizilla/PR numbers in comments

No intended change in functionality.

llvm-svn: 181913
2013-05-15 18:48:32 +00:00
Enrico Granata da144dc216 Changing the std::map test case to use source breakpoints instead of relying on the nexting always "getting it right" to stop at the locations of interest
This should make us more robust in the face of changing compiler line tables and other library modifications

llvm-svn: 181497
2013-05-09 01:04:59 +00:00
Daniel Malea 32052b62ae Fix rdar-13338477 test-case for Linux.
- Using __builtin_trap confuses the stack unwinder
- __builtin_trap specific test will be added shortly

llvm-svn: 181441
2013-05-08 15:07:24 +00:00
Enrico Granata a9a50ffb02 <rdar://problem/13338477>
clang sugarcoats expressions of the sort *(int (*)[3])foo where foo is an int* saying that their type class is Paren
This checkin updates our lookup tables to properly desugar Paren into the actual type of interest

llvm-svn: 180938
2013-05-02 18:54:54 +00:00
Enrico Granata a4f8741cfa Splitting the appkit data formatters test in smaller test cases - this should enable us to get a more detailed perspective on which individual data formatters are broken
llvm-svn: 180128
2013-04-23 18:07:30 +00:00
Enrico Granata c540f57ffc Checking that the wrong syntax does not give a correct summary after clearing the error messages here
llvm-svn: 177949
2013-03-26 00:24:27 +00:00
Greg Clayton fe736e889e Fix the buildbot so a LLDB test doesn't fail looking for "<invalid usage of pointer value as object>".
llvm-svn: 177926
2013-03-25 22:04:11 +00:00
Daniel Malea 658fd5798b Un-skipping tests affected by llvm.org/pr15256
patch by Ashok Thirumurthi!

llvm-svn: 176462
2013-03-04 23:15:08 +00:00
Daniel Malea 208b5beb60 Fix makefile and re-enable test disabled due to llvm.org/pr15256
- fix is: don't pass incompatible -stdlib option when building with GCC

llvm-svn: 176460
2013-03-04 23:04:53 +00:00
Jim Ingham d882998eff Fix the .categories, it had "dataformatter" not "dataformatters".
Remove the getCategory from TestDataFormatterObjC.py, since it was superceded by the .categories file, 
and didn't work anyway (getCategories currently has to be a method on the test class, not on the test.)
Add a "basic_process" category, and start to find some tests for simple process running sniff tests.

llvm-svn: 176061
2013-02-25 23:51:06 +00:00
Enrico Granata ea2bc0fb1f <rdar://problem/4529976>
Adding data formatters for iterators for std::map and std::vector (both libc++ and libstdcpp)
This does not include reverse iterators since they are both trickier (due to requirements the standard imposes on them) and much less useful

llvm-svn: 175787
2013-02-21 19:57:10 +00:00
Daniel Malea 5b7c14b3c8 A few more GCC specific test fixes as per logged PRs:
- TestNamespace expected to fail due to PR-15302
- TestCPPBool and TestUnsignedTypes updated to handle GCC style debug information
- TestRvalueReferences expected fail due to GCC (4.7) not outputting rvalue-reference debug information
- TestDataFormatterStdVBool expected to fail due to PR-15301

llvm-svn: 175551
2013-02-19 19:54:16 +00:00
Daniel Malea a9b732a32a Update TestVBool Makefile to allow building test program with gcc
- do not pass (incompatible option) -stdlib=libstdc++ option if using GCC as test compiler

llvm-svn: 175522
2013-02-19 15:53:47 +00:00
Enrico Granata 9f02e0912d <rdar://problem/12529957>
Synthetic children provider for NSSet

llvm-svn: 175468
2013-02-18 23:16:23 +00:00
Enrico Granata f615b80d08 NSSet formatter is now C++ code
Split some NS* formatters in their own source files
Refactored a utility function for the C++ formatters to use
Fixed the skip-summary test case to be explicit about requiring libstdc++ for operation

llvm-svn: 175323
2013-02-15 23:38:37 +00:00
Daniel Malea e78ecc2cc7 More test case cleanup (Linux and Mac):
- remove expectedFailure decorator from resolved rdar 12566646 and 10887661
- remove expectedFailure from TestBitfields testcase not actually affected by bug
- skip the (non-deterministic) TestStopHookMechanism.py to avoid a noisy suite on Linux

llvm-svn: 175307
2013-02-15 21:27:14 +00:00
Matt Kopec 3c0ed76a9d Skip another two other tests asserting on Linux in RecordLayoutBuilder::updateExternalFieldOffset().
llvm-svn: 175103
2013-02-13 22:59:58 +00:00
Daniel Malea f406891857 Skip tests that assert on Linux in RecordLayoutBuilder::updateExternalFieldOffset()
- Filed bugzilla PR-15256

llvm-svn: 175065
2013-02-13 18:56:41 +00:00
Enrico Granata cb9870dad8 Being explicit about which std c++ library these test cases need to use
llvm-svn: 174437
2013-02-05 20:05:31 +00:00
Enrico Granata 3b1b2dabda <rdar://problem/12953018>
Synthetic children and summary for std::vector<bool> (for both libcxx and libstdcpp).
std::vector<bool> is a special case and is custom-implemented to be a vector of bits, which means we failed to handle it with the standard std::vector<T> formatter.
This checkin provides custom formatters that work correctly

llvm-svn: 174333
2013-02-04 22:54:42 +00:00
Enrico Granata 5548cb50b2 <rdar://problem/12978143>
Data formatters now cache themselves.
This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval.
Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization.
The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime.
Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type.
Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose.

llvm-svn: 173728
2013-01-28 23:47:25 +00:00
Daniel Malea be230793fb Mark test cases affected by PR 15036 (GCC-generated DWARF causes parser crash)
- Add new decorator "@skipIfGcc" to lldbtest.py

llvm-svn: 173394
2013-01-24 23:52:09 +00:00
Enrico Granata e274088db0 <rdar://problem/12239827>
Making a summary for std::wstring as provided by libstdc++ along with a relevant test case

llvm-svn: 172286
2013-01-12 01:22:57 +00:00
Enrico Granata 3309d88198 <rdar://problem/12239827>
Providing a data formatter for libc++ std::wstring
In the process, refactoring the std::string data formatter to be written in C++ so that commonalities between the two can be exploited
Also, providing a new API on the ValueObject to navigate a hierarchy by index-path
Lastly, an appropriate test case is included

llvm-svn: 172282
2013-01-12 01:00:22 +00:00
Enrico Granata b576bba229 <rdar://problem/12028723>
Adding useful formatting options to the expression (expr) command.
As a side effect of this change, the -d option now supports the same three-values enumeration that frame variables uses (run, don't run, none) instead of a boolean like it did previously

These options do not apply to print, p or po because these are aliased to not take any options.
In order to use them, use expression or expr.

llvm-svn: 171993
2013-01-09 20:12:53 +00:00
Sean Callanan 7be70e8528 This patch removes the SymbolFileSymtab support
for reporting class types from Objective-C runtime
class symbols.  Instead, LLDB now queries the 
Objective-C runtime for class types.

We have also added a (minimal) Objective-C runtime
type vendor for Objective-C runtime version 1, to 
prevent regressions when calling class methods in
the V1 runtime.

Other components of this fix include:

- We search the Objective-C runtime in a few more
  places.

- We enable enumeration of all members of
  Objective-C classes, which Clang does in certain
  circumstances.

- SBTarget::FindFirstType and SBTarget::FindTypes
  now query the Objective-C runtime as needed.

- I fixed several test cases.

<rdar://problem/12885034>

llvm-svn: 170601
2012-12-19 23:05:01 +00:00
Andrew Kaylor 8013df71c7 Skip libc++ data formatter tests on Linux because there is no standard location for the makefile to find libc++.
llvm-svn: 170575
2012-12-19 19:32:40 +00:00
Enrico Granata 9e7b388589 <rdar://problem/11689939>
Supporting a compact display syntax for ObjC pointers where 0x00.....0 is replaced by a much more legible "nil"
e.g. this would show:
(NSArray *) $2 = nil
instead of:
(NSArray *) $2 = 0x0000000000000000 <nil>

llvm-svn: 170161
2012-12-13 23:50:33 +00:00
Enrico Granata 7b8c513f08 Option changes:
the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command.

All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o)

This is a breaking change:
frame variable used --objc as the long option name
expression used -o as a shortcut
memory read uses --objd as the long option name

Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works

The test suite has been tweaked accordingly.

llvm-svn: 169961
2012-12-12 03:23:37 +00:00
Enrico Granata 9d14084b45 Adding a validation callback mechanism to OptionValueString (such a feature might theoretically be added to the general OptionValue base class should the need arise)
Using this mechanism, making sure that the options to pass a summary string or a named summary to frame variable do not have invalid values

<rdar://problem/11576143>

llvm-svn: 169927
2012-12-11 22:42:19 +00:00
Enrico Granata e6a6d9ae07 <rdar://problem/12709976>
Adding a summary for NSError

llvm-svn: 169792
2012-12-10 23:30:25 +00:00
Greg Clayton 3bcdfc0ec1 <rdar://problem/12798131>
Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite.

This fix does the following:
- make sure all short options are treated as "int"
- make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired
- fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates
- fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value

llvm-svn: 169189
2012-12-04 00:32:51 +00:00
Daniel Malea 4bd152d8e6 Disable darwin-specific test on non-darwin platforms
llvm-svn: 168454
2012-11-21 20:17:07 +00:00
Enrico Granata 44818163ed <rdar://problem/12523238> Commit 3 of 3
Changed all relevant test cases to verify that MightHaveChildren() works correctly for objects of interest
Added a bunch of convenience methods for test cases to use: target(), process(), thread() and frame() which mimic the lldb.X convenience variables
As a bonus, edited the documentation on the website to describe the new method available for synthetic children providers writers to implement!

That's all folks!

llvm-svn: 166535
2012-10-24 01:23:57 +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
Enrico Granata e3fcd2bb53 <rdar://problem/12426557> Fixing the NSIndexSet data formatter
llvm-svn: 165341
2012-10-05 22:58:46 +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
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
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
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
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
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
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
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