summaryrefslogtreecommitdiff
path: root/source/Core/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/Value.cpp')
-rw-r--r--source/Core/Value.cpp31
1 files changed, 4 insertions, 27 deletions
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<uint8_t *>(address), byte_size);
} else if ((address_type == eAddressTypeLoad) ||
(address_type == eAddressTypeFile)) {
if (file_so_addr.IsValid()) {