summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r298334 until Zachary has a chance to fix the buildbot failureJason Molenda2017-03-217-12/+183
| | | | | | on macosx. llvm-svn: 298338
* Delete some dead code in HostInfo.Zachary Turner2017-03-215-41/+0
| | | | llvm-svn: 298335
* Delete various lldb FileSystem functions.Zachary Turner2017-03-217-183/+12
| | | | | | | | Use LLVM's equivalent versions instead. Differential Revision: https://reviews.llvm.org/D31111 llvm-svn: 298334
* [Support] Fill the file_status struct with link count.Zachary Turner2017-03-201-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D31110 llvm-svn: 298326
* Delete LLDB's MD5 code. Use LLVM instead.Zachary Turner2017-03-201-72/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D31108 llvm-svn: 298325
* Add a function to MD5 a file's contents.Zachary Turner2017-03-201-3/+1
| | | | | | | | | | | | | | | In doing so, clean up the MD5 interface a little. Most existing users only care about the lower 8 bytes of an MD5, but for some users that care about the upper and lower, there wasn't a good interface. Furthermore, consumers of the MD5 checksum were required to handle endianness details on their own, so it seems reasonable to abstract this into a nicer interface that just gives you the right value. Differential Revision: https://reviews.llvm.org/D31105 llvm-svn: 298322
* Fix syntax error when building with editline support.Zachary Turner2017-03-191-1/+1
| | | | llvm-svn: 298206
* Remove FileSystem::Get/SetFilePermissionsZachary Turner2017-03-192-50/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D31089 llvm-svn: 298205
* Remove FileSystem::MakeDirectory.Zachary Turner2017-03-194-58/+4
| | | | | | | | Have callers use llvm::sys::fs::create_directory() instead. Differential Revision: https://reviews.llvm.org/D31086 llvm-svn: 298203
* Move GetAuxvData from Host to relevant process pluginsPavel Labath2017-03-176-40/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: GetAuxvData was causing dependencies from host to target and linux process modules. It also does not fit netbsd use case, as there we can only read the auxiliary vector with ptrace, which is better done in the process plugin, with the other ptrace calls. I resolve these issues by moving the freebsd and linux versions into the relevant process plugins. In case of linux, this required adding an interface in NativeProcessProtocol. The empty definitions on other platforms can simply be removed. To get the code compiling I had to add ProcessGdbRemote -> ProcessLinux dependency, which was not caught before because we depended on it transitively. Reviewers: zturner, emaste Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D31031 llvm-svn: 298066
* Remove HostThreadLinux/Free/NetBSDPavel Labath2017-03-174-150/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
* Remove some ProcFileReader occurencesPavel Labath2017-03-153-227/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ProcFileReader is the cause of the dependency from Host to ProcessLinux module. Since it's interface is also obsolete (ReadIntoDataBuffer is trivially replaceable by llvm::MemoryBuffer functions and ProcessLineByLine is trivially implementable with StringRefs), instead of moving it around I'm planning to obliterate it. This is the first step, where I remove a couple of occurences in linux/Host.cpp, and modernize some code around that. I have introduced linux/Support.h, which holds two utility functions now, whose resposibility is to construct the appropriate proc file names -- the only useful feature of ProcFileReader. I add a couple of tests for these functions, and for Host::GetProcessInfo. It's worth noting that these are the first host-specific unit tests in lldb. Reviewers: zturner, eugene Subscribers: srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30942 llvm-svn: 297843
* Remove lldb streams from the Log class completelyPavel Labath2017-03-151-3/+2
| | | | | | | | | | | | | | | | | | | | | Summary: previously we switched to llvm streams for log output, this completes the switch for the error streams. I also clean up the includes and remove the unused argument from DisableAllLogChannels(). This required adding a bit of boiler plate to convert the output in the command interpreter, but that should go away when we switch command results to use llvm streams as well. Reviewers: zturner, eugene Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D30894 llvm-svn: 297812
* Delete dead code. NFCJonathan Roelofs2017-03-131-11/+0
| | | | | | | | Also has the side-effect of fixing the build on systems with glibc < 2.12 https://reviews.llvm.org/D30844 llvm-svn: 297626
* Fix windows build broken by r297612Pavel Labath2017-03-131-1/+1
| | | | | | I have got my boolean logic incorrect. Sorry about the spam. llvm-svn: 297615
* Fix android buildPavel Labath2017-03-131-1/+1
| | | | | | | | | | | | | | getpwent is not available on android until API level 21, and even then it is only available when doing a non-static link. Since android's concept of users is very different from linux, it's doubtful the home directory resolution would be useful, so I approximate this state by just not using getpwent on android. We've had another getpwent occurance in FileSpec for a while -- it wasn't causing problems because it was stripped out by the linker, but I disable that also, for consistency's sake. llvm-svn: 297612
* Fix Linux build for the FileSpec changesPavel Labath2017-03-131-5/+2
| | | | | | | Propagate changes that were made during review, and fix a couple of warnings while I'm in there. llvm-svn: 297609
* Use LLVM for file / directory enumeration.Zachary Turner2017-03-131-243/+36
| | | | | | | | | | FileSpec::EnumerateDirectory has a bunch of platform-specific gunk in it for posix and non-posix platforms. We can get rid of all this by using LLVM's easy-to-use directory iterators. Differential Revision: https://reviews.llvm.org/D30807 llvm-svn: 297598
* Remove LLDB's recursive directory deletion function.Zachary Turner2017-03-093-87/+1
| | | | | | LLVM now has such a function, so we use that instead. llvm-svn: 297360
* Resubmit FileSystem changes.Zachary Turner2017-03-087-121/+84
| | | | | | | | | | This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-077-80/+120
| | | | | | | | | | | | | | | 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
* Remove FileSpec dependency on FileSystem.Zachary Turner2017-03-071-29/+23
| | | | llvm-svn: 297119
* Fix linux build.Zachary Turner2017-03-071-2/+2
| | | | llvm-svn: 297117
* Use LLVM for all stat-related functionality.Zachary Turner2017-03-077-91/+57
| | | | | | | | | | 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
* Add missing include in FileSpec.Zachary Turner2017-03-061-0/+1
| | | | llvm-svn: 297102
* Remove dependency from FileSpec to ArchSpec.Zachary Turner2017-03-061-9/+8
| | | | | | | All it really needs is the llvm::Triple, so make FileSpec take the Triple directly instead of the ArchSpec. llvm-svn: 297096
* Remove FileSpec::ReadFileContents.Zachary Turner2017-03-062-80/+5
| | | | | | | | | | | | | | | | 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
* Delete LLDB's code for getting / setting thread name.Zachary Turner2017-03-0411-258/+3
| | | | | | | This is now functionality in LLVM, and all callers have already been updated to use the LLVM functions. llvm-svn: 296946
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-0410-21/+21
| | | | llvm-svn: 296943
* Move UUID from Core -> Utility.Zachary Turner2017-03-042-2/+2
| | | | llvm-svn: 296941
* Move Log from Core -> Utility.Zachary Turner2017-03-0328-28/+28
| | | | | | | | | 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
* Remove some dead code in FileSpec.Zachary Turner2017-03-031-15/+0
| | | | | | | | This in turn triggered some fallout where other files had been transitively picking up includes that they needed from FileSpec.h, so I've fixed those up as well. llvm-svn: 296855
* Delete DataBufferMemoryMap.Zachary Turner2017-02-241-34/+0
| | | | | | | | | | | | | | | After a series of patches on the LLVM side to get the mmaping code up to compatibility with LLDB's needs, it is now ready to go, which means LLDB's custom mmapping code is redundant. So this patch deletes it all and uses LLVM's code instead. In the future, we could take this one step further and delete even the lldb DataBuffer base class and rely entirely on LLVM's facilities, but this is a job for another day. Differential Revision: https://reviews.llvm.org/D30054 llvm-svn: 296159
* Hardware breakpoints for Linux on Arm/AArch64 targetsOmair Javaid2017-02-242-10/+108
| | | | | | | | Please look at below differential link for upstream discussion. Differential revision: https://reviews.llvm.org/D29669 llvm-svn: 296119
* Implement QPassSignals GDB package in lldb-serverPavel Labath2017-02-241-0/+6
| | | | | | | | | | | | | | | Summary: QPassSignals package allows lldb client to tell lldb-server to ignore certain types of signals and re-inject them back to inferior without stopping execution. Reviewers: jmajors, labath Subscribers: danalbert, srhines, emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30286 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 296101
* Switch NetBSD from paccept(2) to accept4(2)Kamil Rytarowski2017-02-241-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD 8.0 will ship with accept4(2) in libc wrapping paccept(2). This change reduces needless difference with other platforms. Older versions of NetBSD will not be supported. No functional change. Sponsored by <The NetBSD Foundation> Reviewers: joerg, emaste, labath, clayborg Reviewed By: emaste, labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D30288 llvm-svn: 296070
* Finish breaking the dependency from Utility.Zachary Turner2017-02-162-0/+311
| | | | | | Differential Revision: https://reviews.llvm.org/D29964 llvm-svn: 295368
* Reindent the code to avoid an error with gcc:Sylvestre Ledru2017-02-161-35/+35
| | | | | | error: this ‘else’ clause does not guard... [-Werror=misleading-indentation] llvm-svn: 295352
* Fix a bug introduced in r235737 where code with important sideJason Molenda2017-02-162-2/+4
| | | | | | | | | | effects was passed as an expression to assert() calls. If lldb is built without asserts, the expression was eliminated and we lost the side effects -- these methods stopped working. <rdar://problem/30342959> llvm-svn: 295271
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-144-5/+5
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Add a format_provider for the Timeout classPavel Labath2017-02-101-4/+1
| | | | | | | | | | and use it in the appropriate log statements. Formatting of chrono types in log messages was very clunky. This should make it much nicer to use and give better output. For details of the formatting options see the chrono formatter in llvm. llvm-svn: 294738
* Fix darwin build (error.PutToLog fallout)Pavel Labath2017-02-061-18/+6
| | | | llvm-svn: 294222
* Really fix build on non-windows platforms :)Pavel Labath2017-02-061-1/+1
| | | | llvm-svn: 294215
* Try to fix build on non-Windows platforms.Zachary Turner2017-02-061-5/+6
| | | | llvm-svn: 294213
* Get rid of Error::PutToLog().Zachary Turner2017-02-061-45/+41
| | | | | | | | | | | | | Instead just rely on LLDB_LOG(). This is part of an effort to sort out dependency hell in LLDB. Error is in Utility, but Log is in Core. Core can depend on Utility, but not vice versa. So this patch moves the knowledge about how to log Errors from the Error class to the Log file. Differential Revision: https://reviews.llvm.org/D29514 llvm-svn: 294210
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-064-37/+43
| | | | | | | | | | | | | | | | | | | | | 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
* Fix mac build breakage due to StringStream movePavel Labath2017-02-021-1/+1
| | | | llvm-svn: 293948
* Move classes from Core -> Utility.Zachary Turner2017-02-0223-30/+30
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix android build of the new process launcherPavel Labath2017-02-011-0/+1
| | | | | | | Android does not define the "cross-platform" symbol PT_TRACE_ME. Define it ourselves, so we can keep the rest of the code generic. llvm-svn: 293779
* Document that LaunchProcessPosixSpawn is used on NetBSDKamil Rytarowski2017-02-011-1/+1
| | | | | | | | No functional change. Sponsored by <The NetBSD Foundation> llvm-svn: 293770
OpenPOWER on IntegriCloud