12#include "llvm/Support/MemoryBuffer.h"
14llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
18 (
"/proc/" + llvm::Twine(pid) +
"/task/" + llvm::Twine(tid) +
"/" + file)
20 auto Ret = llvm::MemoryBuffer::getFileAsStream(
File);
22 LLDB_LOG(log,
"Failed to open {0}: {1}",
File, Ret.getError().message());
26llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
29 std::string
File = (
"/proc/" + llvm::Twine(pid) +
"/" + file).str();
30 auto Ret = llvm::MemoryBuffer::getFileAsStream(
File);
32 LLDB_LOG(log,
"Failed to open {0}: {1}",
File, Ret.getError().message());
36llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
39 std::string
File = (
"/proc/" + file).str();
40 auto Ret = llvm::MemoryBuffer::getFileAsStream(
File);
42 LLDB_LOG(log,
"Failed to open {0}: {1}",
File, Ret.getError().message());
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
An abstract base class for files.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > getProcFile(::pid_t pid, ::pid_t tid, const llvm::Twine &file)