summaryrefslogtreecommitdiffstats
path: root/lldb/examples/synthetic/gnu_libstdcpp.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix libstdc++ data formatters for python3Pavel Labath2019-03-181-2/+3
| | | | | | | Use floor-division for consistentcy across python versions. This fixes a couple of libstdc++ data formatter tests. llvm-svn: 356377
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-432/+460
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Fix regression in gnu_libstdcpp.py introduced by r266313Ulrich Weigand2016-04-141-1/+1
| | | | | | CreateChildAtOffset needs a byte offset, not an element number. llvm-svn: 266352
* Miscellaneous fixes for big-endian systemsUlrich Weigand2016-04-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a bunch of issues that show up on big-endian systems: - The gnu_libstdcpp.py script doesn't follow the way libstdc++ encodes bit vectors: it should identify the enclosing *word* and then access the appropriate bit within that word. Instead, the script simply operates on bytes. This gives the same result on little-endian systems, but not on big-endian. - lldb_private::formatters::WCharSummaryProvider always assumes wchar_t is UTF16, even though it could also be UTF8 or UTF32. This is mostly not an issue on little-endian systems, but immediately fails on BE. Fixed by checking the size of wchar_t like WCharStringSummaryProvider already does. - ClangASTContext::GetChildCompilerTypeAtIndex uses uint32_t to access the virtual base offset stored in the vtable, even though the size of this field matches the target pointer size according to the C++ ABI. Again, this is mostly not visible on LE, but fails on BE. - Process::ReadStringFromMemory uses strncmp to search for a terminator consisting of multiple zero bytes. This doesn't work since strncmp will stop already at the first zero byte. Use memcmp instead. Differential Revision: http://reviews.llvm.org/D18983 llvm-svn: 266313
* Fix tabs and spaces in one of the python files.Zachary Turner2015-10-261-16/+14
| | | | llvm-svn: 251308
* Fix libstdc++ data formatters on Ubuntu 15.10 x86_64Todd Fiala2015-10-221-7/+21
| | | | | | See http://reviews.llvm.org/D13964 for details. llvm-svn: 250965
* Py3'ify some of the examples that get run at startup.Zachary Turner2015-10-191-4/+4
| | | | | | | | | | Even though these are under examples/, they actually get loaded when LLDB starts up during initialization of ScriptInterpreterPython. There's obviously some kind of layering issue here (and comments in the code even point to that as well), but for now just make them py3 compatible. llvm-svn: 250710
* [libstdc++ data-formatters] Remove size limits.Siva Chandra2015-10-131-11/+0
| | | | | | | | | | Reviewers: granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13682 llvm-svn: 250131
* Fix typos.Bruce Mitchener2015-09-221-2/+2
| | | | | | | | | | | | Summary: Another round of minor typo fixes. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13026 llvm-svn: 248243
* Fix StdVBoolImplementation to handle large vectorsTamas Berghammer2015-03-251-2/+3
| | | | | | | | | | The previous implementation only read out the first element of the underlying storage array. Because of it only the first 32 (on x86) or the first 64 (on x86_64) element was displayed. Differential revision: http://reviews.llvm.org/D8585 llvm-svn: 233179
* Cleanup to simplify the formatter for std::map of libstdc++.Siva Chandra2015-03-181-33/+11
| | | | | | | | | | | | | | | | | | Summary: GCC does not emit some DWARF required for the simplified formatter to work. A workaround for it has been incorporated in the formatter. The corresponding test TestDataFormatterStdMap has also been enabled for GCC. Test Plan: dotest.py -C <clang|gcc> -p TestDataFormatterStdMap Reviewers: clayborg, vharron, granata.enrico Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8424 llvm-svn: 232678
* Implement formatter for std::vector<bool, ...> of libstdc++ in Python.Siva Chandra2015-03-171-68/+126
| | | | | | | | | | | | | | | | | | | Summary: The existing formatter in C++ has been removed as it was not being used. The associated test TestDataFormatterStdVBool.py has been enabled for both Clang and GCC on Linux. Test Plan: dotest.py -p TestDataFormatterStdVBool Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8390 llvm-svn: 232548
* Cleanup implementation of formatter for std::vector from libstdc++.Siva Chandra2015-03-161-11/+1
| | | | | | | | | | | | | | Summary: Removed unused variables and methods. Test Plan: dotest.py -p TestDataFormatterStdVector Reviewers: vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8368 llvm-svn: 232434
* <rdar://problem/12848118>Enrico Granata2012-12-101-20/+2
| | | | | | | Making MightHaveChildren() always return true regardless for our own data formatters This is meant to optimize performance for common most-often-not-empty container classes llvm-svn: 169759
* <rdar://problem/12523238> Commit 2 of 3Enrico Granata2012-10-231-0/+27
| | | | | | | | | | | Adding the new has_children (or MightHaveChildren() in C++) for the existing synthetic children providers In a few cases, the new call is going to be much more efficient than the previous num_children > 0 check When the optimization was marginal (e.g. std::vector<>), the choice was to use num_children in order to keep implementation details in one function instead of duplicating code Next step is to provide test cases llvm-svn: 166506
* Data formatters for libc++ deque and shared/weak ptrs - a contribution by ↵Enrico Granata2012-08-271-1/+1
| | | | | | Jared Grubb llvm-svn: 162680
* Returning data formatters to their previous working condition - Plus fixing ↵Enrico Granata2012-04-251-30/+30
| | | | | | an issue that was preventing Python oneliners from executing llvm-svn: 155563
* Fixing an over-substitution of textEnrico Granata2012-04-251-30/+30
| | | | llvm-svn: 155556
* Make the C++ formatters importable by having them use the right package to ↵Enrico Granata2012-04-251-31/+31
| | | | | | import and reference the Logger llvm-svn: 155555
* Fixing a problem where some uninitialized cases of vectors could cause ↵Enrico Granata2012-04-101-1/+6
| | | | | | diagnostic output from the synthetic children providers - this time the fix should work llvm-svn: 154361
* Making sure the count on synthetic providers is always setup - This should ↵Enrico Granata2012-03-311-2/+6
| | | | | | prevent errors about count being undefined from showing up llvm-svn: 153791
* Added some logging to STL synthetic children providers - this should help us ↵Enrico Granata2012-03-301-0/+12
| | | | | | catch problems; more logging might/will be added as needed llvm-svn: 153750
* Part 1 of a series of fixes meant to improve reliability and increase ease ↵Enrico Granata2012-03-291-1/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Synthetic values are now automatically enabled and active by default. ↵Enrico Granata2012-03-271-12/+28
| | | | | | | | | | | | 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
* Massive enumeration name changes: a number of enums in ValueObject were not ↵Enrico Granata2012-03-191-3/+0
| | | | | | | | | | | | | | | | | | 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
* Changed ValueObject to use a dedicated ChildrenManager class to store its ↵Enrico Granata2012-03-091-1/+55
| | | | | | | | | | | | | | | children, instead of an std::vector This solves an issue where a ValueObject was getting a wrong children count (usually, a huge value) and trying to resize the vector of children to fit that many ValueObject* Added a loop detection algorithm to the synthetic children provider for std::list Added a few more checks to the synthetic children provider for std::vector Both std::list and std::vector's synthetic children providers now cache the count of children instead of recomputing it every time std::map has a field that stores the count, so there is little need to cache it on our side llvm-svn: 152371
* fixing comment to reflect that currentversion of OSX works with our STL ↵Enrico Granata2012-02-081-1/+1
| | | | | | formatters llvm-svn: 150085
* Fixing issues where synthetic children providers for STL containers ↵Enrico Granata2012-02-031-64/+41
| | | | | | std::list and std::map where not doing their job properly llvm-svn: 149700
* Fixing a startup errorEnrico Granata2011-08-221-1/+1
| | | | llvm-svn: 138237
* Exception-awareness for gnu_libstdcpp formatters ; Documentation updateEnrico Granata2011-08-221-95/+136
| | | | llvm-svn: 138236
* First round of code cleanups:Enrico Granata2011-08-171-0/+231
- all instances of "vobj" have been renamed to "valobj" - class Debugger::Formatting has been renamed to DataVisualization (defined in FormatManager.h/cpp) The interface to this class has not changed - FormatCategory now uses ConstString's as keys to the navigators instead of repeatedly casting from ConstString to const char* and back all the time Next step is making the same happen for categories themselves - category gnu-libstdc++ is defined in the constructor for a FormatManager The source code for it is defined in gnu_libstdcpp.py, drawn from examples/synthetic at compile time All references to previous 'osxcpp' name have been removed from both code and file names Functional changes: - the name of the option to use a summary string for 'type summary add' has changed from the previous --format-string to the new --summary-string. It is expected that the short option will change from -f to -s, and -s for --python-script will become -o llvm-svn: 137886
OpenPOWER on IntegriCloud