aboutsummaryrefslogtreecommitdiffstats
path: root/source/Plugins/Process/minidump
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-16 19:47:58 +0000
commitb76161e41bc2c07cd47f9c61f875d1be95e26d10 (patch)
treed03c19ce10dec6419f97df1d4dac9d47eb88982f /source/Plugins/Process/minidump
parent8b4000f13b303cc154136abc74c55670673e2a96 (diff)
downloadsrc-b76161e41bc2c07cd47f9c61f875d1be95e26d10.tar.gz
src-b76161e41bc2c07cd47f9c61f875d1be95e26d10.zip
Vendor import of lldb trunk r303197:vendor/lldb/lldb-trunk-r303197
Notes
Notes: svn path=/vendor/lldb/dist/; revision=318378 svn path=/vendor/lldb/lldb-trunk-r303197/; revision=318379; tag=vendor/lldb/lldb-trunk-r303197
Diffstat (limited to 'source/Plugins/Process/minidump')
-rw-r--r--source/Plugins/Process/minidump/MinidumpParser.cpp4
-rw-r--r--source/Plugins/Process/minidump/MinidumpParser.h2
-rw-r--r--source/Plugins/Process/minidump/MinidumpTypes.cpp24
-rw-r--r--source/Plugins/Process/minidump/MinidumpTypes.h6
-rw-r--r--source/Plugins/Process/minidump/ProcessMinidump.cpp18
-rw-r--r--source/Plugins/Process/minidump/ProcessMinidump.h14
6 files changed, 34 insertions, 34 deletions
diff --git a/source/Plugins/Process/minidump/MinidumpParser.cpp b/source/Plugins/Process/minidump/MinidumpParser.cpp
index 37b3709c09c1..36350fdb6398 100644
--- a/source/Plugins/Process/minidump/MinidumpParser.cpp
+++ b/source/Plugins/Process/minidump/MinidumpParser.cpp
@@ -45,7 +45,7 @@ MinidumpParser::Create(const lldb::DataBufferSP &data_buf_sp) {
}
const MinidumpDirectory *directory = nullptr;
- Error error;
+ Status error;
llvm::ArrayRef<uint8_t> directory_data(
data_buf_sp->GetBytes() + directory_list_offset,
sizeof(MinidumpDirectory) * header->streams_count);
@@ -126,7 +126,7 @@ MinidumpParser::GetThreadContextWow64(const MinidumpThread &td) {
return {};
const TEB64 *wow64teb;
- Error error = consumeObject(teb_mem, wow64teb);
+ Status error = consumeObject(teb_mem, wow64teb);
if (error.Fail())
return {};
diff --git a/source/Plugins/Process/minidump/MinidumpParser.h b/source/Plugins/Process/minidump/MinidumpParser.h
index 189aeb3d64e6..df6deb482afd 100644
--- a/source/Plugins/Process/minidump/MinidumpParser.h
+++ b/source/Plugins/Process/minidump/MinidumpParser.h
@@ -17,7 +17,7 @@
// Other libraries and framework includes
#include "lldb/Core/ArchSpec.h"
#include "lldb/Utility/DataBuffer.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
diff --git a/source/Plugins/Process/minidump/MinidumpTypes.cpp b/source/Plugins/Process/minidump/MinidumpTypes.cpp
index 863d124a7ccc..24ce3f94c094 100644
--- a/source/Plugins/Process/minidump/MinidumpTypes.cpp
+++ b/source/Plugins/Process/minidump/MinidumpTypes.cpp
@@ -19,7 +19,7 @@ using namespace minidump;
const MinidumpHeader *MinidumpHeader::Parse(llvm::ArrayRef<uint8_t> &data) {
const MinidumpHeader *header = nullptr;
- Error error = consumeObject(data, header);
+ Status error = consumeObject(data, header);
const MinidumpHeaderConstants signature =
static_cast<const MinidumpHeaderConstants>(
@@ -45,7 +45,7 @@ lldb_private::minidump::parseMinidumpString(llvm::ArrayRef<uint8_t> &data) {
std::string result;
const uint32_t *source_length;
- Error error = consumeObject(data, source_length);
+ Status error = consumeObject(data, source_length);
if (error.Fail() || *source_length > data.size() || *source_length % 2 != 0)
return llvm::None;
@@ -71,7 +71,7 @@ lldb_private::minidump::parseMinidumpString(llvm::ArrayRef<uint8_t> &data) {
// MinidumpThread
const MinidumpThread *MinidumpThread::Parse(llvm::ArrayRef<uint8_t> &data) {
const MinidumpThread *thread = nullptr;
- Error error = consumeObject(data, thread);
+ Status error = consumeObject(data, thread);
if (error.Fail())
return nullptr;
@@ -81,7 +81,7 @@ const MinidumpThread *MinidumpThread::Parse(llvm::ArrayRef<uint8_t> &data) {
llvm::ArrayRef<MinidumpThread>
MinidumpThread::ParseThreadList(llvm::ArrayRef<uint8_t> &data) {
const llvm::support::ulittle32_t *thread_count;
- Error error = consumeObject(data, thread_count);
+ Status error = consumeObject(data, thread_count);
if (error.Fail() || *thread_count * sizeof(MinidumpThread) > data.size())
return {};
@@ -93,7 +93,7 @@ MinidumpThread::ParseThreadList(llvm::ArrayRef<uint8_t> &data) {
const MinidumpSystemInfo *
MinidumpSystemInfo::Parse(llvm::ArrayRef<uint8_t> &data) {
const MinidumpSystemInfo *system_info;
- Error error = consumeObject(data, system_info);
+ Status error = consumeObject(data, system_info);
if (error.Fail())
return nullptr;
@@ -103,7 +103,7 @@ MinidumpSystemInfo::Parse(llvm::ArrayRef<uint8_t> &data) {
// MinidumpMiscInfo
const MinidumpMiscInfo *MinidumpMiscInfo::Parse(llvm::ArrayRef<uint8_t> &data) {
const MinidumpMiscInfo *misc_info;
- Error error = consumeObject(data, misc_info);
+ Status error = consumeObject(data, misc_info);
if (error.Fail())
return nullptr;
@@ -147,7 +147,7 @@ lldb::pid_t LinuxProcStatus::GetPid() const { return pid; }
// Module stuff
const MinidumpModule *MinidumpModule::Parse(llvm::ArrayRef<uint8_t> &data) {
const MinidumpModule *module = nullptr;
- Error error = consumeObject(data, module);
+ Status error = consumeObject(data, module);
if (error.Fail())
return nullptr;
@@ -158,7 +158,7 @@ llvm::ArrayRef<MinidumpModule>
MinidumpModule::ParseModuleList(llvm::ArrayRef<uint8_t> &data) {
const llvm::support::ulittle32_t *modules_count;
- Error error = consumeObject(data, modules_count);
+ Status error = consumeObject(data, modules_count);
if (error.Fail() || *modules_count * sizeof(MinidumpModule) > data.size())
return {};
@@ -170,7 +170,7 @@ MinidumpModule::ParseModuleList(llvm::ArrayRef<uint8_t> &data) {
const MinidumpExceptionStream *
MinidumpExceptionStream::Parse(llvm::ArrayRef<uint8_t> &data) {
const MinidumpExceptionStream *exception_stream = nullptr;
- Error error = consumeObject(data, exception_stream);
+ Status error = consumeObject(data, exception_stream);
if (error.Fail())
return nullptr;
@@ -180,7 +180,7 @@ MinidumpExceptionStream::Parse(llvm::ArrayRef<uint8_t> &data) {
llvm::ArrayRef<MinidumpMemoryDescriptor>
MinidumpMemoryDescriptor::ParseMemoryList(llvm::ArrayRef<uint8_t> &data) {
const llvm::support::ulittle32_t *mem_ranges_count;
- Error error = consumeObject(data, mem_ranges_count);
+ Status error = consumeObject(data, mem_ranges_count);
if (error.Fail() ||
*mem_ranges_count * sizeof(MinidumpMemoryDescriptor) > data.size())
return {};
@@ -193,7 +193,7 @@ MinidumpMemoryDescriptor::ParseMemoryList(llvm::ArrayRef<uint8_t> &data) {
std::pair<llvm::ArrayRef<MinidumpMemoryDescriptor64>, uint64_t>
MinidumpMemoryDescriptor64::ParseMemory64List(llvm::ArrayRef<uint8_t> &data) {
const llvm::support::ulittle64_t *mem_ranges_count;
- Error error = consumeObject(data, mem_ranges_count);
+ Status error = consumeObject(data, mem_ranges_count);
if (error.Fail() ||
*mem_ranges_count * sizeof(MinidumpMemoryDescriptor64) > data.size())
return {};
@@ -213,7 +213,7 @@ MinidumpMemoryDescriptor64::ParseMemory64List(llvm::ArrayRef<uint8_t> &data) {
std::vector<const MinidumpMemoryInfo *>
MinidumpMemoryInfo::ParseMemoryInfoList(llvm::ArrayRef<uint8_t> &data) {
const MinidumpMemoryInfoListHeader *header;
- Error error = consumeObject(data, header);
+ Status error = consumeObject(data, header);
if (error.Fail() ||
header->size_of_header < sizeof(MinidumpMemoryInfoListHeader) ||
header->size_of_entry < sizeof(MinidumpMemoryInfo))
diff --git a/source/Plugins/Process/minidump/MinidumpTypes.h b/source/Plugins/Process/minidump/MinidumpTypes.h
index 42de7eaaca03..6de4f55a769d 100644
--- a/source/Plugins/Process/minidump/MinidumpTypes.h
+++ b/source/Plugins/Process/minidump/MinidumpTypes.h
@@ -13,7 +13,7 @@
// Project includes
// Other libraries and framework includes
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/BitmaskEnum.h"
@@ -158,8 +158,8 @@ enum class MinidumpMiscInfoFlags : uint32_t {
};
template <typename T>
-Error consumeObject(llvm::ArrayRef<uint8_t> &Buffer, const T *&Object) {
- Error error;
+Status consumeObject(llvm::ArrayRef<uint8_t> &Buffer, const T *&Object) {
+ Status error;
if (Buffer.size() < sizeof(T)) {
error.SetErrorString("Insufficient buffer!");
return error;
diff --git a/source/Plugins/Process/minidump/ProcessMinidump.cpp b/source/Plugins/Process/minidump/ProcessMinidump.cpp
index f3f4664ad6e1..d4d65c044eab 100644
--- a/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ b/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -113,8 +113,8 @@ void ProcessMinidump::Terminate() {
PluginManager::UnregisterPlugin(ProcessMinidump::CreateInstance);
}
-Error ProcessMinidump::DoLoadCore() {
- Error error;
+Status ProcessMinidump::DoLoadCore() {
+ Status error;
m_thread_list = m_minidump_parser.GetThreads();
m_active_exception = m_minidump_parser.GetExceptionStream();
@@ -141,7 +141,7 @@ ConstString ProcessMinidump::GetPluginName() { return GetPluginNameStatic(); }
uint32_t ProcessMinidump::GetPluginVersion() { return 1; }
-Error ProcessMinidump::DoDestroy() { return Error(); }
+Status ProcessMinidump::DoDestroy() { return Status(); }
void ProcessMinidump::RefreshStateAfterStop() {
if (!m_active_exception)
@@ -184,14 +184,14 @@ bool ProcessMinidump::IsAlive() { return true; }
bool ProcessMinidump::WarnBeforeDetach() const { return false; }
size_t ProcessMinidump::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
- Error &error) {
+ Status &error) {
// Don't allow the caching that lldb_private::Process::ReadMemory does
// since we have it all cached in our dump file anyway.
return DoReadMemory(addr, buf, size, error);
}
size_t ProcessMinidump::DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
- Error &error) {
+ Status &error) {
llvm::ArrayRef<uint8_t> mem = m_minidump_parser.GetMemory(addr, size);
if (mem.empty()) {
@@ -215,9 +215,9 @@ ArchSpec ProcessMinidump::GetArchitecture() {
return ArchSpec(triple);
}
-Error ProcessMinidump::GetMemoryRegionInfo(lldb::addr_t load_addr,
- MemoryRegionInfo &range_info) {
- Error error;
+Status ProcessMinidump::GetMemoryRegionInfo(lldb::addr_t load_addr,
+ MemoryRegionInfo &range_info) {
+ Status error;
auto info = m_minidump_parser.GetMemoryRegionInfo(load_addr);
if (!info) {
error.SetErrorString("No valid MemoryRegionInfo found!");
@@ -278,7 +278,7 @@ void ProcessMinidump::ReadModuleList() {
const auto file_spec = FileSpec(name.getValue(), true);
ModuleSpec module_spec = file_spec;
- Error error;
+ Status error;
lldb::ModuleSP module_sp = GetTarget().GetSharedModule(module_spec, &error);
if (!module_sp || error.Fail()) {
continue;
diff --git a/source/Plugins/Process/minidump/ProcessMinidump.h b/source/Plugins/Process/minidump/ProcessMinidump.h
index 62407f927551..d5c46be97352 100644
--- a/source/Plugins/Process/minidump/ProcessMinidump.h
+++ b/source/Plugins/Process/minidump/ProcessMinidump.h
@@ -19,7 +19,7 @@
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ConstString.h"
-#include "lldb/Utility/Error.h"
+#include "lldb/Utility/Status.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
@@ -53,7 +53,7 @@ public:
bool CanDebug(lldb::TargetSP target_sp,
bool plugin_specified_by_name) override;
- Error DoLoadCore() override;
+ Status DoLoadCore() override;
DynamicLoader *GetDynamicLoader() override;
@@ -61,7 +61,7 @@ public:
uint32_t GetPluginVersion() override;
- Error DoDestroy() override;
+ Status DoDestroy() override;
void RefreshStateAfterStop() override;
@@ -70,15 +70,15 @@ public:
bool WarnBeforeDetach() const override;
size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size,
- Error &error) override;
+ Status &error) override;
size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
- Error &error) override;
+ Status &error) override;
ArchSpec GetArchitecture();
- Error GetMemoryRegionInfo(lldb::addr_t load_addr,
- MemoryRegionInfo &range_info) override;
+ Status GetMemoryRegionInfo(lldb::addr_t load_addr,
+ MemoryRegionInfo &range_info) override;
bool GetProcessInfo(ProcessInstanceInfo &info) override;