summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] [1/4] Update a batch of pluginsChris Bieneman2017-01-316-6/+55
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293698
* Add a catch-all line for detecting dyld in the inferior processJason Molenda2017-01-212-0/+5
| | | | | | | shlibs so we don't miss dyld. <rdar://problem/30128580> llvm-svn: 292696
* Fix a problem with the new dyld interface code -- when a new processJason Molenda2017-01-191-0/+5
| | | | | | | | | | starts up, we need to clear the target's image list and only add the binaries into the target that are actually present in this process run. <rdar://problem/29857613> llvm-svn: 292454
* Set the address size based on the target's arch insteadJason Molenda2016-12-081-3/+2
| | | | | | | of using the address of the all_image_infos struct. <rdar://problem/29547847> llvm-svn: 289016
* Add another address to look for the kernel load addr inJason Molenda2016-11-301-1/+3
| | | | | | | | | DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints on 32-bit devices. <rdar://problem/29423290> llvm-svn: 288284
* [lldb] Fix typos in file headersAlexander Shaposhnikov2016-11-263-3/+3
| | | | | | | | | | | | | This diff fixes typos in file headers (incorrect file names). Test plan: Under llvm/tools/lldb/source: find ./* -type f | grep -e '\(cpp\|h\)$' | while read F; do B=$(basename $F); echo $F head -n 1 $F | grep -v $B | wc -l ; done Differential revision: https://reviews.llvm.org/D27115 llvm-svn: 287966
* Fix a comparison of integers of different signs warning.Taras Tsugrii2016-11-241-1/+1
| | | | | | | | | | source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:403:21: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare] for (int i = 0; i < llvm::array_lengthof (magicks); i++) ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Differential Revision: https://reviews.llvm.org/D27081 llvm-svn: 287848
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-161-1/+1
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Change the kernel searching code to not go through theJason Molenda2016-11-151-17/+37
| | | | | | | | | | | | memory cache subsystem so we're reading only the 4 bytes needed to check for the magic word at the start of a mach-o binary instead of the default 512 block. It can be a small performance help to reduce the size of memory reads from possibly unmapped memory. <rdar://problem/29256385> llvm-svn: 286926
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-113-3/+3
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Make the Error class constructor protectedMehdi Amini2016-11-113-3/+3
| | | | | | | | | This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 llvm-svn: 286561
* Remove unused TimeValue includePavel Labath2016-11-091-1/+0
| | | | llvm-svn: 286372
* Fix typo which broke debugging on older OSX systems after r285172.Dawn Perchik2016-11-021-1/+1
| | | | | | | | Reviewed by: jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D26260 llvm-svn: 285858
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-023-7/+5
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* Remove TimeValue usage from FileSpec.hPavel Labath2016-11-011-3/+4
| | | | | | | | | | | | | | | | | | | | | Summary: The only usage there was in GetModificationTime(). I also took the opportunity to move this function from FileSpec to the FileSystem class - since we are using FileSpecs to also represent remote files for which we cannot (easily) retrieve modification time, it makes sense to make the decision to get the modification time more explicit. The new function returns a llvm::sys::TimePoint<>. To aid the transition from TimeValue, I have added a constructor to it which enables implicit conversion from a time_point. Reviewers: zturner, clayborg Subscribers: mehdi_amini, tberghammer, danalbert, beanz, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25392 llvm-svn: 285702
* Enable the use of the new dyld SPI on the currentJason Molenda2016-10-261-5/+0
| | | | | | generation macosx/ios/tvos/watchos. llvm-svn: 285172
* Add some additional logging to Jason Molenda2016-10-211-5/+20
| | | | | | | | | DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress to debug corefiles that may not be correctly formed. <rdar://problem/28884846> llvm-svn: 284900
* Make lldb::Regex use StringRef.Zachary Turner2016-09-211-1/+1
| | | | | | | | | | This updates getters and setters to use StringRef instead of const char *. I tested the build on Linux, Windows, and OSX and saw no build or test failures. I cannot test any BSD or Android variants, however I expect the required changes to be minimal or non-existant. llvm-svn: 282079
* gdb-remote: Add jModulesInfo packetPavel Labath2016-09-081-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to query multiple modules at once. This makes a significant speed improvement in case the application has many (over a hundred) modules, and the communication link has a non-negligible latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after it reads the list of modules from the inferior memory, but other uses are possible. This decreases the attach time to an android application by about 40%. Reviewers: clayborg Subscribers: tberghammer, lldb-commits, danalbert Differential Revision: https://reviews.llvm.org/D24236 llvm-svn: 280919
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0622-7810/+6854
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Always rely on CFI unwind info for linux vdsoPavel Labath2016-08-312-4/+26
| | | | | | | | | | | | | | | | | | Summary: The vdso is full of hand-written assembly which the instruction emulator has a hard time understanding. Luckily, the kernel already provides us with correct unwind info for them. So let's use it. This fixes (at least) the AssertingInferiorTestCase.test_inferior_asserting_disassemble test on android N i386. Reviewers: tberghammer Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D24079 llvm-svn: 280264
* Move the code which knows how to get information about the sharedJason Molenda2016-07-294-0/+131
| | | | | | | | | | cache from ObjectFileMachO (very wrong place) to the DynamicLoader plugins (better place). Not much change to the code itself, although the old ObjectFileMachO method would try both the new dyld SPI and reading the dyld_all_image_infos structure. In the new methods, I've separated those into the appropriate DynamicLoader plugins. llvm-svn: 277088
* Clean up vestigial remnants of locking primitivesSaleem Abdulrasool2016-07-281-1/+0
| | | | | | | | | | | | | | | | This finally removes the use of the Mutex and Condition classes. This is an intricate patch as the Mutex and Condition classes were tied together. Furthermore, many places had slightly differing uses of time values. Convert timeout values to relative everywhere to permit the use of std::chrono::duration, which is required for the use of std::condition_variable's timeout. Adjust all Condition and related Mutex classes over to std::{,recursive_}mutex and std::condition_variable. This change primarily comes at the cost of breaking the TracingMutex which was based around the Mutex class. It would be possible to write a wrapper to provide similar functionality, but that is beyond the scope of this change. llvm-svn: 277011
* Add some logging to the kernel dynamicloader plugin when we fail to readJason Molenda2016-07-281-0/+3
| | | | | | | a kext binary from memory. <rdar://problem/26158095> llvm-svn: 276954
* DynamicLoaderDarwinKernel will look in four addresses for the kernelJason Molenda2016-07-261-2/+3
| | | | | | | | load address on 64-bit devices; it only needs to look in three. <rdar://problem/27061405> llvm-svn: 276721
* Remove some tab characters that snuck in to my mnost recent edits.Jason Molenda2016-07-222-14/+14
| | | | llvm-svn: 276485
* Add support to get the shared cache information from the newJason Molenda2016-07-221-0/+7
| | | | | | | | | | | | | debugserver jGetSharedCacheInfo packet instead of reading the dyld internal data structures directly. This code is (currently) only used for ios native lldb's - I should really move this ObjectFileMachO::GetProcessSharedCacheUUID method somewhere else, it makes less and less sense being in the file reader. <rdar://problem/25251243> llvm-svn: 276369
* Add a new DynamicLoader plugin that uses SPI that are in developmentJason Molenda2016-07-217-68/+882
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for the fall (northern hemisphere) 2016 Darwin platforms to learn about loaded images, instead of reading dyld internal data structures. These new SPI don't exist on older releases, and new packets are needed from debugserver to use them (those changes are already committed). I had to change the minimum deployment target for debugserver in the xcode project file to macOS 10.10 so that debugserver will use the [[NSProcessInfo processInfo] operatingSystemVersion] call in MachProcess::GetOSVersionNumbers to get the operarting system version # -- this API is only available in macOS 10.10 and newer ("OS X Yosemite", released Oct 2014). If we have many people building llvm.org lldb on older systems still, we can back off on this for the llvm.org sources. There should be no change in behavior with this commit, either to older darwin systems or newer darwin systems. For now the new DynamicLoader plugin is never activated - I'm forcing the old plugin to be used in DynamicLoaderDarwin::UseDYLDSPI. I'll remove that unconditional use of the old plugin soon, so the newer plugin is used on the newest Darwin platforms. <rdar://problem/25251243> llvm-svn: 276254
* Typo corrections identified by codespellEd Maste2016-07-191-1/+1
| | | | | | | | | Submitted by giffunip@yahoo.com; I fixed a couple of nearby errors and incorrect changes in the patch. llvm.org/pr27634 llvm-svn: 275983
* Refactor (with some rewriting) the DynamicLoaderMacOSX plugin intoJason Molenda2016-07-175-1269/+1528
| | | | | | | | | | | | | | | | | | | | | | | a base class and a derived class, with the derived class containing the methods specific to reading dyld's all_image_infos, dyld's method of specifying images that have been loaded or unloaded, the place where we put a breakpoint in dyld to get notified about newly loaded or unloaded images. This is in preparation for a second derived class which will use some alternate methods for getting this information; that will be a separate commit in the next few days. There's a couple of ivars that should probably be in the derived DyanmicLoaderMacOSX class instead of the base DynamicLoaderDarwin class (m_dyld_image_infos, m_dyld_image_infos_stop_id). I don't think I'll need to use these in the new derived class - I'll move them down to DynamicLoaderMacOSX if it works out that way; it'll simplify locking if I can do that. <rdar://problem/25251243> llvm-svn: 275733
* Thread local storage was already broken on Linux and the tests were passing ↵Greg Clayton2016-07-012-2/+8
| | | | | | | | | | | because there was a dectorator: @unittest2.expectedFailure("rdar://7796742") Which was covering up the fact this was failing on linux and hexagon. I added back a decorator so we don't break any build bots. llvm-svn: 274388
* Revert fix that didn't work. I will need to debug this on linux to figure ↵Greg Clayton2016-07-011-10/+1
| | | | | | things out. llvm-svn: 274377
* Try to fix Ubuntu buildbots after I broke thread local variables with 274366.Greg Clayton2016-07-011-5/+13
| | | | llvm-svn: 274374
* Added support for thread local variables on all Apple OS variants.Greg Clayton2016-07-016-24/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had support that assumed that thread local data for a variable could be determined solely from the module in which the variable exists. While this work for linux, it doesn't work for Apple OSs. The DWARF for thread local variables consists of location opcodes that do something like: DW_OP_const8u (x) DW_OP_form_tls_address or DW_OP_const8u (x) DW_OP_GNU_push_tls_address The "x" is allowed to be anything that is needed to determine the location of the variable. For Linux "x" is the offset within the TLS data for a given executable (ModuleSP in LLDB). For Apple OS variants, it is the file address of the data structure that contains a pthread key that can be used with pthread_getspecific() and the offset needed. This fix passes the "x" along to the thread: virtual lldb::addr_t lldb_private::Thread::GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr); Then this is passed along to the DynamicLoader::GetThreadLocalData(): virtual lldb::addr_t lldb_private::DynamicLoader::GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr); This allows each DynamicLoader plug-in do the right thing for the current OS. The DynamicLoaderMacOSXDYLD was modified to be able to grab the pthread key from the data structure that is in memory and call "void *pthread_getspecific(pthread_key_t key)" to get the value of the thread local storage and it caches it per thread since it never changes. I had to update the test case to access the thread local data before trying to print it as on Apple OS variants, thread locals are not available unless they have been accessed at least one by the current thread. I also added a new lldb::ValueType named "eValueTypeVariableThreadLocal" so that we can ask SBValue objects for their ValueType and be able to tell when we have a thread local variable. <rdar://problem/23308080> llvm-svn: 274366
* Revert r273524, it may have been the cause of a linux testbot failureJason Molenda2016-06-231-4/+4
| | | | | | | | for TestNamespaceLookup.py; didn't see anything obviously wrong so I'll need to look at this more closely before re-committing. (passed OK on macOS ;) llvm-svn: 273531
* Do some minor renames of "Mac OS X" to "macOS".Jason Molenda2016-06-231-4/+4
| | | | | | | | | There's uses of "macosx" that will be more tricky to change, like in triples (e.g. "x86_64-apple-macosx10.11") - for now I'm just updating source comments and strings printed for humans. llvm-svn: 273524
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-192-4/+4
| | | | llvm-svn: 270024
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-185-45/+44
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* 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
OpenPOWER on IntegriCloud