summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language/ObjC
Commit message (Collapse)AuthorAgeFilesLines
* Add support for additional NSArray formattersEnrico Granata2016-04-112-2/+41
| | | | llvm-svn: 265979
* Add a formatter for zero-sized NSDataEnrico Granata2016-04-111-0/+4
| | | | llvm-svn: 265978
* Remove what I believe are the last known instances of formatters that run codeEnrico Granata2016-04-081-38/+22
| | | | llvm-svn: 265865
* Remove even more of the data formatters that silently run codeEnrico Granata2016-04-083-20/+0
| | | | | | Fixes <rdar://problem/25629755> llvm-svn: 265849
* Remove more of the code-running ObjC data formatter supportEnrico Granata2016-04-013-139/+40
| | | | llvm-svn: 265181
* On some platforms, the compiler is allowed to assume that BOOL == bool. On ↵Enrico Granata2016-03-151-6/+12
| | | | | | | | | | | | others, BOOL == signed char. This can cause differences in which bit patterns end up meaning YES or NO. In general, however, 0 == NO and 1 == YES. To keep it simple, LLDB will now show "YES" and "NO" only for 1 and 0 respectively, and format other values as the plain numeric value instead. Fixes rdar://24809994 llvm-svn: 263604
* Make it so that the data formatter for NSError can see through a variable of ↵Enrico Granata2016-03-152-26/+34
| | | | | | type NSError**. Fixes rdar://25060684 llvm-svn: 263603
* Fix warning in NSDictionary.cppPavel Labath2016-03-011-1/+1
| | | | llvm-svn: 262322
* Fix a typo in my previous commit. This would cause mutable NSArrays to show ↵Enrico Granata2016-02-291-1/+1
| | | | | | up empty llvm-svn: 262260
* Add an LLDB data formatter for single-element NSArray and NSDictionary Cocoa ↵Enrico Granata2016-02-293-25/+248
| | | | | | | | containers Fixes rdar://23715118 llvm-svn: 262254
* Fix Clang-tidy modernize-use-nullptr warnings in source/Plugins/Language; ↵Eugene Zelenko2016-02-296-111/+115
| | | | | | other minor fixes. llvm-svn: 262246
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-0/+1
| | | | | | the right thing and break. llvm-svn: 261950
* The data formatters for NSArray, NSDictionary and (only partially) NSSet ↵Enrico Granata2016-02-123-158/+7
| | | | | | | | | | | | | | | | | contain logic to inspect the objects without running code. However, they also contain fallback logic that - in cases where LLDB can't recognize the specific subclass - actually does run code in order to inspect those objects. The argument for this logic was that these data types are critical enough that the risk of getting it wrong is outweighed by the advantage of always providing accurate child information. Practical experience however shows that "po" - a code running data-inspection command - is quite frequently used, and not considered burdensome by users. As such, this makes the code-running fallback in the data formatters a risk that carries very little actual reward. Also, unlike the time this code was originally written, we now have accurate class information for Objective-C, and thus we are less likely to improperly identify classes. This commit removes support for the code-running fallback, and aligns the data formatters for NSArray, NSDictionary and NSSet to the general no-code-running behavior of other data formatters. While it is possible for us to add support for some subclasses that are now no longer covered by static inspection alone, this is beyond the scope of this commit. llvm-svn: 260664
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Turns out, many people define structs named Point that do not share the same ↵Enrico Granata2015-12-181-1/+1
| | | | | | names that this formatter uses for fields; use the {} syntax to make it so that a failure to parse the summary doesn't cause the entire printout to fail llvm-svn: 256042
* Introduce a way for Languages to specify whether values of "reference types" ↵Enrico Granata2015-11-102-0/+15
| | | | | | | | | | are "nil" (not pointing to anything) or uninitialized (never made to point at anything) This latter determination may or may not be possible on a per-language basis; and neither is mandatory to implement for any language Use this knowledge in the ValueObjectPrinter to generalize the notion of IsObjCNil() and the respective printout llvm-svn: 252663
* Fix some Clang-tidy warnings and formatting in recently added code.Eugene Zelenko2015-11-072-46/+46
| | | | | | | | | | | Fixed Clang-tidy warnings: * modernize-use-override; * modernize-use-nullptr; * modernize-use-default; * readability-simplify-boolean-expr. llvm-svn: 252374
* Add data formatters for NSError and NSExceptionEnrico Granata2015-11-065-0/+457
| | | | llvm-svn: 252269
* Do not accept nullptr descriptions as valid summaries to be printedEnrico Granata2015-10-291-2/+7
| | | | llvm-svn: 251663
* Change Target::EvaluateExpression to take an ExecutionContextScope * rather ↵Jim Ingham2015-10-282-0/+2
| | | | | | | | | | | | | | | | than a StackFrame * (StackFrame is an ExecutionContextScope.) That allows you to call an expression on a particular Thread, but not using the context of any particular frame. That in turn is useful for injecting utility functions that don't actually depend on locals/self/etc of the current frame. I also had to include StackFrame.h in a couple of places so the compiler knew how to downcast StackFrame to ExecutionContextScope. <rdar://problem/22852953> llvm-svn: 251564
* Rationalization of includes in the data formatters codeEnrico Granata2015-10-202-1/+4
| | | | llvm-svn: 250798
* Fix Clang-tidy modernize-use-override warnings in source/Plugins/Language; ↵Eugene Zelenko2015-10-207-336/+340
| | | | | | | | other minor fixes. Differential Revision: http://reviews.llvm.org/D13876 llvm-svn: 250789
* Add a data formatter for __NSArray0, the type of empty arraysEnrico Granata2015-10-142-0/+74
| | | | llvm-svn: 250341
* This is the work I was building up to with my patches yesterdayEnrico Granata2015-10-079-95/+429
| | | | | | | | | Introduce the notion of Language-based formatter prefix/suffix This is meant for languages that share certain data types but present them in syntatically different ways, such that LLDB can now have language-based awareness of which of the syntax variations it has to present to the user when formatting those values This is goodness for new languages and interoperability, but is NFC for existing languages. As such, existing tests cover this llvm-svn: 249587
* Enable the StringPrinter to have prefixes that are strings instead of just a ↵Enrico Granata2015-10-071-7/+7
| | | | | | single character; and also introduce a comparable suffix mechanism llvm-svn: 249506
* Introduce a variant of GetSummaryAsCString() that takes a LanguageType ↵Enrico Granata2015-10-071-5/+5
| | | | | | | | argument, and use it when crafting summaries by running selectors This is the first in a series of commits that are meant to teach LLDB how to properly handle multi-language formatting of values llvm-svn: 249503
* Fix the CMake buildEnrico Granata2015-10-021-0/+1
| | | | llvm-svn: 249189
* Add hooks that enable NSSet, NSDictionary and NSString formatting to apply ↵Enrico Granata2015-10-029-389/+586
| | | | | | | | to other types beyond the well-known ones This is meant to support languages that can do some sort of bridging from<-->to these ObjC types via types that statically vend themselves as Cocoa types, but dynamically have an implementation that does not match any of our well-known types, but where an introspecting formatter can be vended by the bridged language llvm-svn: 249185
* Made GetScratchTypeSystemForLanguage return an error if desired.Sean Callanan2015-10-021-1/+1
| | | | | | | Also made it not store nullptrs in its TypeSystemMap, so it will retry to make the AST context if it errored out last time. llvm-svn: 249167
* Teach 'type lookup' to pull types from clang modules; also add a test caseEnrico Granata2015-10-021-16/+39
| | | | llvm-svn: 249117
* Fix Android build after r249047.Oleksiy Vyalov2015-10-011-1/+1
| | | | llvm-svn: 249055
* Add a 'type lookup' command. This command is meant to look up type ↵Enrico Granata2015-10-012-0/+91
| | | | | | | | | | information by name in a language-specific way. Currently, it only supports Objective-C - C++ types can be looked up through debug info via 'image lookup -t', whereas ObjC types via this command are looked up by runtime introspection This behavior is in line with type lookup's behavior in Xcode 7, but I am definitely open to feedback as to what makes the most sense here llvm-svn: 249047
* Rename clang_type -> compiler_type for variables.Bruce Mitchener2015-09-241-11/+11
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13102 llvm-svn: 248461
* Make the ObjCLanguageRuntimes comply with llvm-style RTTIEnrico Granata2015-09-231-1/+1
| | | | llvm-svn: 248427
* TypeSystem is now a plugin interface and removed any "ClangASTContext ↵Greg Clayton2015-09-172-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | &Class::GetClangASTContext()" functions. This cleans up type systems to be more pluggable. Prior to this we had issues: - Module, SymbolFile, and many others has "ClangASTContext &GetClangASTContext()" functions. All have been switched over to use "TypeSystem *GetTypeSystemForLanguage()" - Cleaned up any places that were using the GetClangASTContext() functions to use TypeSystem - Cleaned up Module so that it no longer has dedicated type system member variables: lldb::ClangASTContextUP m_ast; ///< The Clang AST context for this module. lldb::GoASTContextUP m_go_ast; ///< The Go AST context for this module. Now we have a type system map: typedef std::map<lldb::LanguageType, lldb::TypeSystemSP> TypeSystemMap; TypeSystemMap m_type_system_map; ///< A map of any type systems associated with this module - Many places in code were using ClangASTContext static functions to place with CompilerType objects and add modifiers (const, volatile, restrict) and to make typedefs, L and R value references and more. These have been made into CompilerType functions that are abstract: class CompilerType { ... //---------------------------------------------------------------------- // Return a new CompilerType that is a L value reference to this type if // this type is valid and the type system supports L value references, // else return an invalid type. //---------------------------------------------------------------------- CompilerType GetLValueReferenceType () const; //---------------------------------------------------------------------- // Return a new CompilerType that is a R value reference to this type if // this type is valid and the type system supports R value references, // else return an invalid type. //---------------------------------------------------------------------- CompilerType GetRValueReferenceType () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a const modifier to this type if // this type is valid and the type system supports const modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddConstModifier () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a volatile modifier to this type if // this type is valid and the type system supports volatile modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddVolatileModifier () const; //---------------------------------------------------------------------- // Return a new CompilerType adds a restrict modifier to this type if // this type is valid and the type system supports restrict modifiers, // else return an invalid type. //---------------------------------------------------------------------- CompilerType AddRestrictModifier () const; //---------------------------------------------------------------------- // Create a typedef to this type using "name" as the name of the typedef // this type is valid and the type system supports typedefs, else return // an invalid type. //---------------------------------------------------------------------- CompilerType CreateTypedef (const char *name, const CompilerDeclContext &decl_ctx) const; }; Other changes include: - Removed "CompilerType TypeSystem::GetIntTypeFromBitSize(...)" and CompilerType TypeSystem::GetFloatTypeFromBitSize(...) and replaced it with "CompilerType TypeSystem::GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding, size_t bit_size);" - Fixed code in Type.h to not request the full type for a type for no good reason, just request the forward type and let the type expand as needed llvm-svn: 247953
* Teach the ObjC data formatters to use the correct language when printing stringsEnrico Granata2015-09-151-0/+7
| | | | llvm-svn: 247727
* This patch makes Clang-independent base classes for all the expression types ↵Jim Ingham2015-09-152-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that lldb currently vends. Before we had: ClangFunction ClangUtilityFunction ClangUserExpression and code all over in lldb that explicitly made Clang-based expressions. This patch adds an Expression base class, and three pure virtual implementations for the Expression kinds: FunctionCaller UtilityFunction UserExpression You can request one of these expression types from the Target using the Get<ExpressionType>ForLanguage. The Target will then consult all the registered TypeSystem plugins, and if the type system that matches the language can make an expression of that kind, it will do so and return it. Because all of the real expression types need to communicate with their ExpressionParser in a uniform way, I also added a ExpressionTypeSystemHelper class that expressions generically can vend, and a ClangExpressionHelper that encapsulates the operations that the ClangExpressionParser needs to perform on the ClangExpression types. Then each of the Clang* expression kinds constructs the appropriate helper to do what it needs. The patch also fixes a wart in the UtilityFunction that to use it you had to create a parallel FunctionCaller to actually call the function made by the UtilityFunction. Now the UtilityFunction can be asked to vend a FunctionCaller that will run its function. This cleaned up a lot of boiler plate code using UtilityFunctions. Note, in this patch all the expression types explicitly depend on the LLVM JIT and IR, and all the common JIT running code is in the FunctionCaller etc base classes. At some point we could also abstract that dependency but I don't see us adding another back end in the near term, so I'll leave that exercise till it is actually necessary. llvm-svn: 247720
* Fix CMake build.Chaoren Lin2015-09-142-0/+2
| | | | | | | - Typo: Coca.cpp -> Cocoa.cpp - Missing include. llvm-svn: 247628
* Move Objective-C data formatters to the Objective-C language plugin where ↵Enrico Granata2015-09-1413-0/+4514
| | | | | | they belong llvm-svn: 247627
* Data formatter candidate matches can be generated in a number of ways; ↵Enrico Granata2015-09-092-3/+43
| | | | | | | | | | language-based dynamic type discovery being one of them (for instance, this is what takes an 'id' and discovers that it truly is an __NSArrayI, so it should probably use the NSArray formatter) This used to be hardcoded in the FormatManager, but in a pluginized world that is not the right way to go So, move this step to the Language plugin such that appropriate language plugins for a type get a say about adding candidates to the formatters lookup tables llvm-svn: 247112
* Fix Makefile buildKeno Fischer2015-09-051-0/+14
| | | | llvm-svn: 246932
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Fix ObjCLanguage::MethodName::GetCategory after r246616; I was just moving ↵Jim Ingham2015-09-031-1/+1
| | | | | | things around too fast... llvm-svn: 246736
* Move more functionality from the LanguageRuntimes to the Languages.Jim Ingham2015-09-022-0/+363
| | | | llvm-svn: 246616
* Fixup one of the CMakeListsEnrico Granata2015-08-271-2/+2
| | | | llvm-svn: 246220
* Add a new type of plugin: Language pluginEnrico Granata2015-08-273-0/+136
The Language plugin is menat to answer language-specific questions that are not bound to the existence of a process. Those are still the domain of the LanguageRuntime plugin The Language plugin will, instead, answer questions such as providing language-specific data formatters or expression evaluation At the moment, the interface is hollowed out, and empty do-nothing plugins have been setup for ObjC, C++ and ObjC++ llvm-svn: 246212
OpenPOWER on IntegriCloud