summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-0713-71/+50
| | | | | | | | | | | | | | | this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
* Fixed a missing brace.Sean Callanan2017-03-071-1/+1
| | | | llvm-svn: 297128
* Use LLVM for all stat-related functionality.Zachary Turner2017-03-0713-50/+71
| | | | | | | | | | This deletes LLDB's FileType enumeration and replaces all users, and all calls to functions that check whether a file exists etc with corresponding calls to LLVM. Differential Revision: https://reviews.llvm.org/D30624 llvm-svn: 297116
* Remove FileSpec::ReadFileContents.Zachary Turner2017-03-061-7/+11
| | | | | | | | | | | | | | | | This functionality is subsumed by DataBufferLLVM, which is also more efficient since it will try to mmap. However, we don't yet support mmaping writable private sections, and in some cases we were using ReadFileContents and then modifying the buffer. To address that I've added a flag to the DataBufferLLVM methods that allow you to map privately, which disables the mmaping path entirely. Eventually we should teach DataBufferLLVM to use mmap with writable private, but that is orthogonal to this effort. Differential Revision: https://reviews.llvm.org/D30622 llvm-svn: 297095
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-043-6/+6
| | | | llvm-svn: 296943
* Move Log from Core -> Utility.Zachary Turner2017-03-0316-16/+16
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Fix various warnings. NFCZachary Turner2017-03-021-1/+1
| | | | llvm-svn: 296717
* Finish breaking the dependency from Utility.Zachary Turner2017-02-162-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D29964 llvm-svn: 295368
* UriParser cleanupPavel Labath2017-02-103-7/+3
| | | | | | | - move the header file to the include folder - enclose the class in the proper namespace llvm-svn: 294741
* Synchronize PlatformFreeBSD with LinuxEd Maste2017-02-072-278/+91
| | | | | | | | | | Inspired by r294145 for NetBSD, this reduces diffs between the FreeBSD and Linux/NetBSD Platform implementations. Further diff reduction will occur once FreeBSD switches to using the remote process plugin. Differential Revision: https://reviews.llvm.org/D29667 llvm-svn: 294340
* Switch PlatformLinux to LLDB_LOGPavel Labath2017-02-061-83/+21
| | | | llvm-svn: 294243
* Fix darwin build (llvm::once_flag fallout)Pavel Labath2017-02-061-0/+1
| | | | llvm-svn: 294221
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-062-6/+7
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
* Synchronize PlatformNetBSD with LinuxKamil Rytarowski2017-02-052-310/+298
| | | | | | | | | | | | | | | | | | | | | Summary: Update the code to the new world code. These changes are needed for remote process plugin. Sponsored by <The NetBSD Foundation> Reviewers: emaste, clayborg, joerg, labath Reviewed By: clayborg, labath Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29266 llvm-svn: 294145
* Clean up PlatformLinux codePavel Labath2017-02-052-70/+1
| | | | | | | | don't create a platform.linux setting category, as it contains no actual settings, and I don't forsee adding any soon. Also remove some unused includes while I'm in there. llvm-svn: 294114
* Remove LIBLLDB_LOG_VERBOSE categoryPavel Labath2017-02-053-81/+34
| | | | | | | | | | | | | | | | | | | | | Summary: Per discussion in D28616, having two ways two request logging (log enable lldb XXX verbose && log enable -v lldb XXX) is confusing. This removes the first option and standardizes all code to use the second one. I've added a LLDB_LOGV macro as a shorthand for if(log && log->GetVerbose()) and switched most of the affected log statements to use that (I've only left a couple of cases that were doing complex computations in an if(log) block). Reviewers: jingham, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29510 llvm-svn: 294113
* Push down more common code into PlatformPOSIXPavel Labath2017-02-0312-226/+51
| | | | | | | | | | | | | | | | | | | | Summary: - GetFileWithUUID: All platforms except PlatformDarwin had this. However, I see no reason why this code would not apply there as well. - GetProcessInfo, FindProcesses: The implementation was the same in all classes. - GetFullNameForDylib: This code should apply to all non-darwin platforms. I've kept the PlatformDarwin override as the situation is different there. Reviewers: clayborg, krytarowski, emaste Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29496 llvm-svn: 294019
* Move classes from Core -> Utility.Zachary Turner2017-02-0222-35/+35
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* Unify PlatformPOSIX::ResolveExecutablePavel Labath2017-02-0212-563/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: various platforms very using nearly identical code for this method. As far as I can tell there was nothing platform-specific about the differences, but rather it looked like it was caused by tiny tweaks being made to individual copies without affecting the overall functionality. I have taken the superset of all these tweaks and put it into one method in the base class (incidentaly, nobody was using the base class implementation of the method, as all classes were overriding it). From the darwin class I took the slightly improved error reporting (checking whether the file is readable) and the ResolveExecutableInBundle call (which has no effect elsewhere as the function is already a no-op on non-darwin platforms). From the linux class I took the set-the-triple-vendor-to-host-if-unspecified tweak (present in PlatformKalimba as well). PlatformWindows has an identical copy as well. We could resolve that by pushing this code further down into Platform class, that that would require pushing the m_remote_platform_sp member as well, which seems like a bad design choice. Reviewers: clayborg, emaste, krytarowski Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D29406 llvm-svn: 293910
* [CMake] [3/4] Update a batch of pluginsChris Bieneman2017-01-319-9/+77
| | | | | | This is extending the updates from r293696 to more LLDB plugins. llvm-svn: 293700
* FreeBSD ARM support for software single stepEd Maste2017-01-241-0/+6
| | | | | | | | | | | Implementation of software single step for FreeBSD on ARM. The code is largely based on the Linux implementation of the same functionality. Patch by Dmitry Mikulin! Differential Revision: https://reviews.llvm.org/D25756 llvm-svn: 292937
* Use Timeout<> in EvaluateExpressionOptions classPavel Labath2016-12-061-1/+1
| | | | llvm-svn: 288797
* Convert most of the Process class to Timeout<>Pavel Labath2016-11-301-1/+1
| | | | | | | | | | | This changes most of the class to use the new Timeout class. The one function left is RunThreadPlan, which I left for a separate change as the function is massive. A couple of things to call out: - I've renamed the affected functions to match the listener interface names. This should also help catch any places I did not convert at compile time. - I've deleted the WaitForState function as it was unused. llvm-svn: 288241
* Introduce Chrono to the Connection class. NFCI.Pavel Labath2016-11-251-5/+4
| | | | llvm-svn: 287922
* Use more chrono in AdbClientPavel Labath2016-11-243-11/+13
| | | | | | This refactors AdbClient interface in terms of std::chrono. llvm-svn: 287880
* Use chrono in AdbClientPavel Labath2016-11-242-29/+19
| | | | | | | This refactors the class implementations to use chrono. I'll follow this up with a refactor of the class interface. llvm-svn: 287879
* Change CreateTarget and dependents to accept StringRef.Zachary Turner2016-11-186-15/+15
| | | | llvm-svn: 287376
* Convert Platform, Process, and Connection functions to StringRef.Zachary Turner2016-11-176-15/+15
| | | | | | All tests pass on Linux and Windows. llvm-svn: 287259
* Convert UriParser to use StringRef.Zachary Turner2016-11-176-14/+17
| | | | llvm-svn: 287190
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-1616-24/+24
| | | | | | | | | | | | | | | 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
* Fix a deadlock issue that would happen when loading an AppleTV or watchOS ↵Greg Clayton2016-11-148-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | binary. This was a regression that was caused by svn revision 269877: commit 1ded4a2a25d60dd2c81bd432bcf63b6ded58e5d6 Author: Saleem Abdulrasool <compnerd@compnerd.org> Date: Wed May 18 01:59:10 2016 +0000 remove use of Mutex in favour of std::{,recursive_}mutex 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. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@269877 91177308-0d34-0410-b5e6-96231b3b80d8 This change actually changed the Platform::m_mutex to be non-recursive which caused the regression. <rdar://problem/29094384> llvm-svn: 286908
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-1111-29/+29
| | | | | | | | 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-1111-29/+29
| | | | | | | | | 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
* UserExpression::Evaluate only returns a non-empty ValueObjectSPJim Ingham2016-11-071-2/+6
| | | | | | | | | | | | if it returns eExpressionCompleted. Don't try to get the error from the ValueObjectSP if that's not true. I just have a report of this from the field, I don't know how to make it fail yet. <rdar://problem/29113004> llvm-svn: 286170
* Fix an issue where LLDB would hang trying to launch tvOS simulator binariesEnrico Granata2016-11-072-2/+3
| | | | llvm-svn: 286116
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-027-31/+26
| | | | | | | | | | 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-2/+6
| | | | | | | | | | | | | | | | | | | | | 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
* Remove usages of TimeValue from gdb-remote process pluginPavel Labath2016-10-311-1/+1
| | | | | | | | | | | | | | | Summary: Most of the changes are very straight-forward, the only tricky part was the "packet speed-test" function, which is very time-heavy. As the function was completely untested, I added a quick unit smoke test for it. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D25391 llvm-svn: 285602
* Finish adding the individual instruction tests to the x86 unwinderJason Molenda2016-10-041-0/+4
| | | | | | | | | | | | | unittests. If I have time, I'd like to see if I can write some tests of the eh_frame augmentation which is a wholly separate code path (it seems like maybe it should be rolled into the main instruction scanning codepath, to be honest, and operate on the generated UnwindPlan instead of bothering with raw instructions at all). Outside the eh_frame augmentation, I'm comfortable that this unwind generator is being tested well now. llvm-svn: 283186
* [gdb-remote] Remove the const char * version of SendPacketAndWaitForResponsePavel Labath2016-09-231-3/+2
| | | | | | Switch all callers to use the StringRef version. llvm-svn: 282236
* Convert 3 more functions to use a StringRef.Zachary Turner2016-09-191-2/+3
| | | | | | | | This converts Args::Unshift, Args::AddOrReplaceEnvironmentVariable, and Args::ContainsEnvironmentVariable to use StringRefs. The code is also simplified somewhat as a result. llvm-svn: 281942
* Fix more functions in Args to use StringRef.Zachary Turner2016-09-192-2/+2
| | | | | | | | | | | | | | | This patch also marks the const char* versions as =delete to prevent their use. This has the potential to cause build breakages on some platforms which I can't compile. I have tested on Windows, Linux, and OSX. Best practices for fixing broken callsites are outlined in Args.h in a comment above the deleted function declarations. Eventually we can remove these =delete declarations, but for now they are important to make sure that all implicit conversions from const char * are manually audited to make sure that they do not invoke a conversion from nullptr. llvm-svn: 281919
* Convert many functions to use StringRefs.Zachary Turner2016-09-175-40/+45
| | | | | | | | | | | | | Where possible, remove the const char* version. To keep the risk and impact here minimal, I've only done the simplest functions. In the process, I found a few opportunities for adding some unit tests, so I added those as well. Tested on Windows, Linux, and OSX. llvm-svn: 281799
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0642-14965/+12819
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Rewrite the GetFileInSDK methods in PlatformRemoteiOS,Jason Molenda2016-08-246-223/+57
| | | | | | | | | | | | | | | | PlatformRemoteAppleWatch, PlatformRemoteAppleTV and remove the GetFileInSDKRoot method from those classes. The rewrite uses the more modern FileSpec etc API to simplify, and handles the case where an SDK Root is given to lldb with the "/Symbols" directory name already appended. The new version will try appending "/Symbols" and "/Symbols.Internal" to the sdk root directories, and will also try appending nothing to the sdk root directory in case it's handed such an sdkroot. <rdar://problem/28000054> llvm-svn: 279688
* 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
* dlopen & dlclose can't throw C++ or ObjC exceptions, so don't do the extra ↵Jim Ingham2016-08-111-0/+1
| | | | | | | | | | work of setting & deleting the breakpoints to watch for this. <rdar://problem/27780214> llvm-svn: 278305
* Delete Host/windows/win32.hZachary Turner2016-08-091-0/+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
* Adjust LLDB's iOS simulator interface for changes in CoreSimulatorEnrico Granata2016-08-096-21/+37
| | | | | | rdar://27732333 and rdar://27732377 llvm-svn: 278166
* Change the indexing done for kernel/kext directories to be recursive.Jason Molenda2016-08-052-498/+257
| | | | | | | | | | | | | | Also re-write how most of the directory indexing is done - as it has grown over the years, it has become a bit of a mess and was overdue for a cleanup. Most importantly, this allows you to specify a directory with the platform.plugin.darwin-kernel.kext-directories setting and now lldb will search for kexts and kernels in those directories recursively. <rdar://problem/20754467> llvm-svn: 277789
OpenPOWER on IntegriCloud