summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language/ObjC
Commit message (Collapse)AuthorAgeFilesLines
...
* 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