Commit Graph

58 Commits

Author SHA1 Message Date
Enrico Granata 0126132e2f Tweaking a comment in the NSURL formatter for correctness - the code was doing the right thing, but the comment was highly misleading
llvm-svn: 170441
2012-12-18 19:22:05 +00:00
Enrico Granata 37c3e9104c <rdar://problem/12817233>
Change the wording of NSNumber summary from absurd value to unexpected value when a tagged pointer shows up that does not match our knowledge of the internals

llvm-svn: 169751
2012-12-10 19:23:00 +00:00
Enrico Granata 7b3d205ee3 Changing the NSDate data formatter to use GetData().uint64[] instead of relying on SBValue.GetValueAsUnsigned() to reinterpret a double as a uint64_t
llvm-svn: 166610
2012-10-24 19:05:32 +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 5d31103974 <rdar://problem/11398693> Making sure we do not attempt to run code on zombie objects when attempting to format them
llvm-svn: 164156
2012-09-18 18:34:14 +00:00
Enrico Granata 63d2a23618 Fix a potential issue where data formatters can get confused over malformed UUIDs
llvm-svn: 164151
2012-09-18 18:15:27 +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 39cf67e573 <rdar://problem/12068655> Make sure [NSDate distantPast] is formatted correctly
llvm-svn: 163162
2012-09-04 20:02:39 +00:00
Enrico Granata 7a204359dc Editing a comment to make sure people know not to blame CFString.py for CFString summary errors
llvm-svn: 163157
2012-09-04 19:18:17 +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
Filipe Cabecinhas bbb648ef80 Make the objc-runtime work with Python 2.6
llvm-svn: 161111
2012-08-01 14:38:37 +00:00
Jim Ingham 584745a692 Added a few more summaries I find useful for lldb.
llvm-svn: 160909
2012-07-28 00:37:21 +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 811e9055fd <rdar://problem/11753405> Making sure we deal correctly with signed NSNumber values
llvm-svn: 160179
2012-07-13 18:53:14 +00:00
Enrico Granata 7c015e1020 Fixes for performance to data formatters - Python < 3.0 is much slower when using True/False as compared to 1/0 for logical values. Wexploit this to our advantage. Other minor tweaks
llvm-svn: 157209
2012-05-21 21:52:38 +00:00
Enrico Granata 263ebe5f78 Optimizations to the Python ObjC formatters - Benchmarking infrastructure
llvm-svn: 157066
2012-05-18 19:55:37 +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
Enrico Granata 9123950ab1 A simple implementation of a summary and synthetic children providers for LLDB-specific shared pointers - This could be generalized to work with C++11 shared pointers with relative ease
llvm-svn: 156410
2012-05-08 19:21:13 +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
Enrico Granata de93b6b42f Fixing a typo in the NSArray data formatter
llvm-svn: 155586
2012-04-25 20:59:02 +00:00
Enrico Granata 7d22221759 Returning data formatters to their previous working condition - Plus fixing an issue that was preventing Python oneliners from executing
llvm-svn: 155563
2012-04-25 17:53:41 +00:00
Enrico Granata 28399adad8 Making the Cocoa formatters comply with the new on-disk layout of the Python resources - This is one of the steps towards making the data formatters work again
llvm-svn: 155526
2012-04-25 01:39:27 +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
Enrico Granata 51e318737a One last syntax error fix
llvm-svn: 153911
2012-04-02 23:49:34 +00:00
Enrico Granata a20e863875 Fixing syntax typos in Python formatters
llvm-svn: 153910
2012-04-02 23:43:22 +00:00
Enrico Granata 98bcde4264 Removing some instances of str(SBValue)
llvm-svn: 153899
2012-04-02 21:37:02 +00:00
Enrico Granata 247bd419ce Logging for data formatters.
llvm-svn: 153878
2012-04-02 16:39:29 +00:00
Enrico Granata a7daeebbff Fixing a whole class of crashers and potential crashers related to data formatters eating up all the stack when an unknown class has to be summarized ; this should make the whole Objective-C summaries more stable
llvm-svn: 153712
2012-03-30 00:51:12 +00:00
Enrico Granata d50f18b1a0 Part 1 of a series of fixes meant to improve reliability and increase ease of bug fixing for data formatter issues.
We are introducing a new Logger class on the Python side. This has the same purpose, but is unrelated, to the C++ logging facility
The Pythonic logging can be enabled by using the following scripting commands:
(lldb) script Logger._lldb_formatters_debug_level = {0,1,2,...}
0 = no logging
1 = do log
2 = flush after logging each line - slower but safer
3 or more = each time a Logger is constructed, log the function that has created it
more log levels may be added, each one being more log-active than the previous
by default, the log output will come out on your screen, to direct it to a file:
(lldb) script Logger._lldb_formatters_debug_filename = 'filename'
that will make the output go to the file - set to None to disable the file output and get screen logging back
Logging has been enabled for the C++ STL formatters and for Cocoa class NSData - more logging will follow


synthetic children providers for classes list and map (both libstdcpp and libcxx) now have internal capping for safety reasons
this will fix crashers where a malformed list or map would not ever meet our termination conditions

to set the cap to a different value:

(lldb) script {gnu_libstdcpp|libcxx}.{map|list}_capping_size = new_cap (by default, it is 255)

you can optionally disable the loop detection algorithm for lists

(lldb) script {gnu_libstdcpp|libcxx}.list_uses_loop_detector = False

llvm-svn: 153676
2012-03-29 19:29:45 +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 f981060503 Adding missing file
llvm-svn: 153559
2012-03-28 02:16:50 +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 3f1052b7cf The Cocoa formatters now provide error messages for many of the common things-went-wrong situations. Previously they would say nothing or log failures to the Python console
llvm-svn: 152673
2012-03-13 21:52:00 +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 332b0b9a2f Fixing a problem with the NSSet summary provider; plus, providing a further optimization to the whole Cocoa formatters infrastructure
llvm-svn: 152423
2012-03-09 19:04:53 +00:00
Enrico Granata eb55ad4ad7 the formatter for NSNotification was not being initialized correctly
llvm-svn: 152358
2012-03-09 00:45:19 +00:00
Enrico Granata eb06e25242 Fixing some of the new Python formatters to report '1 object' instead of '1 objects'
llvm-svn: 152186
2012-03-07 00:56:09 +00:00
Enrico Granata cfdafa37b4 Several performance-oriented changes to the introspecting data formatters:
(a) the SystemParameters object is now passed around to the formatters; doing so enables the formatters to reuse computed values for things such as pointer-size and endianness
     instead of repeatedly computing these on their own
 (b) replacing the global ISA cache with a per-process one
 (c) providing a per-process types cache where each formatter can store the types it needs to operate, and be sure to find them the next time without recalculating them
     this also enables formatters to share types if they agree on a local naming convention
 (d) lazy fetching of data from Objective-C runtime data structures
     data is fetched as needed and we stop reading as soon as we determine that an ISA is actually garbage

llvm-svn: 152052
2012-03-05 19:56:33 +00:00
Enrico Granata 385ad4e401 added a new formatter for CF(Mutable)BitVector
fixed a few potential NULL-pointer derefs in ValueObject
we have a way to provide docstrings for properties we add to the SWIG layer - a few of these properties have a docstring already, more will come in future commits
added a new bunch of properties to SBData to make it more natural and Python-like to access the data they contain

llvm-svn: 151962
2012-03-03 00:45:57 +00:00
Enrico Granata cdf38a7ffb Removing a spurious print statement leftover from debugging the formatter code
llvm-svn: 151928
2012-03-02 18:35:06 +00:00
Enrico Granata 8d5c83f6ef (a) adding formatters for:
NSTimeZone and CFTimeZonRef
 SEL and related types
 CFGregorianDate

llvm-svn: 151866
2012-03-02 00:55:53 +00:00
Enrico Granata 74ec8f9c50 this fixes unicode strings handling in 32-bit mode on Lion
llvm-svn: 151831
2012-03-01 19:48:54 +00:00
Enrico Granata 896cd1d3e6 (a) adding an introspection formatter for NS(Mutable)IndexSet
(b) fixes and improvements to the formatters for NSDate and NSString
(c) adding an introspection formatter for NSCountedSet
(d) making the Objective-C formatters test cases pass on both 64 and 32 bit
    one of the test cases is marked as expected failure on i386 - support needs to be added to the LLDB core for it to pass

llvm-svn: 151826
2012-03-01 19:32:33 +00:00
Enrico Granata 0c489f58cd 1) solving a bug where, after Jim's fixes to stack frames, synthetic children were not recalculated when necessary, causing them to get out of sync with live data
2) providing an updated list of tagged pointers values for the objc_runtime module - hopefully this one is final
3) changing ValueObject::DumpValueObject to use an Options class instead of providing a bulky list of parameters to pass around
   this change had been laid out previously, but some clients of DumpValueObject() were still using the old prototype and some arguments
   were treated in a special way and passed in directly instead of through the Options class
4) providing new GetSummaryAsCString() and GetValueAsCString() calls in ValueObject that are passed a formatter object and a destination string
   and fill the string by formatting themselves using the formatter argument instead of the default for the current ValueObject
5) removing the option to have formats and summaries stick to a variable for the current stoppoint
   after some debate, we are going with non-sticky: if you say frame variable --format hex foo, the hex format will only be applied to the current command execution and not stick when redisplaying foo
   the other option would be full stickiness, which means that foo would be formatted as hex for its whole lifetime
   we are open to suggestions on what feels "natural" in this regard

llvm-svn: 151801
2012-03-01 04:24:26 +00:00
Enrico Granata 0448d9fe2b Fixing a problem with v1 runtime - plus hopefully finalizing the code to check for tagged pointers
llvm-svn: 151753
2012-02-29 20:46:00 +00:00
Enrico Granata 7bc0ec3aad This commit:
a) adds a Python summary provider for NSDate
 b) changes the initialization for ScriptInterpreter so that we are not passing a bulk of Python-specific function pointers around
 c) provides a new ScriptInterpreterObject class that allows for ref-count safe wrapping of scripting objects on the C++ side
 d) contains much needed performance improvements:
    1) the pointer to the Python function generating a scripted summary is now cached instead of looked up every time
    2) redundant memory reads in the Python ObjC runtime wrapper are eliminated
    3) summaries now use the m_summary_str in ValueObject to store their data instead of passing around ( == copying) an std::string object
 e) contains other minor fixes, such as adding descriptive error messages for some cases of summary generation failure

llvm-svn: 151703
2012-02-29 03:28:49 +00:00
Enrico Granata 21b2236303 Fixing an if condition which was causing issues in detecting the correct runtime version
llvm-svn: 151388
2012-02-24 19:46:04 +00:00
Enrico Granata b8cbe9cb4f fixing a syntax error with objc_runtime.py
llvm-svn: 151304
2012-02-23 23:26:48 +00:00
Enrico Granata eb4a479881 This patch provides a set of formatters for most of the commonly used Cocoa classes.
The formatter for NSString is an improved version of the one previously shipped as an example, the others are new in design and implementation.
A more robust and OO-compliant Objective-C runtime wrapper is provided for runtime versions 1 and 2 on 32 and 64 bit.
The formatters are contained in a category named "AppKit", which is not enabled at startup.

llvm-svn: 151300
2012-02-23 23:10:27 +00:00
Enrico Granata bac45f610d This commit provides a new default summary for Objective-C boolean variables, which shows YES or NO instead of the character value. A new category named objc is added to contain this summary provider. Any future Objective-C related formatters would probably fit here
llvm-svn: 149388
2012-01-31 17:01:51 +00:00