From ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:12:36 +0000 Subject: Vendor import of lldb trunk r321017: https://llvm.org/svn/llvm-project/lldb/trunk@321017 --- source/Core/Value.cpp | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) (limited to 'source/Core/Value.cpp') diff --git a/source/Core/Value.cpp b/source/Core/Value.cpp index 63385511edb66..d415f1b09eb79 100644 --- a/source/Core/Value.cpp +++ b/source/Core/Value.cpp @@ -10,7 +10,6 @@ #include "lldb/Core/Value.h" #include "lldb/Core/Address.h" // for Address -#include "lldb/Core/ArchSpec.h" // for ArchSpec #include "lldb/Core/Module.h" #include "lldb/Core/State.h" #include "lldb/Symbol/CompilerType.h" @@ -143,6 +142,9 @@ Type *Value::GetType() { } size_t Value::AppendDataToHostBuffer(const Value &rhs) { + if (this == &rhs) + return 0; + size_t curr_size = m_data_buffer.GetByteSize(); Status error; switch (rhs.GetValueType()) { @@ -379,31 +381,6 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, } else address = LLDB_INVALID_ADDRESS; } - // else - // { - // ModuleSP exe_module_sp - // (target->GetExecutableModule()); - // if (exe_module_sp) - // { - // address = - // m_value.ULongLong(LLDB_INVALID_ADDRESS); - // if (address != LLDB_INVALID_ADDRESS) - // { - // if - // (exe_module_sp->ResolveFileAddress(address, - // file_so_addr)) - // { - // data.SetByteOrder(target->GetArchitecture().GetByteOrder()); - // data.SetAddressByteSize(target->GetArchitecture().GetAddressByteSize()); - // address_type = eAddressTypeFile; - // } - // else - // { - // address = LLDB_INVALID_ADDRESS; - // } - // } - // } - // } } else { error.SetErrorString("can't read load address (invalid process)"); } @@ -560,7 +537,7 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, "trying to read from host address of 0."); return error; } - memcpy(dst, (uint8_t *)NULL + address, byte_size); + memcpy(dst, reinterpret_cast(address), byte_size); } else if ((address_type == eAddressTypeLoad) || (address_type == eAddressTypeFile)) { if (file_so_addr.IsValid()) { -- cgit v1.2.3