[Lldb-commits] [PATCH] D30942: Remove some ProcFileReader occurences

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 14 07:53:34 PDT 2017


labath created this revision.
Herald added subscribers: mgorny, srhines.

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.


https://reviews.llvm.org/D30942

Files:
  include/lldb/Host/linux/Support.h
  source/Host/CMakeLists.txt
  source/Host/linux/Host.cpp
  source/Host/linux/Support.cpp
  unittests/Host/CMakeLists.txt
  unittests/Host/linux/HostTest.cpp
  unittests/Host/linux/SupportTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30942.91727.patch
Type: text/x-patch
Size: 21334 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170314/475e208b/attachment-0001.bin>


More information about the lldb-commits mailing list