summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader/Darwin-Kernel
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* 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
* Remove unused TimeValue includePavel Labath2016-11-091-1/+0
| | | | llvm-svn: 286372
* 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
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-062-1672/+1454
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* 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 use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-182-21/+21
| | | | | | | | | | 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
* 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-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-071-3/+3
| | | | | | | | | | | | | | | | | | 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-051-0/+2
| | | | | | | | | | 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
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-211-22/+19
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* [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
* 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 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
* Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a ↵Ewan Crawford2015-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* 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 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
* 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
* Fix build on OS X after r231202Ilia K2015-03-041-0/+1
| | | | llvm-svn: 231235
* 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
* 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
* 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
* Fix typos.Bruce Mitchener2014-07-081-2/+2
| | | | llvm-svn: 212553
* 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-022-1/+2
| | | | | | | | | | headers on Mac OS X (in particular mach/machine.h). <rdar://problem/16494607> llvm-svn: 205480
* 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
* 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
* 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
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-6/+7
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* For logical backtrace work, lldb needs to track Module unloads etc & ↵Greg Clayton2013-12-061-1/+1
| | | | | | | | | | symoblicate an address based on a point in time <rdar://problem/15314403> This patch adds a new lldb_private::SectionLoadHistory class that tracks what shared libraries were loaded given a process stop ID. This allows us to keep a history of the sections that were loaded for a time T. Many items in history objects will rely upon the process stop ID in the future. llvm-svn: 196557
* <rdar://problem/15367122>Greg Clayton2013-11-051-1/+1
| | | | | | | | Fixed the test case for "test/functionalities/exec/TestExec.py" on Darwin. The issue was breakpoints were persisting and causing problems. When we exec, we need to clear out the process and target and start fresh with nothing and let the breakpoints populate themselves again. This patch correctly clears out the breakpoints and also flushes the process so that the objects (process/thread/frame) give out valid information. llvm-svn: 194106
* Roll back the changes I made in r193907 which created a new FrameJason Molenda2013-11-041-1/+1
| | | | | | | | | | pure virtual base class and made StackFrame a subclass of that. As I started to build on top of that arrangement today, I found that it wasn't working out like I intended. Instead I'll try sticking with the single StackFrame class -- there's too much code duplication to make a more complicated class hierarchy sensible I think. llvm-svn: 193983
* Add a new base class, Frame. It is a pure virtual function whichJason Molenda2013-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | | defines a protocol that all subclasses will implement. StackFrame is currently the only subclass and the methods that Frame vends are nearly identical to StackFrame's old methods. Update all callers to use Frame*/Frame& instead of pointers to StackFrames. This is almost entirely a mechanical change that touches a lot of the code base so I'm committing it alone. No new functionality is added with this patch, no new subclasses of Frame exist yet. I'll probably need to tweak some of the separation, possibly moving some of StackFrame's methods up in to Frame, but this is a good starting point. <rdar://problem/15314068> llvm-svn: 193907
* <rdar://problem/13635174>Greg Clayton2013-10-111-1/+3
| | | | | | | | Added a way to set hardware breakpoints from the "breakpoint set" command with the new "--hardware" option. Hardware breakpoints are not a request, they currently are a requirement. So when breakpoints are specified as hardware breakpoints, they might fail to be set when they are able to be resolved and should be used sparingly. This is currently hooked up for GDB remote debugging. Linux and FreeBSD should quickly enable this feature if possible, or return an error for any breakpoints that are hardware breakpoint sites in the "virtual Error Process::EnableBreakpointSite (BreakpointSite *bp_site);" function. llvm-svn: 192491
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-251-5/+5
| | | | llvm-svn: 191367
* Fix some names in the wake of my Mach-O changes to LLVM.Charles Davis2013-08-271-12/+12
| | | | llvm-svn: 189317
* <rdar://problem/13956179>Greg Clayton2013-05-221-3/+3
| | | | | | | | Fixed ProcessMachCore to be able to locate the main executeable in the core file even if it doesn't start at a core file address range boundary. Prior to this we only checked the first bytes of each range in the core file for mach_kernel or dyld. Now we still do this, but if we don't find the mach_kernel or dyld anywhere, we go through all core file ranges and check every 0x1000 to see if we can find dyld or the mach_kernel. Now that we can properly detect the mach_kernel at any address, we don't need to call "DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process*)" anymore. llvm-svn: 182513
* <rdar://problem/13854277>Greg Clayton2013-05-102-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* Remove the UUID::GetAsCString() method which required a buffer to save the Jason Molenda2013-05-031-8/+4
| | | | | | | UUID string in; added UUID::GetAsString() which returns the uuid string in a std::string. Updated callers to use the new method. llvm-svn: 181078
* If the Target's current architecture is incompatible with the kernelJason Molenda2013-05-021-0/+5
| | | | | | | DynamicLoaderDarwinKernel finds in memory, have DynamicLoaderDarwinKernel re-set the Target's arch based on the kernel's cpu type / cpu subtype. llvm-svn: 180962
* Make the warning message about not finding the kernel binary clearerJason Molenda2013-04-301-1/+1
| | | | | | about which kernel binary lldb is referring to. llvm-svn: 180821
* Cleanup logging to use the new "std::string FileSpec::GetPath()" function. ↵Greg Clayton2013-04-291-8/+2
| | | | | | | | | | | Also added a similar function for modules: std::string Module::GetSpecificationDescription () const; This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it. llvm-svn: 180717
* Remove an unneeded local var, a missing return statement in kernel search ↵Jason Molenda2013-04-191-4/+2
| | | | | | code, thanks to Greg Clayton for finding these. llvm-svn: 179822
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-1/+1
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Change CommandObjectPlatform commands to get the current platformJason Molenda2013-04-051-1/+0
| | | | | | | | | | | from the current Target, if there is one, else back off to getting the currently selected platform from the Debugger (as it ws doing previously.) Remove code from DynamicLoaderDarwinKernel that was setting the platform in both the Target and in the Debugger. llvm-svn: 178836
OpenPOWER on IntegriCloud