summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBValue.cpp
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2011-08-04 17:07:02 +0000
committerEnrico Granata <granata.enrico@gmail.com>2011-08-04 17:07:02 +0000
commit61408e085617d176f7fc3b41b98ed116edc2f78e (patch)
treee321b7741f730aa9a9b7a9036e90bbf8f1f80535 /lldb/source/API/SBValue.cpp
parent0d4b431e2c1fc2d0a4c5ec4ba3b47405b00edbde (diff)
downloadbcm5719-llvm-61408e085617d176f7fc3b41b98ed116edc2f78e.tar.gz
bcm5719-llvm-61408e085617d176f7fc3b41b98ed116edc2f78e.zip
more logical behavior for SBValue::CreateValueFromAddress
llvm-svn: 136886
Diffstat (limited to 'lldb/source/API/SBValue.cpp')
-rw-r--r--lldb/source/API/SBValue.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index 820121132ee..073ea201304 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -448,16 +448,24 @@ SBValue::CreateValueFromAddress(const char* name, lldb::addr_t address, const SB
lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&address,sizeof(lldb::addr_t)));
- ValueObjectSP result_valobj_sp(ValueObjectConstResult::Create(m_opaque_sp->GetUpdatePoint().GetExecutionContextScope(),
- real_type.m_opaque_sp->GetASTContext(),
- real_type.m_opaque_sp->GetOpaqueQualType(),
- ConstString(name),
- buffer,
- lldb::endian::InlHostByteOrder(),
- GetTarget().GetProcess().GetAddressByteSize()));
+ ValueObjectSP ptr_result_valobj_sp(ValueObjectConstResult::Create(m_opaque_sp->GetUpdatePoint().GetExecutionContextScope(),
+ real_type.m_opaque_sp->GetASTContext(),
+ real_type.m_opaque_sp->GetOpaqueQualType(),
+ ConstString(name),
+ buffer,
+ lldb::endian::InlHostByteOrder(),
+ GetTarget().GetProcess().GetAddressByteSize()));
- result_valobj_sp->SetName(ConstString(name));
- result_valobj_sp->GetValue().SetValueType(Value::eValueTypeLoadAddress);
+ ValueObjectSP result_valobj_sp;
+
+ ptr_result_valobj_sp->GetValue().SetValueType(Value::eValueTypeLoadAddress);
+ if (ptr_result_valobj_sp)
+ {
+ Error err;
+ result_valobj_sp = ptr_result_valobj_sp->Dereference(err);
+ if (result_valobj_sp)
+ result_valobj_sp->SetName(ConstString(name));
+ }
result = SBValue(result_valobj_sp);
}
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
OpenPOWER on IntegriCloud