summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/POSIX-DYLD
Commit message (Collapse)AuthorAgeFilesLines
...
* 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-012-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+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
* 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-211-16/+15
| | | | | | | | 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-092-26/+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-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
* Major DWARF cleanup.Greg Clayton2015-08-261-1/+1
| | | | | | | | | | 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-261-7/+7
| | | | llvm-svn: 246084
* Add absolute load address support for the DynamicLoader pluginsTamas Berghammer2015-08-242-16/+17
| | | | | | | | | | | | 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
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-141-3/+3
| | | | | | | | | | | | 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
* Make many mangled functions that might demangle a name be allowed to specify ↵Greg Clayton2015-07-081-1/+1
| | | | | | 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
* 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
* 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
* 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
* This patch allows LLDB to use the $qXfer:Libraries: packet.Aidan Dodds2015-05-081-4/+37
| | | | | | Differential Revision: http://reviews.llvm.org/D9471 llvm-svn: 236817
* Replace use of %zu with PRIu64 in DYDL logging message.Aidan Dodds2015-04-231-1/+1
| | | | llvm-svn: 235598
* [LLDB][MIPS] Add MIPS32 and MIPS64 core revisionsMohit K. Bhakkad2015-04-231-3/+4
| | | | | | | | | | | | | | | 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
* Do not assert on POSIXDYLD double-eAdd.Stephane Sezer2015-03-231-1/+6
| | | | | | | | | | | | | | | | Summary: This has been discovered while experimenting with the gecko linker on android. In general, assert()'ing on "user input" is a bad idea. Test Plan: Run unit tests. Reviewers: clayborg, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8495 llvm-svn: 232966
* Extend Platform(s) in order to cache remote executables using ModuleCache ↵Oleksiy Vyalov2015-03-132-21/+40
| | | | | | | | and make POSIX dynamic loader to use this flow when attaching to a remote target. http://reviews.llvm.org/D8306 llvm-svn: 232194
* Fix SO entry is main executable detection on androidTamas Berghammer2015-03-131-5/+8
| | | | | | | | | | | | | * On Android (at least on platfrom-21 x86) the dynamic linker reports the executable with its full path * Use the platform path of the executable when storing it into the cache (used to identify the SO entry for the executable) as this is the path what will be reported by the dynamic linker. If the platform path isn't set (local debugging) then it falls back to the normal file path. Differential revision: http://reviews.llvm.org/D8296 llvm-svn: 232158
* Reduce header footprint of Target.hZachary Turner2015-03-032-0/+2
| | | | | | | | | | | | 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
* Use basename of main executable in POSIX-DYLD on Android.Stephane Sezer2015-02-032-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The Android dynamic linker reports only the basename of each SO entry, so for the above check to be successful, we need to compare it to the basename of the main executable. This also has a nasty side-effect when working with older version of Android (verified on platform version 16), and debugging PIE executables: the dynamic linker has a bug and reports the load address of the main executable (which is a shared object, because PIE) to be 0. We then try to update the list of loaded sections for all shared objects, including the main executable, and set the load address to 0, which breaks everything that relies on resolving addresses in the main executable (breakpoints, stepping, etc). This commit also fixes that broken behavior when debugging on older Androids. This bug doesn't happen on newer Android versions (verified for Android L). Test Plan: Run test suite on linux. Reviewers: clayborg, tfiala, richard.mitton Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7188 llvm-svn: 228057
* Make "process attach" command to support attaching to remote process in case ↵Oleksiy Vyalov2015-02-031-0/+3
| | | | | | | | if selected platform allows this. http://reviews.llvm.org/D7358 llvm-svn: 227899
* Make DynamicLoaderPOSIXDYLD::DidAttach to deduce a target executable by pid ↵Oleksiy Vyalov2015-01-072-5/+32
| | | | | | | | if no executable hasn't been assigned to a target so far. http://reviews.llvm.org/D6740 llvm-svn: 225332
* First cut of PowerPC(64) support in LLDB.Justin Hibbits2014-10-311-0/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds preliminary support for PowerPC/PowerPC64, for FreeBSD. There are some issues still: * Breakpoints don't work well on powerpc64. * Shared libraries don't yet get loaded for a 32-bit process on powerpc64 host. * Backtraces don't work. This is due to PowerPC ABI using a backchain pointer in memory, instead of a dedicated frame pointer register for the backchain. * Breakpoints on functions without debug info may not work correctly for 32-bit powerpc. Reviewers: emaste, tfiala, jingham, clayborg Reviewed By: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D5988 llvm-svn: 220944
* Most of this function checks to see if m_process is non-null beforeJason Molenda2014-10-161-6/+8
| | | | | | | | dereferencing it, except for this one section of code. Add a null check around it. clang static analyzer fix. llvm-svn: 219920
* Update assertion in DYLDRendezvous.Andrew MacPherson2014-10-101-1/+1
| | | | | | This accounts for the case where a dlopen() call fails when loading a library with a missing dependency. llvm-svn: 219520
* POSIX dynamic loader: add more logging around launch/attach, fix breakpoint ↵Todd Fiala2014-10-091-2/+37
| | | | | | | | | | | | | | | | | | | | | handling on entry callback. This change adds some logging around dynamic loader handling. It also fixes an issue where the dynamic loader entry breakpoint can end up being re-inserted, showing the wrong (i.e. software breakpoint) instruction at the stop location when a backtrace is displayed at program startup. I discussed with Jim Ingham a few weeks back. Essentially the one-hit breakpoints need to make it back to public state handling before the software breakpoint gets cleared. The flow I was hitting was that the breakpoint would get set, it would get hit, it would get cleared to step over, then it would get reapplied, when we never wanted it reapplied. Stops at the beginning of execution would then show backtraces with software breakpoint instructions in it, erroneously. This change fixes it. There might be a more elegant way to do this, or a flow change somewhere else to avoid, but it does fix an issue I experienced in startup breakpoint handling. llvm-svn: 219371
* Added logging of the POSIX-DYLD rendezvous address (i.e. the info_location ↵Todd Fiala2014-09-051-1/+11
| | | | | | address) llvm-svn: 217287
* Add more logging to DynamicLoaderPOSIXDYLD, especially around rendezvous ↵Todd Fiala2014-09-051-15/+78
| | | | | | | | | handling. Covers more of the behavior of rendezvous breakpoint handling and other dynamic loader aspects, all on the 'enable log lldb dyld' log channel. llvm-svn: 217283
* Properly handle the DYLD attach step for GDB remotes.Todd Fiala2014-09-051-1/+20
| | | | | | Change by Stephane Sezer. llvm-svn: 217253
* Use the process' ReadCStringFromMemory from ↵Todd Fiala2014-09-041-13/+1
| | | | | | | | | | | | | | | DYLDRendezvous::ReadStringFromMemory. Tested: Ubuntu 14.04 x86_64, clang-3.5-built lldb. MacOSX 10.9.4, Xcode6-Beta7-built lldb. Visual packet inspection on lldb <-> llgs shows significant reduction in overly-verbose memory read traffic on start-up when scanning shared library info. Change by Stephane Sezer. llvm-svn: 217153
* Fix typos.Bruce Mitchener2014-07-081-1/+1
| | | | llvm-svn: 212553
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-302-6/+63
| | | | | | | | | | | | | | | | | | | | | This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64. (More architectures coming soon). Not every debugserver option is covered yet. Currently the lldb-gdbserver command line can start unattached, start attached to a pid (process-name attach not supported yet), or accept lldb attaching and launching a process or connecting by process id. The history of this large change can be found here: https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64 Until mid/late April, I was not sharing the work and continued to rebase it off of head (developed via id tfiala@google.com). I switched over to user todd.fiala@gmail.com in the middle, and once I went to github, I did merges rather than rebasing so I could share with others. llvm-svn: 212069
* Fix minor build warning on Mac OS X x86_64.Jason Molenda2014-02-141-1/+1
| | | | llvm-svn: 201387
* Revert r201292 which relaxed the stack frame alignment requirements.Jason Molenda2014-02-131-1/+1
| | | | | | | | | This was primarily working around problems where we weren't able to identify trap handlers for different environments -- but instead, I'm working to make it easier to specify those trap handler function names. llvm-svn: 201366
* Change the ABI CallFrameAddressIsValid methods for i386 and x86_64.Jason Molenda2014-02-131-1/+1
| | | | | | | | | | | | | | | | | | They were enforcing 16-byte alignment on stack frames for Darwin x86 programs. But we've found that trap handlers typically don't have the stack pointer aligned correctly when a trap happens and lldb wasn't backtracing all the way through. This method is only used as a safety guard to prevent lldb's unwinder from using a bogus address as a stack frame - we'll still enforce word-size alignment on stack frames so that should be fine. Also rolled back akaylor's changes from August 2013 in r188952 which changed the i386 ABI plugin to relax the CallFrameAddressIsValid offsets for non-Darwin targets where only 4-byte alignment is enforced. Now Darwin is the same as those environments. <rdar://problem/15982682> llvm-svn: 201292
* Factor some methods that were in DynamicLoaderPOSIXDYLD.Steve Pucci2014-02-062-145/+10
| | | | | | | | | | | | | | | Move some code that was in DynamicLoaderPOSIXDLYD into the base class DynamicLoader. In the case of UpdateLoadedSections(), the test to see whether a file is loadable (its address is zero) is not generally applicable so that test is changed to a more universally applicable check for the SHF_ALLOC flag on the section. Also make it explicit that the reading of the module_id in DynamicLoaderPOSIXDYLD::GetThreadLocalData() is using a hardcoded size (of module_id) of 4, which might not be appropriate on big-endian 64-bit systems, leaving a FIXME comment in place. llvm-svn: 200939
OpenPOWER on IntegriCloud