summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/MacOSX-Kernel
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix builds Windows and OSX builds after Connection refactor in r287922Pavel Labath2016-11-251-2/+5
| | | | | | | | | Switch various bits of platform-specific code to chrono that I did not notice when doing a linux build. This exposed a bug that ConnectionGenericFileWindows did not handle the magic UINT32_MAX timeout value (instead it waited for about an hour, which is close enough I guess). Fix that as well. llvm-svn: 287927
* 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
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-111-1/+1
| | | | | | | | 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-111-1/+1
| | | | | | | | | 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 TimeValue usages from MacOSX-Kernel process plugin. NFCPavel Labath2016-11-023-10/+7
| | | | llvm-svn: 285795
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0616-3736/+3180
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Fix lldb build on Mac.Pavel Labath2016-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: https://github.com/llvm-mirror/lldb/commit/e80f43fd78fa0fbc04d2d59b5713acb5d06c8308 greatly improved an API, but missed one more occurence of legacy usage. This leads to: if (extractor.GetHexBytes(&payload_bytes[0], payload_bytes.size(), '\xdd') != payload_bytes.size()) ~~~~~~~~~~~~~~~~~~~~~ ^~~~~~ /lldb/include/lldb/Utility/StringExtractor.h:151:5: note: 'GetHexBytes' declared here Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24064 Author: Taras Tsugrii <ttsugrii@fb.com> llvm-svn: 280202
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-111-1/+1
| | | | | | | | | | | | | | | | Options used to store a reference to the CommandInterpreter instance in the base Options class. This made it impossible to parse options independent of a CommandInterpreter. This change removes the reference from the base class. Instead, it modifies the options-parsing-related methods to take an ExecutionContext pointer, which the options may inspect if they need to do so. Closes https://reviews.llvm.org/D23416 Reviewers: clayborg, jingham llvm-svn: 278440
* Delete Host/windows/win32.hZachary Turner2016-08-091-1/+1
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* Fixed up Xcode build for r276976 and r277011.Todd Fiala2016-07-282-2/+2
| | | | | | | Also, fixed up typos in RenderScript code that could not possibly compile. llvm-svn: 277012
* Clean up vestigial remnants of locking primitivesSaleem Abdulrasool2016-07-283-5/+4
| | | | | | | | | | | | | | | | 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
* LLDB help content has accumulated over time without a recent attempt toKate Stone2016-07-141-5/+3
| | | | | | | | | review it for consistency, accuracy, and clarity. These changes attempt to address all of the above while keeping the text relatively terse. <rdar://problem/24868841> llvm-svn: 275485
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-192-23/+23
| | | | llvm-svn: 270024
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-181-2/+2
| | | | | | | | | | 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
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-072-10/+10
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* 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-2/+2
| | | | | | | | | | | | | | | | | | 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-1/+3
| | | | | | | | | | 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
* Make sure we don't over specify an architecture when we connect to KDP and ↵Greg Clayton2015-10-282-15/+33
| | | | | | | | use the CPU type and subtype to fill out an architecture. We do this by letting the vendor be an unspecified unknown, or any. We also grab the target architecture, get the KDP host arch, and then merge the two before putting it back into the target. Also change MH_PRELOAD to be use "unspecified unknown" (any) for the OS and vendor since these mach files can really be anything. llvm-svn: 251579
* Split Socket class into Tcp/Udp/DomainSocket subclasses.Oleksiy Vyalov2015-10-151-2/+2
| | | | | | http://reviews.llvm.org/D13754 llvm-svn: 250474
* Re-commit the (fixed) changes from r248985 which were reverted by PavelJason Molenda2015-10-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when they introduced android testsuite regressions. Pavel has run the testsuite against the updated patch and it completes cleanly now. The original commit message: Fixing a subtle issue on Mac OS X systems with dSYMs (possibly introduced by r235737 but I didn't look into it too closely). A dSYM can have a per-UUID plist in it which tells lldb where to find an executable binary for the dSYM (DBGSymbolRichExecutable) - other information can be included in this plist, like how to remap the source file paths from their build pathnames to their long-term storage pathnames. This per-UUID plist is a unusual; it is used probably exclusively inside apple with our build system. It is not created by default in normal dSYMs. The problem was like this: 1. lldb wants to find an executable, given only a UUID (this happens when lldb is doing cross-host debugging and doesn't have a copy of the target system's binaries) 2. It eventually calls LocateMacOSXFilesUsingDebugSymbols which does a spotlight search for the dSYM on the local system, and failing that, tries the DBGShellCommands command to find the dSYM. 3. It gets a dSYM. It reads the per-UUID plist in the dSYM. The dSYM has a DBGSymbolRichExecutable kv pair pointing to the binary on a network filesystem. 4. Using the binary on the network filesystem, lldb now goes to find the dSYM. 5. It starts by looking for a dSYM next to the binary it found. 6. lldb is now reading the dSYM over a network filesystem, ignoring the one it found on its local filesystem earlier. Everything still *works* but it's much slower. This would be a tricky one to write up in a testsuite case; you really need the binary to not exist on the local system. And LocateMacOSXFilesUsingDebugSymbols will only compile on Mac OS X - even if I found a way to write up a test case, it would not run anywhere but on a mac. One change Greg wanted while I was touching this code was to have LocateMacOSXFilesUsingDebugSymbols (which could be asked to find a binary OR find a dSYM) to instead return a ModuleSpec with the sum total of everything it could find. This change of passing around a ModuleSpec instead of a FileSpec was percolated up into ModuleList::GetSharedModule. The changes to LocateMacOSXFilesUsingDebugSymbols look larger than they really are - there's a lot of simple whitespace changes in there. I ran the testsuites on mac, no new regressions introduced <rdar://problem/21993813> llvm-svn: 249755
* Revert "Fixing a subtle issue on Mac OS X systems with dSYMs..."Pavel Labath2015-10-011-7/+1
| | | | | | | This reverts commit r248985, as it was breaking all remote expression-evaluating tests (on android at least). llvm-svn: 248995
* Fixing a subtle issue on Mac OS X systems with dSYMs (possiblyJason Molenda2015-10-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduced by r235737 but I didn't look into it too closely). A dSYM can have a per-UUID plist in it which tells lldb where to find an executable binary for the dSYM (DBGSymbolRichExecutable) - other information can be included in this plist, like how to remap the source file paths from their build pathnames to their long-term storage pathnames. This per-UUID plist is a unusual; it is used probably exclusively inside apple with our build system. It is not created by default in normal dSYMs. The problem was like this: 1. lldb wants to find an executable, given only a UUID (this happens when lldb is doing cross-host debugging and doesn't have a copy of the target system's binaries) 2. It eventually calls LocateMacOSXFilesUsingDebugSymbols which does a spotlight search for the dSYM on the local system, and failing that, tries the DBGShellCommands command to find the dSYM. 3. It gets a dSYM. It reads the per-UUID plist in the dSYM. The dSYM has a DBGSymbolRichExecutable kv pair pointing to the binary on a network filesystem. 4. Using the binary on the network filesystem, lldb now goes to find the dSYM. 5. It starts by looking for a dSYM next to the binary it found. 6. lldb is now reading the dSYM over a network filesystem, ignoring the one it found on its local filesystem earlier. Everything still *works* but it's much slower. This would be a tricky one to write up in a testsuite case; you really need the binary to not exist on the local system. And LocateMacOSXFilesUsingDebugSymbols will only compile on Mac OS X - even if I found a way to write up a test case, it would not run anywhere but on a mac. One change Greg wanted while I was touching this code was to have LocateMacOSXFilesUsingDebugSymbols (which could be asked to find a binary OR find a dSYM) to instead return a ModuleSpec with the sum total of everything it could find. This change of passing around a ModuleSpec instead of a FileSpec was percolated up into ModuleList::GetSharedModule. The changes to LocateMacOSXFilesUsingDebugSymbols look larger than they really are - there's a lot of simple whitespace changes in there. I ran the testsuites on mac, no new regressions introduced <rdar://problem/21993813> llvm-svn: 248985
* [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
* Fix ProcessKDP.cpp for the change in r246578.Jim Ingham2015-09-012-16/+18
| | | | llvm-svn: 246601
* Move ProcessKDP's StringExtractor include.Bruce Mitchener2015-07-072-1/+1
| | | | | | | | | | | | | | | This can be in the cpp file rather than the header file, so moving it there. Summary: Move ProcessKDP's StringExtractor include. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11018 llvm-svn: 241649
* Fix StringExtractor.h issues.Bruce Mitchener2015-07-071-1/+0
| | | | | | | | | | | | | | | | | | | | | Summary: Fix StringExtractor.h issues. * source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (#include "Utility/StringExtractor.h): Not needed, this is already included by ProcessKDP.h * unittests/Utility/StringExtractorTest.cpp (#include "Utility/StringExtractor.h): Update include path to the new location. Reviewers: labath, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10995 llvm-svn: 241596
* Fix-up ProcessKDP wrt. StringExtractor movePavel Labath2015-07-071-1/+1
| | | | llvm-svn: 241574
* Fix typosBruce Mitchener2015-07-021-1/+1
| | | | | | | | | | | | Summary: Fixes more typos. Reviewers: clayborg Subscribers: lldb-commits-list Differential Revision: http://reviews.llvm.org/D10898 llvm-svn: 241289
* Remove DoAttachToProcessWithId(lldb::pid_t).Zachary Turner2015-05-132-12/+0
| | | | | | | | | | There were two versions of DoAttachToprocessWithId. One that takes a pid_t, and the other which takes a pid_t and a ProcessAttachInfo. There were no callers of the former version, and all of the implementations of this version were simply forwarding calls to one version or the other. llvm-svn: 237281
* Sprinkle some #include <mutex> in files that use std::call_once.Benjamin Kramer2015-04-031-0/+2
| | | | llvm-svn: 234005
* Fix typo, fix build.Bruce Mitchener2015-04-031-1/+1
| | | | | | This typo was introduced as part of http://reviews.llvm.org/D8760 llvm-svn: 234003
* [Plugin/Process] Use std::call_once() to initialize.Davide Italiano2015-04-031-8/+7
| | | | | | | | This replaces the home-grown initialization mechanism used before. Differential Revision: http://reviews.llvm.org/D8760 llvm-svn: 233999
* Fix build on OS X after r231202Ilia K2015-03-041-0/+1
| | | | llvm-svn: 231235
* Add Socket::Get[Remote/Local]IpAddress and unit testsVince Harron2015-01-161-1/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D6917 llvm-svn: 226234
* Get the correct process architecture in ProcessKDP::DidAttach().Greg Clayton2014-10-311-1/+6
| | | | | | <rdar://problem/18806212> llvm-svn: 220938
* Move ConnectionFileDescriptor to platform-specific Host directory.Zachary Turner2014-10-061-1/+1
| | | | | | | | | | | | As part of getting ConnectionFileDescriptor working on Windows, there is going to be alot of platform specific work to be done. As a result, the implementation is moving into Host. This patch performs the code move and fixes up call-sites appropriately. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5548 llvm-svn: 219143
* Fix up the HostThread interface, making the interface simpler.Zachary Turner2014-09-231-7/+4
| | | | | | | Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5417 llvm-svn: 218325
* Create a HostThread abstraction.Zachary Turner2014-09-092-13/+14
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
* Fix ProcessKDP after Host/Socket additionKeno Fischer2014-08-061-2/+3
| | | | | | | | | | Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D4815 llvm-svn: 214996
* Creates a socket host object.Zachary Turner2014-08-061-1/+2
| | | | | | | | | | | | | | | | | | This patch moves the logic of many common socket operations into its own class lldb_private::Socket. It then modifies the ConnectionFileDescriptor class, and a few users of that class, to use this new Socket class instead of hardcoding socket logic directly. Finally, this patch creates a common interface called IOObject for any objects that support reading and writing, so that endpoints such as sockets and files can be treated the same. Differential Revision: http://reviews.llvm.org/D4641 Reviewed by: Todd Fiala, Greg Clayton llvm-svn: 214984
* After you attach, give the process plugin a chance to report back (throughJim Ingham2014-08-022-2/+4
| | | | | | | | DidAttach) the architecture of the binary you attached to. <rdar://problem/17891396> llvm-svn: 214603
* Modify the EFI KDP debugging to not use any dynamic loader since it does ↵Greg Clayton2014-07-161-1/+35
| | | | | | | | | | manual dynamic loading itself via python modules. Also track down the required binary by trying to locate the main executable module through LLDB's symbol and executable file locating code. <rdar://problem/16570258> llvm-svn: 213199
* Change ProcessKDP::DoReadMemory() to break up large memoryJason Molenda2014-05-211-1/+25
| | | | | | | | | read requests into smaller chunks; some remote kdp stubs cannot handle memory reads larger than a KB or two & will error out. <rdar://problem/16983125> llvm-svn: 209341
* Fixed CTRL+C related issues:Greg Clayton2014-05-021-0/+1
| | | | | | | | | | | | - CTRL+C wasn't clearing the command in lldb - CTRL+C doesn't work in python macros in lldb - Ctrl+C no longer interrupts the running process that you attach to <rdar://problem/15949205> <rdar://problem/16778652> <rdar://problem/16774411> llvm-svn: 207816
* Workaround for collision between enum members in LLVM's MachO.h and system ↵Jim Ingham2014-04-022-2/+1
| | | | | | | | | | headers on Mac OS X (in particular mach/machine.h). <rdar://problem/16494607> llvm-svn: 205480
* lldb arm64 import.Jason Molenda2014-03-294-0/+227
| | | | | | | | | | | | | | | | 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
* Move calls to DisableAllBreakpointSites() and ↵Andrew MacPherson2014-03-251-4/+0
| | | | | | m_thread_list.DiscardThreadPlans() into base Process::Destroy() instead of in subclass DoDestroy() methods. llvm-svn: 204752
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-1/+0
| | | | | | | | | | | | 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
OpenPOWER on IntegriCloud