Commit Graph

86 Commits

Author SHA1 Message Date
Richard Mitton 83f0f88954 Updated CMakeLists to match XCode project
llvm-svn: 190573
2013-09-12 02:20:39 +00:00
Enrico Granata e2e220a805 <rdar://problem/14071463>
SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb
This checkin converts that sample script to a C++ provider built into LLDB
A test case is also provided

llvm-svn: 190564
2013-09-12 00:48:47 +00:00
Virgile Bello f02a3c599b Use standard boolean operators.
llvm-svn: 189367
2013-08-27 16:24:58 +00:00
Virgile Bello b2f1fb2943 MingW compilation (windows). Includes various refactoring to improve portability.
llvm-svn: 189107
2013-08-23 12:44:05 +00:00
Michael Sartain 89c862f298 clean up about 22 warnings messages
llvm-svn: 187900
2013-08-07 19:05:15 +00:00
Enrico Granata ea9f9e8e06 Disabling the introspecting summary for __NSCFSet (essentially, for CF*SetRef)
llvm-svn: 186362
2013-07-15 23:17:32 +00:00
Greg Clayton 57ee306789 Huge change to clean up types.
A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error.

This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness.

llvm-svn: 186130
2013-07-11 22:46:58 +00:00
Enrico Granata e602fe1e7f Adding a summary for ObjC blocks
llvm-svn: 186023
2013-07-10 18:25:45 +00:00
Enrico Granata c2a96407c5 Remove the #define USE_CACHE since the formatters cache has been operational for a while now and has not caused issues that warrant disabling it
Also, print the cache hits statistics if the log is in debugging mode vs. LLDB being a debug build - this should make it easier to gather useful metrics on cache success rate for real users

llvm-svn: 184900
2013-06-26 01:03:38 +00:00
Enrico Granata c71f349a9e <rdar://problem/14005652>
Fixing a bug with the NSString data formatter where some strings would be truncated

llvm-svn: 184336
2013-06-19 19:15:29 +00:00
Andy Gibbs a297a97e09 Sort out a number of mismatched integer types in order to cut down the number of compiler warnings.
llvm-svn: 184333
2013-06-19 19:04:53 +00:00
Enrico Granata 68ae4117d9 <rdar://problem/12717717>
Modifying our data formatters matching algorithm to ensure that "const X*" is treated as equivalent to "X*"
Also, a couple improvements to the "lldb types" logging

llvm-svn: 184215
2013-06-18 18:23:07 +00:00
Enrico Granata 6f63001879 Removing a redundant write
llvm-svn: 183814
2013-06-12 00:32:31 +00:00
Greg Clayton 3fb543b06d Remove eFormatHalfFloat as it isn't needed. eFormatFloat should be used and the byte size will tell us how to display it.
llvm-svn: 183755
2013-06-11 17:32:06 +00:00
Enrico Granata 97fe23e00a <rdar://problem/12783351>
Add support for half-floats, as specified by IEEE-754-2008
With this checkin, you can now say:
(lldb) x/7hf foo

to read 7 half-floats at address foo

llvm-svn: 183716
2013-06-11 00:18:18 +00:00
Enrico Granata 4c648b1884 <rdar://problem/14101771>
Hardening the CFBitVector data formatter against failed reads

llvm-svn: 183706
2013-06-10 22:26:15 +00:00
Enrico Granata b26fdada54 <rdar://problem/13125225>
Adding data formatters for std::set, std::multiset and std::multimap for libc++
The underlying data structure is the same as std::map, so this change is very minimal and mostly consists of test cases

llvm-svn: 183323
2013-06-05 17:47:23 +00:00
Enrico Granata 983920d1a9 <rdar://problem/14003462>
Formatters for unsigned char* and const variant

llvm-svn: 183254
2013-06-04 21:53:55 +00:00
Matt Kopec ef14371d3f Fix various build warnings.
llvm-svn: 183140
2013-06-03 18:00:07 +00:00
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