summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/FormatManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* <rdar://problem/12978143>Enrico Granata2013-01-281-1313/+0
| | | | | | | | | | | 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
* <rdar://problem/13069948>Greg Clayton2013-01-251-1/+1
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* Adding a custom summary for libc++ std::vector<bool>Enrico Granata2013-01-161-0/+4
| | | | | | | vector<bool> is specialized and the existing general summary for vectors would lie to the user. Tackling libstdc++ and synthetic children is the following, less critical, part of this task llvm-svn: 172671
* <rdar://problem/12790664>Enrico Granata2013-01-141-0/+19
| | | | | | Single-character Unicode data formatters llvm-svn: 172492
* Add ifdef LLDB_DISABLE_PYTHON around newly added use ofJason Molenda2013-01-121-0/+2
| | | | | | | | AddCXXSummary in FormatManager::LoadSystemFormatters(); that function pulls in code that assumes python; can't be used without the ifdef. llvm-svn: 172300
* <rdar://problem/12239827>Enrico Granata2013-01-121-2/+15
| | | | | | Making a summary for std::wstring as provided by libstdc++ along with a relevant test case llvm-svn: 172286
* <rdar://problem/12239827>Enrico Granata2013-01-121-2/+10
| | | | | | | | | 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
* <rdar://problem/11383764>Enrico Granata2013-01-111-0/+3
| | | | | | Making a data formatter for wchar_t * llvm-svn: 172165
* <rdar://problem/12725746>Enrico Granata2013-01-101-67/+77
| | | | | | | | Providing data formatters for char16_t* and char32_t* C++11-style Unicode strings Using this chance to refactor the UTF data reader used for data formatters for added generality Added a relevant test case llvm-svn: 172119
* <rdar://problem/12709976>Enrico Granata2012-12-101-130/+135
| | | | | | Adding a summary for NSError llvm-svn: 169792
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* Change DataExtractor::Dump() to use a series of if..else ifJason Molenda2012-11-011-2/+1
| | | | | | | | | | | statements instead of a switch for the size of the floating point types; some architectures sizeof double and sizeof long double are the same and that's invalid in a switch. Fix the LLDB_DISABLE_PYTHON ifdef block in FormatManager::LoadObjCFormatters so it builds on arm again. llvm-svn: 167263
* <rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it ↵Enrico Granata2012-10-291-19/+12
| | | | | | | | | does not automatically initialize the script interpreter in order to transfer its output file handle to it This should delay initialization of Python until strictly necessary and speed-up debugger startup Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes llvm-svn: 166967
* <rdar://problem/12437442>Enrico Granata2012-10-221-4/+16
| | | | | | | | | | | 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
* Ran the sources through the compiler with -Wshadow warningsJason Molenda2012-10-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | enabled after we'd found a few bugs that were caused by shadowed local variables; the most important issue this turned up was a common mistake of trying to obtain a mutex lock for the scope of a code block by doing Mutex::Locker(m_map_mutex); This doesn't assign the lock object to a local variable; it is a temporary that has its dtor called immediately. Instead, Mutex::Locker locker(m_map_mutex); does what is intended. For some reason -Wshadow happened to highlight these as shadowed variables. I also fixed a few obivous and easy shadowed variable issues across the code base but there are a couple dozen more that should be fixed when someone has a free minute. <rdar://problem/12437585> llvm-svn: 165269
* <rdar://problem/12099592> Adding back a bunch of code-running summariesEnrico Granata2012-10-031-0/+5
| | | | llvm-svn: 165186
* Update the LLDB_DISABLE_PYTHON ifdef in FormatManager::LoadObjCFormatters toJason Molenda2012-09-201-1/+1
| | | | | | get FormatManager.cpp to build on no-python platforms again. llvm-svn: 164284
* <rdar://problem/11988289> Making C++ synthetic children provider for ↵Enrico Granata2012-09-181-8/+18
| | | | | | NSDictionary and related classes llvm-svn: 164144
* Update LLDB_DISABLE_PYTHON #ifdefs in FormatManager.cpp to get itJason Molenda2012-09-151-7/+6
| | | | | | building on no-Python systems again. llvm-svn: 163961
* <rdar://problem/11086338> Implementing support for synthetic children ↵Enrico Granata2012-09-131-33/+53
| | | | | | 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
* Making the right thing with regards to disabling summaries on ↵Enrico Granata2012-09-041-7/+14
| | | | | | LLDB_DISABLE_PYTHON builds llvm-svn: 163170
* <rdar://problem/11485744> Implement important data formatters in C++. Have ↵Enrico Granata2012-09-041-32/+47
| | | | | | 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
* Data formatters for libc++ deque and shared/weak ptrs - a contribution by ↵Enrico Granata2012-08-271-2/+18
| | | | | | Jared Grubb llvm-svn: 162680
* <rdar://problem/10449092> Adding a new uppercase hex format specifier. This ↵Enrico Granata2012-08-091-1/+2
| | | | | | 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
* Added a 'void' format so that the user can manuallySean Callanan2012-08-081-1/+2
| | | | | | | | | suppress all non-error output from the "expression" command. <rdar://problem/11225150> llvm-svn: 161502
* <rdar://problem/11975483> Removing user-visible references to 'dict' as a ↵Enrico Granata2012-08-081-2/+2
| | | | | | parameter name for Python summary-generating functions since it is a Python keyword. llvm-svn: 161467
* <rdar://problem/11773899> Formatters for BOOL* and BOOL&Enrico Granata2012-07-131-2/+14
| | | | llvm-svn: 160181
* <rdar://problem/11628688> Making sure to use the ostype format for OSType valuesEnrico Granata2012-07-131-0/+11
| | | | llvm-svn: 160180
* <rdar://problem/11755446> Making sure to provide summaries for one more ↵Enrico Granata2012-06-281-1/+2
| | | | | | NSString subclass llvm-svn: 159389
* Add LLDB_DISABLE_PYTHON around newly added methods inJason Molenda2012-05-161-0/+6
| | | | | | | | DataVisualization.h / DataVisualization.cpp / ValueObject.cpp and FormatManager.h / FormatManager.cpp llvm-svn: 156886
* <rdar://problem/11338654> Fixing a bug where having a summary for a bitfield ↵Enrico Granata2012-05-081-0/+91
| | | | | | 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
* Automatically enabling the Cocoa formatter categories for command-line LLDB. ↵Enrico Granata2012-04-261-5/+5
| | | | | | 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
* Returning data formatters to their previous working condition - Plus fixing ↵Enrico Granata2012-04-251-79/+79
| | | | | | an issue that was preventing Python oneliners from executing llvm-svn: 155563
* adding a summary for Objective-C type 'Class'Enrico Granata2012-03-271-0/+1
| | | | llvm-svn: 153541
* Synthetic values are now automatically enabled and active by default. ↵Enrico Granata2012-03-271-10/+16
| | | | | | | | | | | | 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
* <rdar://problem/11113279>Greg Clayton2012-03-261-2/+2
| | | | | | | | | | 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
* Removing cascading through inheritance chains for data formattersEnrico Granata2012-03-221-5/+34
| | | | | | | | | | | | | | | 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
* Massive enumeration name changes: a number of enums in ValueObject were not ↵Enrico Granata2012-03-191-6/+3
| | | | | | | | | | | | | | | | | | 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
* The Cocoa formatters now provide error messages for many of the common ↵Enrico Granata2012-03-131-0/+2
| | | | | | things-went-wrong situations. Previously they would say nothing or log failures to the Python console llvm-svn: 152673
* Mark newly added synthesizer calls as being #ifndef LLDB_DISABLE_PYTHONJason Molenda2012-03-131-4/+2
| | | | llvm-svn: 152599
* Changed several of the Cocoa formatters to match the output style that Xcode ↵Enrico Granata2012-03-131-2/+2
| | | | | | | | | | | 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
* Added formatters for libc++ (http://libcxx.llvm.org):Enrico Granata2012-03-121-0/+54
| | | | | | | | | | | | | 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
* Use a new define, NO_XPC_SERVICES, to indicate that macosx/Host.mmJason Molenda2012-03-081-1/+2
| | | | | | | | | | | | | shouldn't compile any of the XPC support code. Update macosx/Host.mm to use that define. Add a LLDB_DISABLE_PYTHON ifdef block around a new function in Core/FormatManager.cpp. <rdar://problem/10942125> llvm-svn: 152293
* added a new formatter for CF(Mutable)BitVectorEnrico Granata2012-03-031-0/+3
| | | | | | | | 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
* having std::vector still show children even if it now has a builtin summary ↵Enrico Granata2012-03-021-0/+1
| | | | | | - having the std::vector test case deal with the fact that we now have said builtin summary llvm-svn: 151870
* (a) adding formatters for:Enrico Granata2012-03-021-9/+28
| | | | | | | | NSTimeZone and CFTimeZonRef SEL and related types CFGregorianDate llvm-svn: 151866
* (a) adding an introspection formatter for NS(Mutable)IndexSetEnrico Granata2012-03-011-2/+11
| | | | | | | | | (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
* This commit:Enrico Granata2012-02-291-0/+2
| | | | | | | | | | | | | 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
* This patch provides a set of formatters for most of the commonly used Cocoa ↵Enrico Granata2012-02-231-1/+71
| | | | | | | | | | 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: 151299
* Patch Enrico's changes from r150558 on 2012-02-14 to build even if PythonJason Molenda2012-02-211-0/+4
| | | | | | | | | | | | is not available (LLDB_DISABLE_PYTHON is defined). Change build-swig-Python.sh to emit an empty LLDBPythonWrap.cpp file if this build is LLDB_DISABLE_PYTHON. Change the "Copy to Xcode.app" shell script phase in the lldb.xcodeproj to only do this copying for Mac native builds. llvm-svn: 151035
OpenPOWER on IntegriCloud