summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
Commit message (Collapse)AuthorAgeFilesLines
...
* [LLDB][MIPS] Add MIPS32 and MIPS64 core revisionsMohit K. Bhakkad2015-04-231-0/+1
| | | | | | | | | | | | | | | Patch by Jaydeep Patil Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32. DYLDRendezvous.cpp: On Linux link map struct does not contain extra load offset field. Reviewers: clayborg Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits. Differential Revision: http://reviews.llvm.org/D9190 llvm-svn: 235574
* Missed one piece when committing r235538.Jim Ingham2015-04-231-2/+17
| | | | llvm-svn: 235564
* This is some groundwork for filtering the language ExceptionJim Ingham2015-04-223-5/+75
| | | | | | | | | | | | | | breakpoints, for instance on the class of the thrown object. This change doesn't actually make that work, the part where we extract the thrown object type from the throw site isn't done yet. This provides a general programmatic "precondition" that you can add to breakpoints to give them the ability to do filtering on the LLDB side before we pass the stop on to the user-provided conditions & callbacks. llvm-svn: 235538
* Formatting fix.Jim Ingham2015-04-221-1/+2
| | | | llvm-svn: 235527
* This patch implements several improvements to theSean Callanan2015-04-201-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | module-loading support for the expression parser. - It adds support for auto-loading modules referred to by a compile unit. These references are currently in the form of empty translation units. This functionality is gated by the setting target.auto-import-clang-modules (boolean) = false - It improves and corrects support for loading macros from modules, currently by textually pasting all #defines into the user's expression. The improvements center around including only those modules that are relevant to the current context - hand-loaded modules and the modules that are imported from the current compile unit. - It adds an "opt-in" mechanism for all of this functionality. Modules have to be explicitly imported (via @import) or auto-loaded (by enabling the above setting) to enable any of this functionality. It also adds support to the compile unit and symbol file code to deal with empty translation units that indicate module imports, and plumbs this through to the CompileUnit interface. Finally, it makes the following changes to the test suite: - It adds a testcase that verifies that modules are automatically loaded when the appropriate setting is enabled (lang/objc/modules-auto-import); and - It modifies lanb/objc/modules-incomplete to test the case where a module #undefs something that is #defined in another module. <rdar://problem/20299554> llvm-svn: 235313
* Add a "force_kill" arg to Process::Destroy(). This is needed afterJason Molenda2015-04-172-6/+9
| | | | | | | | | | | | | | | | | | the changes in r233255/r233258. Normally if lldb attaches to a running process, when we call Process::Destroy, we want to detach from the process. If lldb launched the process itself, ::Destroy should kill it. However, if we attach to a process and the driver calls SBProcess::Kill() (which calls Destroy), we need to kill it even if we didn't launch it originally. The force_kill param allows for the SBProcess::Kill method to force the behavior of Destroy. <rdar://problem/20424439> llvm-svn: 235158
* Fix "help language", the languages printer was assuming the Jim Ingham2015-04-171-0/+9
| | | | | | | eLanguageType numbers would be sequential, but vendor types are not and the printer went crazy. llvm-svn: 235153
* Add new virtual method for language runtime plug-ins:Greg Clayton2015-04-163-20/+17
| | | | | | | | | virtual void LanguageRuntime::ModulesDidLoad (const ModuleList &module_list); Then reorganized how the objective C plug-in is notified so it will work for all LanguageRuntime subclasses. llvm-svn: 235118
* Add Modulecache::GetAndPut method which wraps sequence of Get and Put (if ↵Oleksiy Vyalov2015-04-151-56/+23
| | | | | | | | module wasn't found in cache) calls. http://reviews.llvm.org/D9013 llvm-svn: 235011
* Fix segfault when doing `thread info` on a thread without stop info.Chaoren Lin2015-04-081-7/+10
| | | | | | | | | | | | | | | | Summary: E.g., if thread 1 hits a breakpoint, then a `thread info` on thread 2 will cause a segfault, since thread 2 will have no stop info (intended behavior?). Reviewers: kubabrecka, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8905 llvm-svn: 234437
* Fix stepping a virtual thread when the python operating system was enabled.Greg Clayton2015-04-071-0/+13
| | | | | | | | | | | | The OperatingSystem plug-ins allow code to detect threads in memory and then say "memory thread 0x11111" is backed by the actual thread 1. You can then single step these virtual threads. A problem arose when thread specific breakpoints were used during thread plans where we would say "set a breakpoint on thread 0x11111" and we would hit the breakpoint on the real thread 1 and the thread IDs wouldn't match and we would get rid of the "stopped at breakpoint" stop info due to this mismatch. Code was added to ensure these events get forwarded and thus allow single stepping a memory thread to work correctly. Added a test case for this as well. <rdar://problem/19211770> llvm-svn: 234364
* Added a testcase that covers loading a module andSean Callanan2015-04-031-0/+20
| | | | | | | | | | | verifying that the types from that module don't override types from DWARF. Also added a target setting to LLDB so we can tell Clang where to look for these local modules. <rdar://problem/18805055> llvm-svn: 234016
* Adding the RenderScript language type.Colin Riley2015-04-031-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D8803 llvm-svn: 234002
* Fix warnings generated by clang-cl.Zachary Turner2015-04-021-1/+1
| | | | | | | | | | | | | | There were a couple of real bugs here regarding error checking and signed/unsigned comparisons, but mostly these were just noise. There was one class of bugs fixed here which is particularly annoying, dealing with MSVC's non-standard behavior regarding the underlying type of enums. See the comment in lldb-enumerations.h for details. In short, from now on please use FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which contain values larger than can fit into a signed integer. llvm-svn: 233943
* Don't return a reference to a temp variable.Greg Clayton2015-04-021-3/+0
| | | | llvm-svn: 233940
* Fix a crasher that could happen when you run LLDB and evaluate an expression ↵Greg Clayton2015-04-021-2/+27
| | | | | | | | | | where the objective C runtime registers a helper function, and also have an Objective C or C++ exception breakpoint. When shutting down the process in Process::Finalize() we clear a STL collection class and that causes objects to be destroyed that could re-enter Process and cause it to try to iterate over that same collection class that is being destroyed. Guard against this by setting a new "m_finalizing" flag that lets us know we are in the process of finalizing. <rdar://problem/20369152> llvm-svn: 233935
* Fix a race condition in Target::LaunchZachary Turner2015-03-261-14/+23
| | | | | | | | | | | | | | | | When no hijack listener is set up, the global event listener will try to pull events off the queue, racing with the event thread. By always forcing a hijack listener, even when one was not given, we guarantee that the listener always gets all events. This was causing problems in synchronous mode with the process stop event sometimes never being picked up and causing the debugger to hang while processing a .lldbinit file. Reviewed by: Jim Ingham Differential Revision: http://reviews.llvm.org/D8562 llvm-svn: 233315
* Fix Process::Finalize to do Process::Destroy if needed after r233255Ilia K2015-03-261-2/+20
| | | | llvm-svn: 233258
* Fix -gdb-exit to detach if was attached or destroy otherwise (MI)Ilia K2015-03-261-26/+9
| | | | | | | | | | | | | | | | | Summary: This patch fixes -gdb-exit for locally target. It includes the following changes: # Fix Process::Finalize # Use SBProcess::Destroy in -gdb-exit Reviewers: abidh, zturner, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8298 llvm-svn: 233255
* Keep launch info up to date when accessors are called directly (not through ↵Greg Clayton2015-03-261-0/+3
| | | | | | | | "settings set"). <rdar://problem/20300941> llvm-svn: 233233
* Use Android device serial number instead of hostname as a target identifier ↵Oleksiy Vyalov2015-03-251-3/+9
| | | | | | | | within module cache. http://reviews.llvm.org/D8597 llvm-svn: 233202
* Fix ModuleCache usage in Platform - ask remote platform for module's ↵Oleksiy Vyalov2015-03-241-54/+69
| | | | | | | | ModuleSpec beforehand so we can look for a module by UUID locally without need to download it. http://reviews.llvm.org/D8557 llvm-svn: 233136
* [DWARF] If linkages names are missing, use decl context to get qualified names.Siva Chandra2015-03-241-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adds this alternate route only when parsing variable dies corresponding to global or static variables. The motivation for this is that GCC does not emit linkage names for functions and variables declared/defined in anonymous namespaces. Having this alternate route fixes one part of TestNamespace which fails when the test case is compiled with GCC. An alternate route to get fully qualified names of functions whose linkage names are missing will be added with a followup change. With that, the other failing part of TestNamespace will also be fixed. Test Plan: dotest.py -C gcc -p TestNamespace Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8569 llvm-svn: 233098
* Fetch module specification from remote process alsoTamas Berghammer2015-03-243-8/+35
| | | | | | | | | | | | | Previously the remote module sepcification was fetched only from the remote platform. With this CL if we have a remote process then we ask it if it have any information from a given module. It is required because on android the dynamic linker only reports the name of the SO file and the platform can't always find it without a full path (the process can do it based on /proc/<pid>/maps). Differential revision: http://reviews.llvm.org/D8547 llvm-svn: 233061
* Fix Target::Launch in case of synchronous executionIlia K2015-03-231-20/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes Target::Launch in case of synchronous execution. Test Plan: # Create file with source commands: ``` $ cat start_script target create ~/p/hello process launch -s continue ``` # Run lldb and execute "command source -c 0 -s 0 start_script": ``` $ bin/lldb (lldb) command source -c 0 -s 0 start_script Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'. (lldb) target create ~/p/hello Current executable set to '~/p/hello' (x86_64). (lldb) process launch -s Process 92028 stopped * thread #1: tid = 0x26731, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = signal SIGSTOP frame #0: 0x00007fff5fc01000 dyld`_dyld_start dyld`_dyld_start: -> 0x7fff5fc01000 <+0>: popq %rdi 0x7fff5fc01001 <+1>: pushq $0x0 0x7fff5fc01003 <+3>: movq %rsp, %rbp 0x7fff5fc01006 <+6>: andq $-0x10, %rsp (lldb) Process 92028 launched: '/Users/IliaK/p/hello' (x86_64) (lldb) continue ' ` - it's \ni=1 j=2 x=3 y=4 argc: /Users/IliaK/p/hello argc: (null) Process 92028 resuming Process 92028 exited with status = 0 (0x00000000) (lldb) ``` was: ``` $ bin/lldb (lldb) command source -c 0 -s 0 start_script Executing commands in '/Users/IliaK/p/llvm/build_ninja/start_script'. (lldb) target create ~/p/hello Current executable set to '~/p/hello' (x86_64). (lldb) process launch -s Process 92100 launched: '/Users/IliaK/p/hello' (x86_64) (lldb) continue error: Process must be launched. Process 92100 stopped * thread #1: tid = 0x2699a, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = signal SIGSTOP frame #0: 0x00007fff5fc01000 dyld`_dyld_start dyld`_dyld_start: -> 0x7fff5fc01000 <+0>: popq %rdi 0x7fff5fc01001 <+1>: pushq $0x0 0x7fff5fc01003 <+3>: movq %rsp, %rbp 0x7fff5fc01006 <+6>: andq $-0x10, %rsp (lldb) ``` Reviewers: jingham, clayborg Reviewed By: clayborg Subscribers: labath, lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D8541 llvm-svn: 233022
* Initialize ObjC runtime at the right location.Stephane Sezer2015-03-231-0/+18
| | | | | | | | | | | | | | | | Summary: Saw this while reading some code in DynamicLoader classes. Looks like this has been a FIXME since 2011 at least. Test Plan: Run unit tests. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8558 llvm-svn: 232983
* Move some functions from source/lldb.cpp to Utility.Zachary Turner2015-03-183-0/+3
| | | | | | | | | | Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-1814-19/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Remove ScriptInterpreterObject.Zachary Turner2015-03-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This removes ScriptInterpreterObject from the codebase completely. Places that used to rely on ScriptInterpreterObject now use StructuredData::Object and its derived classes. To support this, a new type of StructuredData object is introduced, called StructuredData::Generic, which stores a void*. Internally within the python library, StructuredPythonObject subclasses this StructuredData::Generic class so that it can addref and decref the python object on construction and destruction. Additionally, all of the classes in PythonDataObjects.h such as PythonList, PythonDictionary, etc now provide a method to create an instance of the corresponding StructuredData type. For example, there is PythonDictionary::CreateStructuredDictionary. To eliminate dependencies on PythonDataObjects for external callers, all ScriptInterpreter methods now return only StructuredData classes The rest of the changes in this CL are focused on fixing up users of PythonDataObjects classes to use the new StructuredData classes. llvm-svn: 232534
* Fix broadcasters for interpreter and process:Ilia K2015-03-171-1/+1
| | | | | | | | # Fix CommandInterpreter.Broadcaster name (it should be the same as CommandInterpreter::GetStaticBroadcasterClass()) # Prevent the same error in Process.Broadcaster # Fix SBCommandInterpreter::GetBroadcasterClass (it should call CommandInterpreter::GetStaticBroadcasterClass(), was Communication::GetStaticBroadcasterClass()) llvm-svn: 232500
* Extend Platform(s) in order to cache remote executables using ModuleCache ↵Oleksiy Vyalov2015-03-131-0/+37
| | | | | | | | and make POSIX dynamic loader to use this flow when attaching to a remote target. http://reviews.llvm.org/D8306 llvm-svn: 232194
* Fix fetching the architecture of the target on process launchTamas Berghammer2015-03-131-0/+24
| | | | | | | | | | Previously it was fetched only if the architecture isn't valid, but the architecture can be valid without containing all information about the current target (e.g. missing os). Differential revision: http://reviews.llvm.org/D8057 llvm-svn: 232153
* Make ModuleCache::Get to return instantiated ModuleSP instance so already ↵Oleksiy Vyalov2015-03-121-21/+8
| | | | | | | | created in-memory instance can be returned instead of creating a new one. http://reviews.llvm.org/D8270 llvm-svn: 232075
* Remove unused FileSpec variable from Target::GetSharedModuleIlia K2015-03-121-1/+0
| | | | llvm-svn: 232060
* Fix ProcessIO test failuresPavel Labath2015-03-121-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was a race condition regarding the output of the inferior process. The reading of the output is performed on a separate thread, and there was no guarantee that the output will get eventually consumed. Because of that, it was happening that calling Process::GetSTDOUT was not returning anything even though the process was terminated and would definitely not produce any further output. This was usually happening only under very heavy system load, but it can be reproduced by placing an usleep in the stdio thread (Process::STDIOReadThreadBytesReceived). This patch addresses this by adding synchronization capabilities to the Communication thread. After calling Communication::SynchronizeWithReadThread one can be sure that all pending input has been processed by the read thread. This function is then called after every public event which stops the process to obtain the entire process output. Test Plan: TestProcessIO.py should now succeed every time instead of flaking in and out. Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8246 llvm-svn: 232023
* Add =shlibs-added/=shlibs-removed notifications (MI)Ilia K2015-03-101-75/+69
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds =shlibs-added/=shlibs-removed notifications in lldb-mi. In more detail: # Add Target::ModulesDidLoad/ModulesDidUnload notifications # Improve Target::TargetEventData: ## Refactoring ## Move it back to include/lldb/Target/Target.h ## Add Target::{GetModuleListFromEvent,GetModuleList}; Add Target::m_module_list # Add SBModule::{GetSymbolVendorMainFileSpec,GetObjectFileHeaderAddress} # Add SBTarget::{EventIsTaretEvent,GetTargetFromEvent,GetNumModulesFromEvent,GetModuleAtIndexFromEvent} All tests pass on OS X. Reviewers: abidh, zturner, jingham, clayborg Reviewed By: clayborg Subscribers: jingham, zturner, lldb-commits, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8201 llvm-svn: 231858
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-10/+266
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Fix race condition with -o "process launch" on linuxPavel Labath2015-03-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Summary: starting a debug session on linux with -o "process launch" lldb parameter was failing since Target::Launch (in sychronous mode) is expecting to be able to receive public process events. However, PlatformLinux did not set up event hijacking on process launch, which caused these events to be processed elsewhere and left Target::Launch hanging. This patch enables event interception in PlatformLinux (which was commented out). Upon enabling event interception, I noticed an issue, which I traced back to the inconsistent state of public run lock, which remained false even though public and private process states were "stopped". I addressed this by making sure the run lock is "stopped" upon exit from WaitForProcessToStop (which already had similar provisions for other return paths). Test Plan: This should fix the intermittent TestFormats failure we have been experiencing on Linux. Reviewers: jingham, clayborg, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8079 llvm-svn: 231460
* Don't #include clang headers from BreakpointLocation.hZachary Turner2015-03-041-1/+1
| | | | llvm-svn: 231263
* Further reduce header footprint of Debugger.h.Zachary Turner2015-03-042-0/+3
| | | | llvm-svn: 231202
* Fix errors building on linux.Zachary Turner2015-03-031-0/+4
| | | | llvm-svn: 231169
* Don't #include FormatManager.h from Debugger.hZachary Turner2015-03-033-0/+6
| | | | | | | | Debugger.h is a huge file that gets included everywhere, and FormatManager.h brings in a ton of unnecessary stuff and doesn't even use anything from it in the header. llvm-svn: 231161
* Further reduce the header footprint of Process.hZachary Turner2015-03-032-1/+62
| | | | | | | No functional change here, only deletes unnecessary headers and moves one function's body from the .h file to the .cpp. llvm-svn: 231145
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-033-0/+3
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Reduce header footprint of Target.hZachary Turner2015-03-036-61/+91
| | | | | | | | | | | | This continues the effort to reduce header footprint and improve build speed by removing clang and other unnecessary headers from Target.h. In one case, some headers were included solely for the purpose of declaring a nested class in Target, which was not needed by anybody outside the class. In this case the definition and implementation of the nested class were isolated in the .cpp file so the header could be removed. llvm-svn: 231107
* Remove duplicated code for synthetic array members.Bruce Mitchener2015-02-261-1/+1
| | | | | | | | | | | | | | | | | Summary: The code for GetSyntheticArrayMemberFromPointer and GetSyntheticArrayMemberFromArray was identical, so just collapse the the methods into one. Reviewers: granata.enrico, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7911 llvm-svn: 230708
* Revert "Fix warnings found with clang-cl."Zachary Turner2015-02-251-1/+1
| | | | | | | SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
* Fix warnings found with clang-cl.Zachary Turner2015-02-251-1/+1
| | | | | | | | | | | Earlier this week I was able to get clang-cl on Windows to be able to self host. This opened the door to being able to get a whole new slew of warnings for the Windows build. This patch fixes all of the warnings, many of which were real bugs. llvm-svn: 230522
* Add missing "return" statements.Hafiz Abid Qadeer2015-02-251-2/+2
| | | | | | | ExecutionContext::GetAddressByteSize() was calling GettAddressByteSize () on Target and Process class but was ignoring the return type. I have added the missing return. No regression in the test suite. Committed as obvious. llvm-svn: 230502
* Add null RegisterContext assertionsEd Maste2015-02-232-0/+2
| | | | | | | | This makes these failures slightly more obvious, avoiding the need to run LLDB under a debugger or rely on a LLDB core. I encountered these while bringing up a new OS/arch combination. llvm-svn: 230236
OpenPOWER on IntegriCloud