[Lldb-commits] [lldb] r368330 - Remove unused and undocumented data_offset parameter (NFC)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Thu Aug 8 12:22:33 PDT 2019
Author: adrian
Date: Thu Aug 8 12:22:32 2019
New Revision: 368330
URL: http://llvm.org/viewvc/llvm-project?rev=368330&view=rev
Log:
Remove unused and undocumented data_offset parameter (NFC)
Value::GetValueAsData() takes an undocumented parameter called
data_offset that is always 0.
Differential Revision: https://reviews.llvm.org/D65910
Modified:
lldb/trunk/include/lldb/Core/Value.h
lldb/trunk/source/Core/Value.cpp
lldb/trunk/source/Core/ValueObject.cpp
lldb/trunk/source/Core/ValueObjectCast.cpp
lldb/trunk/source/Core/ValueObjectChild.cpp
lldb/trunk/source/Core/ValueObjectConstResult.cpp
lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
lldb/trunk/source/Core/ValueObjectMemory.cpp
lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
lldb/trunk/source/Core/ValueObjectVariable.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
Modified: lldb/trunk/include/lldb/Core/Value.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Thu Aug 8 12:22:32 2019
@@ -210,7 +210,6 @@ public:
uint64_t GetValueByteSize(Status *error_ptr, ExecutionContext *exe_ctx);
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
- uint32_t data_offset,
Module *module); // Can be nullptr
static const char *GetValueTypeAsCString(ValueType context_type);
Modified: lldb/trunk/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Thu Aug 8 12:22:32 2019
@@ -314,7 +314,7 @@ bool Value::GetData(DataExtractor &data)
}
Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
- uint32_t data_offset, Module *module) {
+ Module *module) {
data.Clear();
Status error;
@@ -520,13 +520,12 @@ Status Value::GetValueAsData(ExecutionCo
// Make sure we have enough room within "data", and if we don't make
// something large enough that does
- if (!data.ValidOffsetForDataOfSize(data_offset, byte_size)) {
- auto data_sp =
- std::make_shared<DataBufferHeap>(data_offset + byte_size, '\0');
+ if (!data.ValidOffsetForDataOfSize(0, byte_size)) {
+ auto data_sp = std::make_shared<DataBufferHeap>(byte_size, '\0');
data.SetData(data_sp);
}
- uint8_t *dst = const_cast<uint8_t *>(data.PeekData(data_offset, byte_size));
+ uint8_t *dst = const_cast<uint8_t *>(data.PeekData(0, byte_size));
if (dst != nullptr) {
if (address_type == eAddressTypeHost) {
// The address is an address in this process, so just copy it.
@@ -597,7 +596,7 @@ Scalar &Value::ResolveValue(ExecutionCon
{
DataExtractor data;
lldb::addr_t addr = m_value.ULongLong(LLDB_INVALID_ADDRESS);
- Status error(GetValueAsData(exe_ctx, data, 0, nullptr));
+ Status error(GetValueAsData(exe_ctx, data, nullptr));
if (error.Success()) {
Scalar scalar;
if (compiler_type.GetValueAsScalar(data, 0, data.GetByteSize(),
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Aug 8 12:22:32 2019
@@ -811,7 +811,7 @@ size_t ValueObject::GetPointeeData(DataE
uint64_t ValueObject::GetData(DataExtractor &data, Status &error) {
UpdateValueIfNeeded(false);
ExecutionContext exe_ctx(GetExecutionContextRef());
- error = m_value.GetValueAsData(&exe_ctx, data, 0, GetModule().get());
+ error = m_value.GetValueAsData(&exe_ctx, data, GetModule().get());
if (error.Fail()) {
if (m_data.GetByteSize()) {
data = m_data;
@@ -2717,9 +2717,9 @@ ValueObjectSP ValueObject::CreateConstan
if (IsBitfield()) {
Value v(Scalar(GetValueAsUnsigned(UINT64_MAX)));
- m_error = v.GetValueAsData(&exe_ctx, data, 0, GetModule().get());
+ m_error = v.GetValueAsData(&exe_ctx, data, GetModule().get());
} else
- m_error = m_value.GetValueAsData(&exe_ctx, data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, data, GetModule().get());
valobj_sp = ValueObjectConstResult::Create(
exe_ctx.GetBestExecutionContextScope(), GetCompilerType(), name, data,
Modified: lldb/trunk/source/Core/ValueObjectCast.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectCast.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectCast.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectCast.cpp Thu Aug 8 12:22:32 2019
@@ -79,7 +79,7 @@ bool ValueObjectCast::UpdateValue() {
m_value.GetScalar() != old_value.GetScalar());
}
ExecutionContext exe_ctx(GetExecutionContextRef());
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
SetValueDidChange(m_parent->GetValueDidChange());
return true;
}
Modified: lldb/trunk/source/Core/ValueObjectChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectChild.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectChild.cpp Thu Aug 8 12:22:32 2019
@@ -227,7 +227,7 @@ bool ValueObjectChild::UpdateValue() {
if (GetCompilerType().GetTypeInfo() & lldb::eTypeHasValue) {
Value &value = is_instance_ptr_base ? m_parent->GetValue() : m_value;
m_error =
- value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
} else {
m_error.Clear(); // No value so nothing to read...
}
Modified: lldb/trunk/source/Core/ValueObjectConstResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResult.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectConstResult.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResult.cpp Thu Aug 8 12:22:32 2019
@@ -182,7 +182,7 @@ ValueObjectConstResult::ValueObjectConst
m_name = name;
ExecutionContext exe_ctx;
exe_scope->CalculateExecutionContext(exe_ctx);
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, module);
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, module);
}
ValueObjectConstResult::~ValueObjectConstResult() {}
Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Thu Aug 8 12:22:32 2019
@@ -199,7 +199,7 @@ bool ValueObjectDynamicValue::UpdateValu
ClearDynamicTypeInformation();
m_dynamic_type_info.Clear();
m_value = m_parent->GetValue();
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
return m_error.Success();
}
@@ -249,7 +249,7 @@ bool ValueObjectDynamicValue::UpdateValu
if (m_address.IsValid() && m_dynamic_type_info) {
// The variable value is in the Scalar value inside the m_value. We can
// point our m_data right to it.
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
if (m_error.Success()) {
if (!CanProvideValue()) {
// this value object represents an aggregate type whose children have
Modified: lldb/trunk/source/Core/ValueObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectMemory.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectMemory.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectMemory.cpp Thu Aug 8 12:22:32 2019
@@ -168,7 +168,7 @@ bool ValueObjectMemory::UpdateValue() {
case Value::eValueTypeScalar:
// The variable value is in the Scalar value inside the m_value. We can
// point our m_data right to it.
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
break;
case Value::eValueTypeFileAddress:
@@ -209,7 +209,7 @@ bool ValueObjectMemory::UpdateValue() {
value.SetCompilerType(m_compiler_type);
}
- m_error = value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
}
break;
}
Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Thu Aug 8 12:22:32 2019
@@ -320,7 +320,7 @@ lldb::ValueObjectSP ValueObjectSynthetic
void ValueObjectSynthetic::CopyValueData(ValueObject *source) {
m_value = (source->UpdateValueIfNeeded(), source->GetValue());
ExecutionContext exe_ctx(GetExecutionContextRef());
- m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_error = m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
}
bool ValueObjectSynthetic::CanProvideValue() {
Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Thu Aug 8 12:22:32 2019
@@ -221,7 +221,7 @@ bool ValueObjectVariable::UpdateValue()
// The variable value is in the Scalar value inside the m_value. We can
// point our m_data right to it.
m_error =
- m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
break;
case Value::eValueTypeFileAddress:
@@ -250,7 +250,7 @@ bool ValueObjectVariable::UpdateValue()
Value value(m_value);
value.SetContext(Value::eContextTypeVariable, variable);
m_error =
- value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
+ value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
SetValueDidChange(value_type != old_value.GetValueType() ||
m_value.GetScalar() != old_value.GetScalar());
Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=368330&r1=368329&r2=368330&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Thu Aug 8 12:22:32 2019
@@ -543,7 +543,7 @@ bool AppleObjCTrampolineHandler::AppleOb
Status error;
DataExtractor data;
error = argument_values.GetValueAtIndex(0)->GetValueAsData(&exe_ctx, data,
- 0, nullptr);
+ nullptr);
lldb::offset_t offset = 0;
lldb::addr_t region_addr = data.GetPointer(&offset);
More information about the lldb-commits
mailing list