summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix DynamicLoaderMacOSXDYLD to deal with new shared cache changes.Greg Clayton2015-03-311-1/+1
| | | | | | <rdar://problem/20357466> llvm-svn: 233714
* Fix build on OS X after r233061Ilia K2015-03-241-1/+1
| | | | | | | | This includes following: # Add a missing Process argument when calling GetSharedModule in DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule # Fix PlatformDarwinKernel::GetSharedModule prototype llvm-svn: 233084
* Initialize ObjC runtime at the right location.Stephane Sezer2015-03-231-18/+0
| | | | | | | | | | | | | | | | 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
* 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
* If the user specifies a kernel binary that isn't correct for the currentJason Molenda2015-03-101-11/+12
| | | | | | | | | kernel debug session, instead of issuing a warning (which on one ever sees), drop the user-specified kernel binary Module from the target and try to discover the correct one dynamically. <rdar://problem/19450329> llvm-svn: 231885
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-0/+1
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Fix build on OS X after r231202Ilia K2015-03-041-0/+1
| | | | llvm-svn: 231235
* Reduce header footprint of Target.hZachary Turner2015-03-034-0/+4
| | | | | | | | | | | | 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
* Don't #include ClangASTContext.h from Module.hZachary Turner2015-03-031-0/+1
| | | | | | | | | | | | This is part of a larger effort to reduce header file footprints. Combined, these patches reduce the build time of LLDB locally by over 30%. However, they touch many files and make many changes, so will be submitted in small incremental pieces. Reviewed By: Greg Clayton Differential Revision: http://reviews.llvm.org/D8022 llvm-svn: 231097
* Silence unused variable warnings in release buildsPavel Labath2015-02-191-0/+1
| | | | llvm-svn: 229843
* Don't wait for the dynamic loader to set a module as a dynamic link editor, ↵Greg Clayton2015-02-051-3/+0
| | | | | | | | | | figure it out through the ObjectFile. Background: dyld binaries often have extra symbols in their symbol table like "malloc" and "free" for the early bringup of dyld and we often don't want to set breakpoints in dynamic linker binaries. We also don't want to call the "malloc" or "free" function in dyld when a user writes an expression like "(void *)malloc(123)" so we need to avoid doing name lookups in dyld. We mark Modules as being dynamic link editors and this helps do correct lookups for breakpoints by name and function lookups. <rdar://problem/19716267> llvm-svn: 228261
* 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
* Add another address to check for the kernel's load addr in debug configs.Jason Molenda2014-10-061-8/+11
| | | | | | <rdar://problem/18560328> llvm-svn: 219152
* We had to squirrel away the dyld module before doing ↵Jim Ingham2014-09-191-1/+7
| | | | | | | | | | | | ResolveExecutableModule, since that would clear the module list, and then put it back by hand. But we forgot to also put its sections back in the target SectionList, so we would jettison it as unloaded when we finished handling the first real load event. Add its sections. <rdar://problem/18385947> llvm-svn: 218156
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-1/+2
| | | | | | | | | | | | | if a "file a.out" auto selected a different platform than the selected one. Changes include: - fix it so you can select the "host" platform using "platform select host" - change all callbacks that create platforms to returns shared pointers - fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host" - Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform - cache platforms that are created and re-use them instead of always creating a new one llvm-svn: 218145
* 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
* When doing an exhaustive search for the kernel in memory, also lookJason Molenda2014-07-311-0/+4
| | | | | | | at 16k offsets. <rdar://problem/17861781> llvm-svn: 214387
* Update lldb to track recent Triple arm64 enum removal and collapse into aarch64.Todd Fiala2014-07-231-1/+1
| | | | | | | | | | | See the following llvm change for details: r213743 | tnorthover | 2014-07-23 05:32:47 -0700 (Wed, 23 Jul 2014) | 9 lines AArch64: remove arm64 triple enumerator. This change fixes build breaks on Linux and MacOSX lldb. llvm-svn: 213755
* Fix the warnings introducedDeepak Panickal2014-07-221-4/+2
| | | | llvm-svn: 213643
* Dynamic loader for the Hexagon DSPDeepak Panickal2014-07-217-0/+1614
| | | | llvm-svn: 213565
* Cleanup the iOS simulator code.Greg Clayton2014-07-101-1/+1
| | | | | | | | | | | Fixes include: - Don't say that "<arch>-apple-ios" is compatible with "<arch>-apple-macosx" - Fixed DynamicLoaderMacOSXDYLD so specify an architecture that was converted solely from a cputype and subtype, just specify the file + UUID. - Fixed PlatformiOSSimulator::GetSupportedArchitectureAtIndex() so it returns the correct archs - Fixed SymbolFileDWARFDebugMap to load .o files correctly by just specifying the architecture without the vendor and OS now that "<arch>-apple-ios" is not compatible with "<arch>-apple-macosx" so we can load .o files correctly for DWARF with debug map - Fixed the coded in TargetList::CreateTarget() so it does the right thing with an underspecified triple where just the arch is specified. llvm-svn: 212783
* Fix typos.Bruce Mitchener2014-07-083-4/+4
| | | | llvm-svn: 212553
* Fix typos.Bruce Mitchener2014-07-011-3/+3
| | | | llvm-svn: 212132
* 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
* Add some basic sanity checks to ↵Jason Molenda2014-04-151-0/+24
| | | | | | | | | | DynamicLoaderDarwinKernel::ReadKextSummaryHeader() when it is reading the kext table, in case we're reading out of a core file with corrupt contents in this region. <rdar://problem/16601915> llvm-svn: 206233
* Workaround for collision between enum members in LLVM's MachO.h and system ↵Jim Ingham2014-04-025-6/+6
| | | | | | | | | | headers on Mac OS X (in particular mach/machine.h). <rdar://problem/16494607> llvm-svn: 205480
* Don’t include “llvm/Support/MachO.h” as it isn’t needed here.Greg Clayton2014-04-021-2/+0
| | | | llvm-svn: 205461
* Don’t #include “llvm/Support/MachO.h” in a header file if we can avoid ↵Greg Clayton2014-04-022-2/+2
| | | | | | it. llvm-svn: 205460
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-2/+2
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* lldb arm64 import.Jason Molenda2014-03-291-1/+1
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Small fix to ↵Jason Molenda2014-03-051-1/+1
| | | | | | | | DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule needed with Greg's change to how we load modules in r202890. llvm-svn: 202933
* 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
* Modified ObjectFile::SetLoadAddress() to now be:Greg Clayton2014-02-071-1/+1
| | | | | | | | | | | | | | ObjectFile::SetLoadAddress (Target &target, lldb::addr_t value, bool value_is_offset); Now "value" is a slide if "value_is_offset" is true, and "value" is an image base address otherwise. All previous usage of this API was using slides. Updated the ObjectFileELF and ObjectFileMachO SetLoadAddress methods to do the right thing. Also updated the ObjectFileMachO::SetLoadAddress() function to not load __LINKEDIT when it isn't needed and to only load sections that belong to the executable object file. llvm-svn: 201003
* 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