summaryrefslogtreecommitdiff
path: root/source/Host/linux/Support.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-01 13:24:58 +0000
commit1b306c26ade71504511d2fa75b03dfaee77f9620 (patch)
tree2c4c77af2ba9632c24ebf216b9a39989d74f5725 /source/Host/linux/Support.cpp
parentfdea456ad833fbab0d3a296a58250950f11a498c (diff)
Notes
Diffstat (limited to 'source/Host/linux/Support.cpp')
-rw-r--r--source/Host/linux/Support.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/Host/linux/Support.cpp b/source/Host/linux/Support.cpp
index 8fbb60052e3f..31808401ea61 100644
--- a/source/Host/linux/Support.cpp
+++ b/source/Host/linux/Support.cpp
@@ -32,3 +32,13 @@ lldb_private::getProcFile(::pid_t pid, const llvm::Twine &file) {
LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message());
return Ret;
}
+
+llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
+lldb_private::getProcFile(const llvm::Twine &file) {
+ Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ std::string File = ("/proc/" + file).str();
+ auto Ret = llvm::MemoryBuffer::getFileAsStream(File);
+ if (!Ret)
+ LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message());
+ return Ret;
+}