summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
Commit message (Collapse)AuthorAgeFilesLines
...
* [LLDB] Insert names with same signo as alias instead of a new entryMohit K. Bhakkad2015-10-201-41/+52
| | | | | | | | Reviewers: clayborg, labath. Subscribers: jaydeep, dsanders, bhushan, sagar, nitesh.jain, emaste,lldb-commits. Differential Revision: http://reviews.llvm.org/D13646 llvm-svn: 250801
* Added support for the "--repl" argument to LLDB. Sean Callanan2015-10-201-3/+9
| | | | | | | | | This makes LLDB launch and create a REPL, specifying no target so that the REPL can create one for itself. Also added the "--repl-language" option, which specifies the language to use. Plumbed the relevant arguments and errors through the REPL creation mechanism. llvm-svn: 250773
* Make sure we restore the process events so they aren't hijacked when using ↵Greg Clayton2015-10-201-11/+18
| | | | | | | | the async attach when attaching to a process by name and with waitfor. <rdar://problem/22821480> llvm-svn: 250768
* Added the concept of a Read-Eval-Print-Loop to LLDB.Sean Callanan2015-10-191-0/+32
| | | | | | | | | | | | | | | | A REPL takes over the command line and typically treats input as source code. REPLs can also do code completion. The REPL class allows its subclasses to implement the language-specific functionality without having to know about the IOHandler-specific internals. Also added a PluginManager-based way of getting to a REPL given a language and a target. Also brought in some utility code and expression options that are useful for REPLs, such as line offsets for expressions, ANSI terminal coloring of errors, and a few IOHandler convenience functions. llvm-svn: 250753
* Let Language plugins vend a default DeclPrintingHelper in case a custom one ↵Enrico Granata2015-10-191-0/+6
| | | | | | is not specified for the specific invocation llvm-svn: 250744
* Add a missing Mutex Locker in ResetCurrentInlinedDepthKeno Fischer2015-10-161-0/+2
| | | | | | | | | | | | | | Summary: This function reads m_frames, so it needs to lock the mutex like all other function that access m_frames. Found using AddressSanitizer. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13638 llvm-svn: 250493
* Factor the execution of the test method into a separate function to ensure ↵Adrian McCarthy2015-10-151-1/+1
| | | | | | | | that any exceptions that are thrown go out of scope and no longer hold references to SB objects that need to be freed before teardown. Differential Revision: http://reviews.llvm.org/D13788 llvm-svn: 250467
* Minor indentation fix in StackFrameList.cpp.Stephane Sezer2015-10-151-3/+3
| | | | llvm-svn: 250465
* Make uses of /dev/null portable across OSes.Zachary Turner2015-10-142-2/+4
| | | | | | | | | Most platforms have "/dev/null". Windows has "nul". Instead of hardcoding the string /dev/null at various places, make a constant that contains the correct value depending on the platform, and use that everywhere instead. llvm-svn: 250331
* ArchSpec: fix unintentional promotion of unspecified unknowns to specified ↵Todd Fiala2015-10-133-8/+25
| | | | | | | | | | | | | | | | | | | | | unknowns * ArchSpec::MergeFrom() would erroneously promote an unspecified unknown to a specified unknown when both the ArchSpec and the merged in ArchSpec were both unspecified unknowns. This no longer happens, which fixes issues with global module cache lookup in some situations. * Added ArchSpec::DumpTriple(Stream&) that now properly prints unspecified unknowns as '*' and specified unknows as 'unknown'. This makes it trivial to tell the difference between the two. Converted printing code over ot using DumpTriple() rather than building from scratch. * Fixed up a couple places that were not guaranteeing that an unspecified unknown was recorded as such. llvm-svn: 250253
* Fix a misunderstanding of the ThreadPlan::OkayToDiscard flag in ↵Jim Ingham2015-10-121-9/+84
| | | | | | | | | | | | | InferiorCallPOSIX. It was set to true, but all plans run by RunThreadPlan need to have this set to false so they will return control to RunThreadPlan without consulting plans higher on the stack. Since this seems like a common error, I also modified RunThreadPlan to enforce this behavior. <rdar://problem/22543166> llvm-svn: 250084
* Return the right answer for ShouldStop for the RunToAddress plan. This isn'tJim Ingham2015-10-121-1/+1
| | | | | | | strictly necessary because RunToAddress is always used as a subsidiary plan, so it's ShouldStop seldom matters. But get it right anyway. llvm-svn: 250083
* Don't blindly use C for eLanguageTypeUnknown when getting a scratch TypeSystem.Sean Callanan2015-10-091-1/+20
| | | | | | | | | | Instead check what languages are supported for expressions; use C if available, but otherwise pick one of the supported languages. This can be overridden using the target settings. <rdar://problem/22290878> llvm-svn: 249864
* Added support for enumerating the languages that actually support TypeSystemsSean Callanan2015-10-081-0/+12
| | | | | | | and expressions. Also wired that into the OptionValue infrastructure, although it isn't used for tab-completion yet. llvm-svn: 249769
* Moved the target specific ClangASTContext initialization over into ↵Greg Clayton2015-10-081-99/+39
| | | | | | | | ClangASTContext::CreateInstance. This involved changing the TypeSystem::CreateInstance to take a module or a target. This allows type systems to create an AST for modules (no expression support needed) or targets (expression support is needed) and return the correct class instance for both cases. llvm-svn: 249747
* This is the work I was building up to with my patches yesterdayEnrico Granata2015-10-071-0/+7
| | | | | | | | | 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
* Resumbit "Fix race condition during process detach"Pavel Labath2015-10-071-40/+40
| | | | | | | This is a resubmission of r248371. It also incorporates the process event hijack patch by Kyrill Lapshin in D12968. llvm-svn: 249554
* [LLDB][MIPS] Fix hit_count for mips watchpointsMohit K. Bhakkad2015-10-061-1/+4
| | | | | | | | Reviewers: clayborg, jingham. Subscribers: jaydeep, bhushan, dsanders, sagar, nitesh.jain, zturner, jasonmolenda, lldb-commits. Differential Revision: http://reviews.llvm.org/D13241 llvm-svn: 249377
* SBTarget::Attach(SBAttachInfo &) was changed to not be asynchronous back in ↵Greg Clayton2015-10-051-7/+12
| | | | | | | | | | February and this affected Xcode's abililty to cancel an attach to process by name. Added the ability to specify if an attach by name should be synchronous or not in SBAttachInfo and ProcessAttachInfo. <rdar://problem/22821480> llvm-svn: 249361
* Made GetScratchTypeSystemForLanguage return an error if desired.Sean Callanan2015-10-022-19/+37
| | | | | | | 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
* Eliminated redundant "constructors" for ClangExpressionVariable. ↵Sean Callanan2015-10-011-1/+1
| | | | | | | | | | | | | The ClangExpressionVariable::CreateVariableInList functions looked cute, but caused more confusion than they solved. I removed them, and instead made sure that there are adequate facilities for easily adding newly-constructed ExpressionVariables to lists. I also made some of the constructors that are common be generic, so that it's possible to construct expression variables from generic places (like the ABI and ValueObject) without having to know the specifics about the class. llvm-svn: 249095
* Add a 'type lookup' command. This command is meant to look up type ↵Enrico Granata2015-10-011-0/+28
| | | | | | | | | | 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
* Use %HOME%/.lldb/module_cache as a default module cache directory.Oleksiy Vyalov2015-10-011-8/+15
| | | | | | http://reviews.llvm.org/D13323 llvm-svn: 249040
* Removed a mutex guard that I accidentally pasted in from other code.Sean Callanan2015-10-011-2/+0
| | | | | | It was causing deadlocks when stepping out. llvm-svn: 249039
* Made Target hold a map of languages to TypeSystems, and added some accessors.Sean Callanan2015-10-012-20/+113
| | | | | | | | Also added some target-level search functions so that persistent variables and symbols can be searched for without hand-iterating across the map of TypeSystems. llvm-svn: 249027
* Introudce a IsTopLevelFunction() API on Language and FunctionEnrico Granata2015-09-301-0/+6
| | | | | | | | This is meant to support languages that have a scripting mode with top-level code that acts as global For now, this flag only controls whether 'frame variable' will attempt to treat globals as locals when within such a function llvm-svn: 248960
* Now persistent expression data no longer lives with the Target, but rather withSean Callanan2015-09-302-9/+16
| | | | | | | | | | the corresponding TypeSystem. This makes sense because what kind of data there is -- and how it can be looked up -- depends on the language. Functionality that is common to all type systems is factored out into PersistentExpressionState. llvm-svn: 248934
* Revert "Fix race condition during process detach"Pavel Labath2015-09-281-34/+40
| | | | | | This fix is not correct on its own until D12968 is resolved. Will resumbit once that is done. llvm-svn: 248702
* Moved more Clang-specific parts of the expression parser into the Clang plugin.Sean Callanan2015-09-252-4/+4
| | | | | | | | | There are still a bunch of dependencies on the plug-in, but this helps to identify them. There are also a few more bits we need to move (and abstract, for example the ClangPersistentVariables). llvm-svn: 248612
* Rename clang_type -> compiler_type for variables.Bruce Mitchener2015-09-242-6/+6
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13102 llvm-svn: 248461
* Fix race condition during process detachPavel Labath2015-09-231-40/+34
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following situation occured in TestAttachResume: The inferior was stoped at a breakpoint and we did a continue, immediately followed by a detach. Since there was a trap instruction under the IP, the continue did a step-over-breakpoint before resuming the inferior for real. In some cases, the detach command was executed between these two events (after the step-over stop, but before continue). Here, public state was running, but private state was stopped. This caused a problem because HaltForDestroyOrDetach was checking the public state to see whether it needs to stop the process (call Halt()), but Halt() was checking the private state and concluded that there is nothing for it to do. Solution: Instead of Halt() call SendAsyncInterrupt(), which will then cause Halt() to be executed in the context of the private state thread. I also rename HaltForDestroyOrDetach to reflect it does not call halt directly. Reviewers: jingham, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13056 llvm-svn: 248371
* [LLDB][MIPS] microMIPS breakpoints, disassembly and compressed addressesJaydeep Patil2015-09-222-1/+40
| | | | | | | | | | | | SUMMARY: This patch detects microMIPS symbols, sets breakpoints using un-compressed address and display disassembly in mixed mode for microMIPS applications (running on bare-iron targets). Reviewers: clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D12079 llvm-svn: 248248
* Further reduction of Clang-related header inclusion.Bruce Mitchener2015-09-211-1/+1
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13018 llvm-svn: 248176
* Use ClangASTContext for compile units with language eLanguageTypeMipsAssemblerTamas Berghammer2015-09-211-0/+1
| | | | | | | | | Both GNU AS and LLVM emits language type DW_LANG_Mips_Assembler for all assembly code. Differential revision: http://reviews.llvm.org/D12962 llvm-svn: 248146
* TypeSystem is now a plugin interface and removed any "ClangASTContext ↵Greg Clayton2015-09-171-6/+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
* Add an OperatingSystem plugin to support goroutinesRyan Brown2015-09-163-1/+6
| | | | | | | | | | The Go runtime schedules user level threads (goroutines) across real threads. This adds an OS plugin to create memory threads for goroutines. It supports the 1.4 and 1.5 go runtime. Differential Revision: http://reviews.llvm.org/D5871 llvm-svn: 247852
* Move hardcoded formatters from the FormatManager to the Language pluginsEnrico Granata2015-09-161-0/+24
| | | | llvm-svn: 247831
* This patch makes Clang-independent base classes for all the expression types ↵Jim Ingham2015-09-154-51/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make the source-map help grammatical.Jim Ingham2015-09-151-1/+1
| | | | llvm-svn: 247709
* Introduce the notion of an escape helper. Different languages have different ↵Enrico Granata2015-09-091-0/+7
| | | | | | | | notion of what to print in a string and how to escape non-printable things. The escape helper is where this notion is provided to LLDB This is NFC, other than a code re-org llvm-svn: 247200
* Data formatter candidate matches can be generated in a number of ways; ↵Enrico Granata2015-09-091-0/+6
| | | | | | | | | | 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
* Implement a Target::GetTypeSystemForLanguage API, as well as provide helpers ↵Enrico Granata2015-09-081-0/+21
| | | | | | on the TypeSystem to get numeric types of specific sizes and signedness llvm-svn: 247082
* Use eAddressClassCode for address lookup for opcodes for stack framesTamas Berghammer2015-09-072-3/+3
| | | | | | | | | | | | | | | It is required because of the following edge case on arm: bx <addr> Non-tail call in a no return function [data-pool] Marked with $d mapping symbol The return address of the function call will point to the data pool but we have to treat it as code so the StackFrame can calculate the symbols correctly. Differential revision: http://reviews.llvm.org/D12556 llvm-svn: 246958
* This patch separates the generic portion of ClangExpressionVariable, whichSean Callanan2015-09-044-11/+11
| | | | | | | | | stores information about a variable that different parts of LLDB use, from the compiler-specific portion that only the expression parser cares about. http://reviews.llvm.org/D12602 llvm-svn: 246871
* Fix TestLoadUnload.test_load_unload for android API > 21Tamas Berghammer2015-09-041-1/+4
| | | | | | | | | | | | * Change Module::MatchesModuleSpec to return true in case the file spec in the specified module spec matches with the platform file spec, but not with the local file spec * Change the module_resolver used when resolving a remote shared module to always set the platform file spec to the file spec requested Differential revision: http://reviews.llvm.org/D12601 llvm-svn: 246852
* Set the default language to use when evaluating to that of the frame's CU.Dawn Perchik2015-09-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * Use the frame's context (instead of just the target's) when evaluating, so that the language of the frame's CU can be used to select the compiler and/or compiler options to use when parsing the expression. This allows for modules built with mixed languages to be parsed in the context of their frame. * Add all C and C++ language variants when determining the language options to set. * Enable C++ language options when language is C or ObjC as a workaround since the expression parser uses features of C++ to capture values. * Enable ObjC language options when language is C++ as a workaround for ObjC requirements. * Disable C++11 language options when language is C++03. * Add test TestMixedLanguages.py to check that the language being used for evaluation is that of the frame. * Fix test TestExprOptions.py to check for C++11 instead of C++ since C++ has to be enabled for C, and remove redundant expr --language test for ObjC. * Fix TestPersistentPtrUpdate.py to not require C++11 in C. Reviewed by: clayborg, spyffe, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11102 llvm-svn: 246829
* Fix logging messagePavel Labath2015-09-031-1/+1
| | | | llvm-svn: 246776
* Fix rare failure in TestProcessIOPavel Labath2015-09-031-6/+5
| | | | | | | | | | | | | | | | | | | | | Summary: There was a race condition in Process class, where we would not wait for process stdout to propagate fully before we would shut down the connection (repro case: slow down the stdio thread by placing a sleep right at the end of the while loop in Communication::ReadThread). The Process class already tried to solve this problem by synchronizing with the read thread in Process::ShouldBroadcastEvent, but unfortunately the connection got closed before that in Process::SetExitStatus. I solve this issue by delaying the connection shutdown until we get a chance to process the event and synchronize. Alternatively, I could have moved the synchronization point to an earlier point in SetExitStatus, but it seems safer to delay the shutdown until other things get a chance to notice the process has exited. Reviewers: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12558 llvm-svn: 246753
* [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
* Purge a few places where *LanguageRuntime.h was being used when it Jim Ingham2015-09-031-1/+1
| | | | | | wasn't needed. llvm-svn: 246744
OpenPOWER on IntegriCloud