summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
Commit message (Collapse)AuthorAgeFilesLines
* Allow gdbremote process to read modules from memoryStephane Sezer2016-04-052-36/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: The logic to read modules from memory was added to LoadModuleAtAddress in the dynamic loader, but not in process gdb remote. This means that when the remote uses svr4 packets to give library info, libraries only present on the remote will not be loaded. This patch therefore involves some code duplication from LoadModuleAtAddress in the dynamic loader, but removing this would require some amount of code refactoring. Reviewers: ADodds, tberghammer, tfiala, deepak2427, ted Subscribers: tfiala, lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18531 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 265418
* Fix a bug in linux core file handlingPavel Labath2016-04-051-1/+1
| | | | | | | | | | | | | | | | | | | Summary: There was a bug in linux core file handling, where if there was a running process with the same process id as the id in the core file, the core file debugging would fail, as we would pull some pieces of information (ProcessInfo structure) from the running process instead of the core file. I fix this by routing the ProcessInfo requests through the Process class and overriding it in ProcessElfCore to return correct data. A (slightly convoluted) test is included. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18697 llvm-svn: 265391
* LLDB top of tree SVN fails to attach to a MacOSX native process by pid only ↵Greg Clayton2016-03-291-2/+2
| | | | | | | | | | (no executable). The problem was that the static DynamicLoaderDarwinKernel::Initialize() was recently changed to come before DynamicLoaderMacOSXDYLD::Initialize() which caused the DynamicLoaderDarwinKernel::CreateInstance(...) to be called before DynamicLoaderMacOSXDYLD::CreateInstance(...) and DynamicLoaderDarwinKernel would claim it could be the dynamic loader for a user space MacOSX process. The fix is to make DynamicLoaderDarwinKernel::CreateInstance() a bit more thourough when vetting the process so that it doesn't claim MacOSX user space processes. <rdar://problem/25425373> llvm-svn: 264794
* Add an "offset" option to "break set -n" and "break set -f -l". Jim Ingham2016-03-091-0/+1
| | | | | | | | | | | | That way you can set offset breakpoints that will move as the function they are contained in moves (which address breakpoints can't do...) I don't align the new address to instruction boundaries yet, so you have to get this right yourself for now. <rdar://problem/13365575> llvm-svn: 263049
* ProcessMachCore scans through the core file pages looking for aJason Molenda2016-02-062-49/+25
| | | | | | | | | | | | | | | | | | | | user process dyld binary and/or a mach kernel binary image. By default, it prefers the kernel if it finds both. But if it finds two kernel binary images (which can happen when random things are mapped into memory), it may pick the wrong kernel image. DynamicLoaderDarwinKernel has heuristics to find a kernel in memory; once we've established that there is a kernel binary in memory, call over to that class to see if it can find a kernel address via its search methods. If it does, use that. Some minor cleanups to DynamicLoaderDarwinKernel while I was at it. <rdar://problem/24446112> llvm-svn: 259983
* Add two more addresses to check for the address of the kernel in debug mode;Jason Molenda2016-02-051-0/+16
| | | | | | | also add some logging about where lldb is lookin for a kernel as it connects. <rdar://problem/24454582> llvm-svn: 259865
* Remove autoconf support from source directories.Eugene Zelenko2016-01-286-84/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Fix build breakage of r257502.Stephane Sezer2016-01-121-1/+1
| | | | llvm-svn: 257510
* Increase use of svr4 packets to improve performance on POSIX remotesStephane Sezer2016-01-122-23/+183
| | | | | | | | | | | | | | | | | | | | Summary: Allows the remote to enumerate the link map when adding and removing shared libraries, so that lldb doesn't need to read it manually from the remote's memory. This provides very large speedups (on the order of 50%) in total startup time when using the ds2 remote on android or Tizen devices. Reviewers: ADodds, tberghammer, tfiala Subscribers: tberghammer, sas, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D16004 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 257502
* The MacOSXi386 ABI should be used for watchos simulator debug sessions.Jason Molenda2015-11-101-0/+5
| | | | | | | | | | Also, add an async error message if the dyld solib loaded callback function can't find an ABI (which results in no solibs being loaded in the process). This is a big error and we should call attention to it. <rdar://problem/23471384> llvm-svn: 252581
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-072-6/+6
| | | | | | | | | | | | | | | | | | Summary: Since this is within the lldb namespace, the compiler tries to export a symbol for it. Unfortunately, since it is inlined, the symbol is hidden and this results in a mess of warnings when building on OS X with cmake. Moving it to the lldb_private namespace eliminates that problem. Reviewers: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D14417 llvm-svn: 252396
* Add support for the new (added last week) llvm::Triple::WatchOS and ::TvOSJason Molenda2015-11-052-0/+4
| | | | | | | | | | in places where we check for Triple::IOS. They're mostly the same as far as lldb is conerned. . Also add a base cass implementation for Process::IsAlive - Greg added this last year but it didn't get upstreamed. llvm-svn: 252227
* Changes for Bug 17384Ravitheja Addepally2015-10-282-2/+33
| | | | | | | | | | | | | | | | | | | | | | | Summary: Virtual dynamic shared objects, or vdso files were not loaded for Linux OS.In Bug 17384 the call stack could not be unwinded from functions residing in the vdso object. This commit adds support for loading such files by reading the Aux vectors since a vdso is invisibily mapped to the inferiors address space and the actual file is not present in the filesystem. The presence of the vdso is detected by inspecting the Aux vector for AT_SYSINFO_EHDR tag. Reviewers: lldb-commits, ovyalov, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D14118 llvm-svn: 251505
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-216-118/+114
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* Make use of lldv::Triple::isAndroidTamas Berghammer2015-10-141-11/+5
| | | | | | | | It is a new function added to the llvm::Triple class to simplify the checking if we are targeting android to clean up the confusion between android being an OS or an environment. llvm-svn: 250286
* Remove long-forgotten plugin virtuals.Bruce Mitchener2015-10-094-52/+0
| | | | | | | | | | | | | | | Summary: EnablePluginLogging, GetPluginCommandHelp and ExecutePluginCommand aren't implemented or used anywhere, so remove them from the Hexagon and POSIX Dynamic Loaders as well as the FreeBSD process. Reviewers: clayborg, labath, emaste Subscribers: lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D13581 llvm-svn: 249840
* Restrict the scope of a hack in DYLDRendezvousTamas Berghammer2015-10-011-5/+23
| | | | | | | | | | The hack is there to work around an incorrect load address reported by the android linker on API 21 and 22 devices. This CL restricts the hack to those android API levels. Differential revision: http://reviews.llvm.org/D13288 llvm-svn: 249012
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-036-12/+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
* Major DWARF cleanup.Greg Clayton2015-08-262-2/+2
| | | | | | | | | | Added a new class called DWARFDIE that contains a DWARFCompileUnit and DWARFDebugInfoEntry so that these items always stay together. There were many places where we just handed out DWARFDebugInfoEntry pointers and then use them with a compile unit that may or may not be the correct one. Clients outside of DWARFCompileUnit and DWARFDebugInfoEntry should all be dealing with DWARFDIE instances instead of playing with DWARFCompileUnit/DWARFDebugInfoEntry pairs manually. This paves to the way for some modifications that are coming for DWO. llvm-svn: 246100
* Fix missing override warningsEnrico Granata2015-08-262-15/+15
| | | | llvm-svn: 246084
* Final bit of type system cleanup that abstracts declaration contexts into ↵Greg Clayton2015-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | lldb_private::CompilerDeclContext and renames ClangType to CompilerType in many accessors and functions. Create a new "lldb_private::CompilerDeclContext" class that will replace all direct uses of "clang::DeclContext" when used in compiler agnostic code, yet still allow for conversion to clang::DeclContext subclasses by clang specific code. This completes the abstraction of type parsing by removing all "clang::" references from the SymbolFileDWARF. The new "lldb_private::CompilerDeclContext" class abstracts decl contexts found in compiler type systems so they can be used in internal API calls. The TypeSystem is required to support CompilerDeclContexts with new pure virtual functions that start with "DeclContext" in the member function names. Converted all code that used lldb_private::ClangNamespaceDecl over to use the new CompilerDeclContext class and removed the ClangNamespaceDecl.cpp and ClangNamespaceDecl.h files. Removed direct use of clang APIs from SBType and now use the abstract type systems to correctly explore types. Bulk renames for things that used to return a ClangASTType which is now CompilerType: "Type::GetClangFullType()" to "Type::GetFullCompilerType()" "Type::GetClangLayoutType()" to "Type::GetLayoutCompilerType()" "Type::GetClangForwardType()" to "Type::GetForwardCompilerType()" "Value::GetClangType()" to "Value::GetCompilerType()" "Value::SetClangType (const CompilerType &)" to "Value::SetCompilerType (const CompilerType &)" "ValueObject::GetClangType ()" to "ValueObject::GetCompilerType()" many more renames that are similar. llvm-svn: 245905
* Add absolute load address support for the DynamicLoader pluginsTamas Berghammer2015-08-244-25/+36
| | | | | | | | | | | | The POSIX linker generally reports the load bias for the loaded libraries but in some case it is useful to handle a library based on absolute load address. Example usecases: * Windows linker uses absolute addresses * Library list came from different source (e.g. /proc/<pid>/maps) Differential revision: http://reviews.llvm.org/D12233 llvm-svn: 245834
* Revert "Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD."Zachary Turner2015-08-211-28/+0
| | | | | | | | | This reverts commit 7749a10ddbe22767d0e055753c674fcde7f28d39. This commit introduces about 15-20 new test failures with windows local targets. llvm-svn: 245765
* Implement basic DidAttach and DidLaunch for DynamicLoaderWindowsDYLD.Stephane Sezer2015-08-211-0/+28
| | | | | | | | | | | | | | | | | | | | Summary: This commit implements basic DidAttach and DidLaunch for the windows DynamicLoader plugin which allow us to load shared libraries from the inferior. At the moment, I'm unsure how we're going to gather the load address of the main module over gdb protocol so I always use an offset of 0, which works well for processes we create ourselves (no randomization). I will address this point later on. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12245 llvm-svn: 245725
* Run clang-format on DynamicLoaderWindowsDYLD.Stephane Sezer2015-08-202-27/+28
| | | | | | | | | | | | | | Summary: This uses the .clang-format at the root of the LLDB repo and is just a mechanical change that precedes more work in this file. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12217 llvm-svn: 245634
* ClangASTType is now CompilerType.Greg Clayton2015-08-111-2/+2
| | | | | | This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc). llvm-svn: 244689
* Add some initial logging for when lldb is searching for binaries,Jason Molenda2015-07-251-0/+10
| | | | | | | | | dSYMs, or reading binaries out of memory to the 'Host' log channel. There's more to be done here, both for Mac and for other platforms, but the initial set of new loggings are useful enough to check in at this point. llvm-svn: 243200
* Add UNUSED_IF_ASSERT_DISABLED and apply it.Bruce Mitchener2015-07-241-1/+1
| | | | | | | | | | | | | | | Summary: This replaces (void)x; usages where they x was subsequently involved in an assertion with this macro to make the intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11451 llvm-svn: 243074
* Add support for specifying a language to use when parsing breakpoints.Dawn Perchik2015-07-211-0/+1
| | | | | | | | | | | | | | | | | | | | Target and breakpoints options were added: breakpoint set --language lang --name func settings set target.language pascal These specify the Language to use when interpreting the breakpoint's expression (note: currently only implemented for breakpoints on identifiers). If the breakpoint language is not set, the target.language setting is used. This support is required by Pascal, for example, to set breakpoint at 'ns.foo' for function 'foo' in namespace 'ns'. Tests on the language were also added to Module::PrepareForFunctionNameLookup for efficiency. Reviewed by: clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D11119 llvm-svn: 242844
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-142-6/+6
| | | | | | | | | | | | Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames. Reviewers: labath Subscribers: emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11154 llvm-svn: 242196
* Use target.exec-search-paths setting when resolving executable path for ↵Oleksiy Vyalov2015-07-141-1/+3
| | | | | | | | remote target. http://reviews.llvm.org/D11163 llvm-svn: 242183
* Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a ↵Ewan Crawford2015-07-142-1/+4
| | | | | | | | | | | | | | | | | | | | function call on target via register manipulation For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support. Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls. In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation. To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter. The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values. Reviewers: jingham, spyffe Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427 Differential Revision: http://reviews.llvm.org/D9404 llvm-svn: 242137
* Avoid dependency on uuid.h in MacOSXDYLDPavel Labath2015-07-131-2/+2
| | | | | | | | | | | | | | | | Summary: r241964 has added a dependency on uuid.h, which (on linux at least) necessitates instalation of a new package. Since the only thing we need from that file is uuid_t (and this is already defined in UuidCompatibility.h), we can avoid this dependency by making this include __APPLE__ specific. If in future, we need more from this library, we can revisit this decision. Reviewers: jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11135 llvm-svn: 242022
* Add a another packet to the gdb-remote protocol,Jason Molenda2015-07-102-0/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jGetLoadedDynamicLibrariesInfos. This packet is similar to qXfer:libraries:read except that lldb supplies the number of solibs that should be reported about, and the start address for the list of them. At the initial process launch we'll read the full list of solibs linked by the process -- at this point we could be using qXfer:libraries:read -- but on subsequence solib-loaded notifications, we'll be fetching a smaller number of solibs, often only one or two. A typical Mac/iOS GUI app may have a couple hundred different solibs loaded - doing all of the loads via memory reads takes a couple of megabytes of traffic between lldb and debugserver. Having debugserver summarize the load addresses of all the solibs and sending it in JSON requires a couple of hundred kilobytes of traffic. It's a significant performance improvement when communicating over a slower channel. This patch leaves all of the logic for loading the libraries in DynamicLoaderMacOSXDYLD -- it only call over ot ProcesGDBRemote to get the JSON result. If the jGetLoadedDynamicLibrariesInfos packet is not implemented, the normal technique of using memory read packets to get all of the details from the target will be used. <rdar://problem/21007465> llvm-svn: 241964
* Unbreak Makefile buildKeno Fischer2015-07-091-0/+14
| | | | llvm-svn: 241820
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-083-4/+4
| | | | | | a language to use in order to soon support Pascal and Java demangling. Dawn Perchik will take care of making this so. llvm-svn: 241751
* Move WindowsDYLD to the Plugins/DynamicLoader directory.Stephane Sezer2015-07-084-1/+151
| | | | | | | | | | | | | | | | | | | | | Summary: This commit moves the Windows DyanamicLoader to the common DynamicLoader directory. This is required to remote debug Windows targets. This commit also initializes the Windows DYLD plugin in SystemInitializerCommon (similarly to both POSIX and MacOSX DYLD plugins) so that we can automatically instantiate this class when connected to a windows process. Test Plan: Build. Reviewers: zturner Subscribers: lldb-commits, abdulras Differential Revision: http://reviews.llvm.org/D10882 llvm-svn: 241697
* Fix [vdso] handling on Android (x86 and aarch64)Tamas Berghammer2015-06-301-6/+8
| | | | | | | | | | | | | | * Add in-memory object file handling to the core dynamic loader * Fix in memory object file handling in ObjectFileELF (previously only part of the file was loaded before parsing) * Fix load address setting in ObjectFileELF for 32-bit targets when the load bias is negative * Change hack in DYLDRendezvous.cpp to be more specific and not to interfere with object files with fixed load address Differential revision: http://reviews.llvm.org/D10800 llvm-svn: 241057
* Unbreak the build.Greg Clayton2015-06-252-2/+2
| | | | llvm-svn: 240711
* Resubmitting 240466 after fixing the linux test suite failures.Greg Clayton2015-06-253-8/+10
| | | | | | | | | | | | | | | A few extras were fixed - Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected. - Since some places want to access the address as a reference, I added a few new functions to symbol: Address &Symbol::GetAddressRef(); const Address &Symbol::GetAddressRef() const; Linux test suite passes just fine now. <rdar://problem/21494354> llvm-svn: 240702
* Add comment for workarond in DYLDRendezvous with android versionTamas Berghammer2015-06-191-0/+1
| | | | llvm-svn: 240166
* Fetch object file load address if it isn't specified by the linkerTamas Berghammer2015-06-181-0/+11
| | | | | | Differential revision: http://reviews.llvm.org/D10490 llvm-svn: 240052
* Fix duplicate shared module list entriesAidan Dodds2015-06-181-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D10499 llvm-svn: 240007
* Fix TestNamespace and TestThreadJump for remote Windows to Android.Chaoren Lin2015-06-053-29/+27
| | | | | | | | | | | | | | | | Summary: Update DYLDRendezvous and SOEntry to use FileSpecs instead of storing paths as strings, which caused incorrect comparison results due to denormalization. Reviewers: clayborg, vharron, ovyalov Reviewed By: ovyalov Subscribers: jwolfe, emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10267 llvm-svn: 239195
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Fix the logic in DynamicLoaderMacOSXDYLD::Clear that would only remove the ↵Jim Ingham2015-05-211-3/+8
| | | | | | | | | | | | old dyld notification breakpoint only if the process it was for is still alive. We need to always remove this because it has a pointer to the old loader, and if we ever hit it we will crash. I also put in a sanity check in the callback function to make sure we don't invoke it if the process is wrong. <rdar://problem/21006189> llvm-svn: 237866
* Fix a few compile warningsIlia K2015-05-131-1/+1
| | | | llvm-svn: 237238
* Fixed a ton of gcc compile warningsVince Harron2015-05-131-1/+1
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Remove check for object file type from DynamicLoaderPOSIXDYLD::DidAttachTamas Berghammer2015-05-081-4/+0
| | | | | | | | For PIE executables the type of the main executable is shared object so we can't force that the main executable should have the type of executable. llvm-svn: 236870
* Re-enable compute load address for shared modulesTamas Berghammer2015-05-081-3/+0
| | | | | | It is required because of systems using PIE code llvm-svn: 236826
OpenPOWER on IntegriCloud