Path: blob/main/contrib/llvm-project/lldb/source/Host/aix/Support.cpp
213799 views
//===-- Support.cpp -------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/Host/aix/Support.h"9#include "lldb/Utility/LLDBLog.h"10#include "lldb/Utility/Log.h"11#include "llvm/Support/MemoryBuffer.h"1213llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>14lldb_private::getProcFile(::pid_t pid, ::pid_t tid, const llvm::Twine &file) {15Log *log = GetLog(LLDBLog::Host);16std::string File =17("/proc/" + llvm::Twine(pid) + "/lwp/" + llvm::Twine(tid) + "/" + file)18.str();19auto Ret = llvm::MemoryBuffer::getFileAsStream(File);20if (!Ret)21LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message());22return Ret;23}242526