summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Get lldb-server building on android-9Vince Harron2015-05-121-0/+3
| | | | | | Build lldb-server with an android-9 sysroot. llvm-svn: 237078
* Make a more complete fix for always supplying an execution context when ↵Greg Clayton2015-02-121-1/+1
| | | | | | | | | | getting byte sizes from types. There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime. Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use. llvm-svn: 228892
* Preparatory infrastructural work to support dynamically determining sizes of ↵Enrico Granata2015-01-281-1/+1
| | | | | | | | | | | | ObjC types via the runtime This is necessary because the byte size of an ObjC class type is not reliably statically knowable (e.g. because superclasses sit deep in frameworks that we have no debug info for) The lack of reliable size info is a problem when trying to freeze-dry an ObjC instance (not the pointer, the pointee) This commit lays the foundation for having language runtimes help in figuring out byte sizes, and having ClangASTType ask for runtime help No feature change as no runtime actually implements the logic, and nowhere is an ExecutionContext passed in yet llvm-svn: 227274
* Remove the last vestige of the world before data formatters :-)Enrico Granata2014-12-101-0/+46
| | | | | | | | Function pointers had a summary generated for them bypassing formatters, directly as part of the ValueObject subsystem This patch transitions that code into a hardcoded summary llvm-svn: 223906
* This patch does a few things:Enrico Granata2014-12-091-1/+1
| | | | | | | | | | - adds a new flag to mark ValueObjects as "synthetic children generated" - vends new Create functions as part of the SyntheticChildrenFrontEnd that set the flag automatically - moves synthetic child providers over to using these new functions No visible feature change, but preparatory work for feature change llvm-svn: 223819
* Add the ability for the NSString and libc++ std::string formatters to ↵Enrico Granata2014-11-181-4/+11
| | | | | | retrieve uncapped data llvm-svn: 222277
* LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166Shawn Best2014-11-081-0/+3
| | | | llvm-svn: 221570
* This is a large, but clearical, commit that enables the C++ formatters to ↵Enrico Granata2014-11-061-23/+23
| | | | | | take on the additional TypeSummaryOptions argument. It is still not used for anything, but it is now there. Adding support for this extra argument to Python formatters will follow suit llvm-svn: 221486
* Add a setting escape-non-printables that drives whether the StringPrinter ↵Enrico Granata2014-11-051-14/+13
| | | | | | | | | | | should or should not escape sequences such as \t, \n, .. and generally any non-printing character The recent StringPrinter changes made this behavior the default, and the setting defaults to yes If you want to change this behavior and see non-printables unescaped (e.g. "a\tb" as "a b"), set it to false Fixes rdar://12969594 llvm-svn: 221399
* Also port the C string reading code in ValueObject over to using ↵Enrico Granata2014-10-301-7/+18
| | | | | | StringPrinter API llvm-svn: 220917
* Start adopting the StringPrinter API. The StringPrinter API is the new ↵Enrico Granata2014-10-301-377/+68
| | | | | | blessed way of printing strings that supports escaping non-printables, and has better handling of different UTF encodings llvm-svn: 220894
* Fix the NSPathStore2 data formatter to actually handle the explicit length ↵Enrico Granata2014-10-291-1/+26
| | | | | | stored inside the object. The meat of this commit, however, is a nice little API for easily adding new __lldb_autogen_ helper types to an AST context llvm-svn: 220881
* Expose the type-info flags at the public API layer. These flags provide much ↵Enrico Granata2014-10-211-2/+2
| | | | | | more informational content to consumers of the LLDB API than the existing TypeClass. Part of the fix for rdar://18517593 llvm-svn: 220322
* Remove unreachable code.Jason Molenda2014-10-161-4/+0
| | | | llvm-svn: 219911
* Improve the way the ObjC data formatters fetch a valid frame to use for ↵Enrico Granata2014-07-301-4/+22
| | | | | | | | | | running expressions against This is not bullet-proof, as you might end up running in a thread where you shouldn't, but the previous policy had the same drawback Also, in cases where code-running formatters were being recursively applied, the previous policy caused deeper levels to fail, whereas this will at least get such scenarios to function We might eventually want to consider disqualifying certain threads/frames for "viability", but I'd rather keep it simple until complexity is proven to be necessary llvm-svn: 214337
* Initial merge of some of the iOS 8 / Mac OS X Yosemite specificJason Molenda2014-06-131-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
* Better error reporting when a variable can't beSean Callanan2014-02-281-5/+23
| | | | | | | | | | | read during materialization. First of all, report if we can't read the data for some reason. Second, consult the ValueObject's error and report that if there's some problem. <rdar://problem/16074201> llvm-svn: 202552
* This patch does a couple of things. Jim Ingham2013-11-071-15/+15
| | | | | | | | | | | | | | | | | | | | | | It completes the job of using EvaluateExpressionOptions consistently throughout the inferior function calling mechanism in lldb begun in Greg's patch r194009. It removes a handful of alternate calls into the ClangUserExpression/ClangFunction/ThreadPlanCallFunction which were there for convenience. Using the EvaluateExpressionOptions removes the need for them. Using that it gets the --debug option from Greg's patch to work cleanly. It also adds another EvaluateExpressionOption to not trap exceptions when running expressions. You shouldn't use this option unless you KNOW your expression can't throw beyond itself. This is: <rdar://problem/15374885> At present this is only available through the SB API's or python. It fixes a bug where function calls would unset the ObjC & C++ exception breakpoints without checking whether they were set by somebody else already. llvm-svn: 194182
* Roll back the changes I made in r193907 which created a new FrameJason Molenda2013-11-041-4/+4
| | | | | | | | | | pure virtual base class and made StackFrame a subclass of that. As I started to build on top of that arrangement today, I found that it wasn't working out like I intended. Instead I'll try sticking with the single StackFrame class -- there's too much code duplication to make a more complicated class hierarchy sensible I think. llvm-svn: 193983
* Add a new base class, Frame. It is a pure virtual function whichJason Molenda2013-11-021-4/+4
| | | | | | | | | | | | | | | | | | | | | defines a protocol that all subclasses will implement. StackFrame is currently the only subclass and the methods that Frame vends are nearly identical to StackFrame's old methods. Update all callers to use Frame*/Frame& instead of pointers to StackFrames. This is almost entirely a mechanical change that touches a lot of the code base so I'm committing it alone. No new functionality is added with this patch, no new subclasses of Frame exist yet. I'll probably need to tweak some of the separation, possibly moving some of StackFrame's methods up in to Frame, but this is a good starting point. <rdar://problem/15314068> llvm-svn: 193907
* Use standard boolean operators.Virgile Bello2013-08-271-3/+3
| | | | llvm-svn: 189367
* MingW compilation (windows). Includes various refactoring to improve ↵Virgile Bello2013-08-231-0/+2
| | | | | | portability. llvm-svn: 189107
* Huge change to clean up types.Greg Clayton2013-07-111-22/+19
| | | | | | | | 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
* <rdar://problem/14005652>Enrico Granata2013-06-191-105/+2
| | | | | | Fixing a bug with the NSString data formatter where some strings would be truncated llvm-svn: 184336
* Fix various build warnings.Matt Kopec2013-06-031-0/+2
| | | | llvm-svn: 183140
* An NSData with 0 bytes in it would report a summary of “0 byte”Enrico Granata2013-05-311-1/+1
| | | | | | Making sure that I get my English right by saying “0 bytes” instead llvm-svn: 182978
* <rdar://problem/13928053>Enrico Granata2013-05-171-1/+6
| | | | | | Fix the fact that an empty NSString (e.g. one obtained from @"" would show no summary) llvm-svn: 182173
* <rdar://problem/13821289>Enrico Granata2013-05-151-11/+52
| | | | | | Changes to the libc++ std::string data formatter llvm-svn: 181855
* Make a synthetic children provider for the ObjC Class typeEnrico Granata2013-04-261-0/+50
| | | | llvm-svn: 180588
* char32_t should use an uppercase U as its prefixEnrico Granata2013-04-231-1/+1
| | | | llvm-svn: 180148
* The new ReadStringFromMemory() API does not work correctly with NSStrings ↵Enrico Granata2013-04-231-54/+250
| | | | | | | | | 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
* Fixed some linux buildbot warnings.Greg Clayton2013-04-191-1/+1
| | | | llvm-svn: 179892
* Provided a variant of ReadCStringFromMemory that supports null terminators ↵Ashok Thirumurthi2013-04-191-4/+7
| | | | | | | | | | | | | | | | | | 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
* Fixing a silly bug that would cause string summaries not to show up :-)Enrico Granata2013-04-021-2/+9
| | | | llvm-svn: 178590
* <rdar://problem/13415737>Enrico Granata2013-04-021-16/+144
| | | | | | | | 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
* Hardening the vector iterator synthetic child(ren) provider against ↵Enrico Granata2013-03-281-1/+3
| | | | | | item-not-in-cluster asserts llvm-svn: 178265
* The formatters for std::shared_ptr, std::weak_ptr, std::list, std::vector ↵Enrico Granata2013-03-191-819/+1
| | | | | | | | 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
* This checkin removes the last Cocoa formatters that were implemented in ↵Enrico Granata2013-03-191-0/+127
| | | | | | 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
* C++ formatters for NSTimeZone and for CFBitVectorEnrico Granata2013-03-161-0/+177
| | | | llvm-svn: 177219
* NS(Mutable)IndexSet formatter moves from Python to C++Enrico Granata2013-03-161-0/+78
| | | | llvm-svn: 177217
* Converting more data formatters to C++ - NSBundle, CFBinaryHeap, NSMachPort ↵Enrico Granata2013-03-161-1/+160
| | | | | | and NSNotification llvm-svn: 177213
* Porting the Objective-C Class data type’s summary from Python to C++Enrico Granata2013-03-151-0/+26
| | | | llvm-svn: 177172
* Moving CFBag and NSBundle summaries from Python to C++Enrico Granata2013-03-151-0/+112
| | | | | | Temporarily disabled non-code-running summaries for CF*Dictionary and NSCountedSet llvm-svn: 177171
* Cleanup of the NSString data formatterEnrico Granata2013-02-211-37/+46
| | | | llvm-svn: 175792
* <rdar://problem/4529976>Enrico Granata2013-02-211-286/+37
| | | | | | | 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
* Fixing the lack of a space in an expression that was causing sheer unhappiness.Enrico Granata2013-02-191-1/+1
| | | | llvm-svn: 175478
* NSSet formatter is now C++ codeEnrico Granata2013-02-151-893/+42
| | | | | | | | Split some NS* formatters in their own source files Refactored a utility function for the C++ formatters to use Fixed the skip-summary test case to be explicit about requiring libstdc++ for operation llvm-svn: 175323
* <rdar://problem/13204647>Enrico Granata2013-02-151-11/+22
| | | | | | | | The SEL data formatter was working hard to ensure that pointers-to-selectors could be formatted by the same block of code. In that effort, we were taking the address-of a SEL. This operation fails when the SEL lives in a register, and was causing problems. The formatter has been fixed to work correctly without assuming &selector will be a valid object. llvm-svn: 175227
* Fixing a logic flaw with NSURL summary. This was caught by running the test ↵Enrico Granata2013-02-081-3/+3
| | | | | | suite in 32bit mode llvm-svn: 174778
* Fixed a store to data that isn't needed and that also could end up writing ↵Greg Clayton2013-02-081-2/+1
| | | | | | beyond the end of the buffer. This was found by the address sanitizer. llvm-svn: 174755
OpenPOWER on IntegriCloud