Commit Graph

67 Commits

Author SHA1 Message Date
Enrico Granata 1c333d071f An NSData with 0 bytes in it would report a summary of “0 byte”
Making sure that I get my English right by saying “0 bytes” instead

llvm-svn: 182978
2013-05-31 01:14:22 +00:00
Michael Sartain c3ce7f2740 Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors command line options.
settings set use-color [false|true]
settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} "
also "--no-use-colors" on the command prompt

llvm-svn: 182609
2013-05-23 20:47:45 +00:00
Enrico Granata 5a9c4fe272 <rdar://problem/13928053>
Fix the fact that an empty NSString (e.g. one obtained from @"" would show no summary)

llvm-svn: 182173
2013-05-17 23:28:13 +00:00
Jim Ingham 5c42d8a87c Fixed a few obvious errors pointed out by the static analyzer.
llvm-svn: 181911
2013-05-15 18:27:08 +00:00
Enrico Granata a3962a77cd <rdar://problem/13821289>
Changes to the libc++ std::string data formatter

llvm-svn: 181855
2013-05-15 00:47:46 +00:00
Enrico Granata 14b74fd153 <rdar://problem/11669154>
Make a summary format for libc++ STL containers that shows the number of items as before, but also shows the pointer value for pointer-to-container

llvm-svn: 181236
2013-05-06 18:55:52 +00:00
Enrico Granata 4ffff2791f Harden against potential empty nodes in the map
llvm-svn: 181045
2013-05-03 19:07:20 +00:00
Enrico Granata d03a273b96 <rdar://problem/13749871>
Improvements to the std::map data formatter to recognize when invalid memory is being explored and bail out instead of looping for a potentially very long time

llvm-svn: 181044
2013-05-03 19:04:35 +00:00
Enrico Granata cd67f97cb7 <rdar://problem/12529989>
Synthetic children provider for NSOrderedSet

llvm-svn: 180655
2013-04-27 00:27:20 +00:00
Enrico Granata c76b97bcce Make a synthetic children provider for the ObjC Class type
llvm-svn: 180588
2013-04-26 00:59:02 +00:00
Enrico Granata 3f8e40ce7a See: http://stackoverflow.com/questions/16166897/c-how-to-obtain-address-of-stdvector-object-in-lldb-xcode
The user was trying to obtain the address-of an std::vector and the experience was more painful than necessary because data formatters were kicking in for vector* objects
We got this right for libc++ - we should get it right for libstdc++ too

llvm-svn: 180219
2013-04-24 21:52:24 +00:00
Enrico Granata b636be79c0 Changes to the ObjC runtime
llvm-svn: 180199
2013-04-24 17:49:08 +00:00
Enrico Granata 66e0abb3bc Closing parentheses is good - doing it while respecting printf format specifiers is even better
llvm-svn: 180156
2013-04-23 22:38:25 +00:00
Enrico Granata c03c586d14 char32_t should use an uppercase U as its prefix
llvm-svn: 180148
2013-04-23 21:37:33 +00:00
Enrico Granata 906f2cbc65 Closing parentheses once they are open is a good idea
llvm-svn: 180142
2013-04-23 20:09:10 +00:00
Enrico Granata 5676839246 The new ReadStringFromMemory() API does not work correctly with NSStrings that have an explicit length and no NULL terminator
This checkin reverts NSString to the old behavior when appropriate, and cleans up the syntax to call the UTF Reader&Dumper function
Incidentally, add a "-d" command-line flag to redo.py with the same semantics as "-d" in dotest.py

llvm-svn: 180141
2013-04-23 20:05:05 +00:00
Enrico Granata 723e129aa2 <rdar://problem/13437949>
Making sure that CF*{Array|Dictionary}Ref provide synthetic children correctly.

llvm-svn: 180074
2013-04-23 01:13:50 +00:00
Enrico Granata dea46d7c38 Much better way to get at the size of an std::list
llvm-svn: 180071
2013-04-22 23:36:35 +00:00
Greg Clayton 03da4cc294 Fixed some linux buildbot warnings.
llvm-svn: 179892
2013-04-19 21:31:16 +00:00
Ashok Thirumurthi 6ac9d13e61 Provided a variant of ReadCStringFromMemory that supports null terminators of any character width.
This prevents unbounded reads (i.e. reads of GetMaximumSizeOfStringSummary() bytes)
from causing test failures (i.e. due to ptrace EIO or EFAULT on Linux).

Note that ReadCStringFromMemory is marked as deprecated because the loop that calls
ReadMemory does not continue until the string has been completely read.
The expected behavior is to read until until max_bytes or a null terminator.

Note: As discussed on lldb-dev, further testing will be performed with ReadStringFromMemory
before further changes are made for users of ReadCStringFromMemory.

Thanks to Enrico, Matt and Andy for their review feedback.

llvm-svn: 179857
2013-04-19 15:58:38 +00:00
Enrico Granata f15ee4e89f <rdar://problem/13563628>
Introducing a negative cache for ObjCLanguageRuntime::LookupInCompleteClassCache()
This helps speed up the (common) case of us looking for classes that are hidden deep within Cocoa internals and repeatedly failing at finding type information for them.
In order for this to work, we need to clean this cache whenever debug information is added. A new symbols loaded event is added that is triggered with add-dsym (before modules loaded would be triggered for both adding modules and adding symbols).
Interested parties can register for this event. Internally, we make sure to clean the negative cache whenever symbols are added.
Lastly, ClassDescriptor::IsTagged() has been refactored to GetTaggedPointerInfo() that also (optionally) returns info and value bits. In this way, data formatters can share tagged pointer code instead of duplicating the required arithmetic.

llvm-svn: 178897
2013-04-05 18:49:06 +00:00
Enrico Granata e98184322a <rdar://problem/13563697>
The __NSArrayI synthetic children provider was running expressions to generate children, which is inefficient for large amounts of data
Reimplementing to use a faster algorithm

llvm-svn: 178729
2013-04-04 01:12:12 +00:00
Jason Molenda c01e1b72ad #include clang's AST/DeclCXX.h to pick up CXXRecordDecl definition,
needed for some versions of clang.

llvm-svn: 178692
2013-04-03 20:32:17 +00:00
Enrico Granata eb8bd925c6 <rdar://problem/13563403>
Reimplemented the NSDictionary synthetic children provider for added performance.
Instead of generating pairs by running an expression, we now create a pair type using clang-level APIs and fill in a buffer with the pointers to key and value
This strategy takes the time required to dump a 10k items __NSDictionaryM from ~45s to <4s

llvm-svn: 178601
2013-04-03 01:25:29 +00:00
Enrico Granata 23ab35aed2 Fixing a silly bug that would cause string summaries not to show up :-)
llvm-svn: 178590
2013-04-02 23:07:55 +00:00
Enrico Granata d83bfce6d4 <rdar://problem/13415737>
Fixing a bug where LLDB was not handling correctly CFStrings that have an explicit length but no NULL terminator
The data formatter was showing garbled data as part of the summary
The fix is to explicitly figure out the explicit length if we need to (bitfields tell us when that is the case) and use that as a size delimiter

llvm-svn: 178577
2013-04-02 21:25:34 +00:00
Enrico Granata 320dcf6876 <rdar://problem/12410225>
By default, omit the children for a char[] and just show the string contents
Can be overridden by appropriate command-line flags

llvm-svn: 178292
2013-03-28 21:36:58 +00:00
Enrico Granata 6eca3559d6 Hardening the vector iterator synthetic child(ren) provider against item-not-in-cluster asserts
llvm-svn: 178265
2013-03-28 18:50:54 +00:00
Greg Clayton 5160ce5c72 <rdar://problem/13521159>
LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.

llvm-svn: 178191
2013-03-27 23:08:40 +00:00
Enrico Granata b65b3030b6 <rdar://problem/13339196>
The algorithm to access an item in a __NSArrayM was not reacting properly to deletions
The fix is to use a smarter formula that accounts for items shifting and the resulting notion of offsets in the table

llvm-svn: 178076
2013-03-26 21:44:13 +00:00
Enrico Granata 7c0788b2d9 Data formatters cleanup:
- Making an error message more consistent
- Ensuring the element size is not zero before using it in a modulus
- Properly using target settings to cap the std::list element count
- Removing spurious element size calculations that were unused
- Removing spurious capping in std::map

llvm-svn: 178057
2013-03-26 18:55:08 +00:00
Greg Clayton bb1beaa220 Don't crash when we have an element size of zero.
llvm-svn: 178056
2013-03-26 18:42:13 +00:00
Enrico Granata bdbda93f35 Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_Invalid
llvm-svn: 177558
2013-03-20 19:04:28 +00:00
Andy Gibbs caf4116c40 Update source/DataFormatters/CMakeLists.txt to reflect actual source files.
llvm-svn: 177511
2013-03-20 10:30:02 +00:00
Enrico Granata 92373533a5 The formatters for std::shared_ptr, std::weak_ptr, std::list, std::vector and std::map as provided by libc++ are now written in C++ instead of Python
std::deque is still in Python but is much less commonly used

llvm-svn: 177454
2013-03-19 22:58:48 +00:00
Enrico Granata 6d37cc6501 This checkin removes the last Cocoa formatters that were implemented in Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters
llvm-svn: 177366
2013-03-19 00:27:22 +00:00
Enrico Granata 9f71ad4fa8 C++ formatters for NSTimeZone and for CFBitVector
llvm-svn: 177219
2013-03-16 01:50:07 +00:00
Enrico Granata 6a92511a08 NS(Mutable)IndexSet formatter moves from Python to C++
llvm-svn: 177217
2013-03-16 01:18:00 +00:00
Enrico Granata 50b5ee5023 Converting more data formatters to C++ - NSBundle, CFBinaryHeap, NSMachPort and NSNotification
llvm-svn: 177213
2013-03-16 00:50:25 +00:00
Enrico Granata 559008649b Porting the Objective-C Class data type’s summary from Python to C++
llvm-svn: 177172
2013-03-15 18:55:30 +00:00
Enrico Granata f68f732746 Moving CFBag and NSBundle summaries from Python to C++
Temporarily disabled non-code-running summaries for CF*Dictionary and NSCountedSet

llvm-svn: 177171
2013-03-15 18:44:08 +00:00
Enrico Granata a221e4e89c Optimization of the code-running NSDictionary formatter to skip runtime symbol fetching
llvm-svn: 176041
2013-02-25 19:44:39 +00:00
Enrico Granata c358da2f4b If we crash while making a Python summary, the crash info will tell us more about it
llvm-svn: 175915
2013-02-22 20:01:15 +00:00
Enrico Granata 0337c27fcd The summary for const char* was not cascading.
This was preventing us from providing a summary for the result of std::string.c_str() with libc++

llvm-svn: 175841
2013-02-22 00:37:31 +00:00
Matt Kopec 676a48751d Fix clang warnings related to python macro redefinition and printf format specifiers.
llvm-svn: 175829
2013-02-21 23:55:31 +00:00
Daniel Malea b29cf48e56 Update CMake lists of sources to include files added in r175787 and r175323
llvm-svn: 175797
2013-02-21 21:16:52 +00:00
Daniel Malea 23720cc66c Adding CMake build system to LLDB. Some known issues remain:
- generate-vers.pl has to be called by cmake to generate the version number
- parallel builds not yet supported; dependency on clang must be explicitly specified

Tested on Linux.
- Building on Mac will require code-signing logic to be implemented.
- Building on Windows will require OS-detection logic and some selective directory inclusion

Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir
who ported them to Linux!

llvm-svn: 175795
2013-02-21 20:58:22 +00:00
Enrico Granata 87f00b43ab Cleanup of the NSString data formatter
llvm-svn: 175792
2013-02-21 20:31:18 +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
Enrico Granata eac4a48d23 Fixing the lack of a space in an expression that was causing sheer unhappiness.
llvm-svn: 175478
2013-02-19 01:14:06 +00:00