summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Host/linux
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-192-8/+6
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [FileSystem] Move path resolution logic out of FileSpecJonas Devlieghere2018-11-011-2/+9
| | | | | | | | | This patch removes the logic for resolving paths out of FileSpec and updates call sites to rely on the FileSystem class instead. Differential revision: https://reviews.llvm.org/D53915 llvm-svn: 345890
* Remove ObjectFile usage from HostLinux::GetProcessInfoPavel Labath2018-01-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ObjectFile class was used to determine the architecture of a running process by inspecting it's main executable. There were two issues with this: - it's in the wrong layer - the call can be very expensive (it can end up computing the crc of the whole file). Since the process is running on the host, ideally we would be able to just query the data straight from the OS like darwin does, but there doesn't seem to be a reasonable way to do that. So, this fixes the layering issue by using the llvm object library to inspect the file. Since we know the process is already running on the host, we just need to peek at a few bytes of the elf header to determine whether it's 32- or 64-bit (which should make this faster as well). Pretty much the same logic was implemented in NativeProcessProtocol::ResolveProcessArchitecture, so I delete this logic and replace calls with GetProcessInfo. Reviewers: eugene, krytarowski Subscribers: mgorny, hintonda, lldb-commits Differential Revision: https://reviews.llvm.org/D42488 llvm-svn: 323637
* Remove some ProcFileReader occurencesPavel Labath2017-03-152-0/+74
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
OpenPOWER on IntegriCloud