summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2015-07-16 01:47:12 +0000
committerSiva Chandra <sivachandra@google.com>2015-07-16 01:47:12 +0000
commitf8877efc8ba64360179b85af9fd019aae549d1a7 (patch)
tree162796467b673f6dd152707c7c66e46229144016 /lldb/source/Core
parent938bd6fc963af5028a31b315b982ac390786af1b (diff)
downloadbcm5719-llvm-f8877efc8ba64360179b85af9fd019aae549d1a7.tar.gz
bcm5719-llvm-f8877efc8ba64360179b85af9fd019aae549d1a7.zip
Add a class ValueObjectConstResultCast.
Summary: Other changes around the main change include: 1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl and ValueObjectConstResultChild. 2. Add an argument |live_address| of type lldb::addr_t to the constructor of ValueObjectConstResultChild. This is passed on to the backing ValueObjectConstResultImpl object constructor so that the address of the child value can be calculated properly. Reviewers: granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11203 llvm-svn: 242374
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/CMakeLists.txt1
-rw-r--r--lldb/source/Core/ValueObjectConstResult.cpp6
-rw-r--r--lldb/source/Core/ValueObjectConstResultCast.cpp75
-rw-r--r--lldb/source/Core/ValueObjectConstResultChild.cpp11
-rw-r--r--lldb/source/Core/ValueObjectConstResultImpl.cpp14
5 files changed, 104 insertions, 3 deletions
diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt
index d96de9d9492..ffff22a3305 100644
--- a/lldb/source/Core/CMakeLists.txt
+++ b/lldb/source/Core/CMakeLists.txt
@@ -65,6 +65,7 @@ add_lldb_library(lldbCore
ValueObjectCast.cpp
ValueObjectChild.cpp
ValueObjectConstResult.cpp
+ ValueObjectConstResultCast.cpp
ValueObjectConstResultChild.cpp
ValueObjectConstResultImpl.cpp
ValueObjectDynamicValue.cpp
diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp
index b4e63030646..7aec555617d 100644
--- a/lldb/source/Core/ValueObjectConstResult.cpp
+++ b/lldb/source/Core/ValueObjectConstResult.cpp
@@ -365,6 +365,12 @@ ValueObjectConstResult::GetDynamicValue (lldb::DynamicValueType use_dynamic)
return ValueObjectSP();
}
+lldb::ValueObjectSP
+ValueObjectConstResult::Cast (const ClangASTType &clang_ast_type)
+{
+ return m_impl.Cast(clang_ast_type);
+}
+
lldb::LanguageType
ValueObjectConstResult::GetPreferredDisplayLanguage ()
{
diff --git a/lldb/source/Core/ValueObjectConstResultCast.cpp b/lldb/source/Core/ValueObjectConstResultCast.cpp
new file mode 100644
index 00000000000..32123f94f36
--- /dev/null
+++ b/lldb/source/Core/ValueObjectConstResultCast.cpp
@@ -0,0 +1,75 @@
+//===-- ValueObjectConstResultCast.cpp --------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Core/ValueObjectConstResultCast.h"
+
+#include "lldb/Core/ValueObjectConstResult.h"
+#include "lldb/Core/ValueObjectList.h"
+
+#include "lldb/Symbol/ClangASTContext.h"
+
+using namespace lldb_private;
+
+ValueObjectConstResultCast::ValueObjectConstResultCast(
+ ValueObject &parent,
+ const ConstString &name,
+ const ClangASTType &cast_type,
+ lldb::addr_t live_address) :
+ ValueObjectCast (parent, name, cast_type),
+ m_impl(this, live_address)
+{
+ m_name = name;
+}
+
+ValueObjectConstResultCast::~ValueObjectConstResultCast()
+{
+}
+
+lldb::ValueObjectSP
+ValueObjectConstResultCast::Dereference (Error &error)
+{
+ return m_impl.Dereference(error);
+}
+
+lldb::ValueObjectSP
+ValueObjectConstResultCast::GetSyntheticChildAtOffset(uint32_t offset,
+ const ClangASTType& type,
+ bool can_create)
+{
+ return m_impl.GetSyntheticChildAtOffset(offset, type, can_create);
+}
+
+lldb::ValueObjectSP
+ValueObjectConstResultCast::AddressOf (Error &error)
+{
+ return m_impl.AddressOf(error);
+}
+
+ValueObject *
+ValueObjectConstResultCast::CreateChildAtIndex (size_t idx,
+ bool synthetic_array_member,
+ int32_t synthetic_index)
+{
+ return m_impl.CreateChildAtIndex(
+ idx, synthetic_array_member, synthetic_index);
+}
+
+size_t
+ValueObjectConstResultCast::GetPointeeData (DataExtractor& data,
+ uint32_t item_idx,
+ uint32_t item_count)
+{
+ return m_impl.GetPointeeData(data, item_idx, item_count);
+}
+
+lldb::ValueObjectSP
+ValueObjectConstResultCast::Cast (const ClangASTType &clang_ast_type)
+{
+ return m_impl.Cast(clang_ast_type);
+}
diff --git a/lldb/source/Core/ValueObjectConstResultChild.cpp b/lldb/source/Core/ValueObjectConstResultChild.cpp
index 64425ea5096..8bf49e8a5a6 100644
--- a/lldb/source/Core/ValueObjectConstResultChild.cpp
+++ b/lldb/source/Core/ValueObjectConstResultChild.cpp
@@ -26,7 +26,8 @@ ValueObjectConstResultChild::ValueObjectConstResultChild
uint32_t bitfield_bit_size,
uint32_t bitfield_bit_offset,
bool is_base_class,
- bool is_deref_of_parent
+ bool is_deref_of_parent,
+ lldb::addr_t live_address
) :
ValueObjectChild (parent,
clang_type,
@@ -38,7 +39,7 @@ ValueObjectConstResultChild::ValueObjectConstResultChild
is_base_class,
is_deref_of_parent,
eAddressTypeLoad),
- m_impl(this)
+ m_impl(this, live_address)
{
m_name = name;
}
@@ -78,3 +79,9 @@ ValueObjectConstResultChild::GetPointeeData (DataExtractor& data,
{
return m_impl.GetPointeeData(data, item_idx, item_count);
}
+
+lldb::ValueObjectSP
+ValueObjectConstResultChild::Cast (const ClangASTType &clang_ast_type)
+{
+ return m_impl.Cast(clang_ast_type);
+}
diff --git a/lldb/source/Core/ValueObjectConstResultImpl.cpp b/lldb/source/Core/ValueObjectConstResultImpl.cpp
index 733d767b7ee..fce844dc20f 100644
--- a/lldb/source/Core/ValueObjectConstResultImpl.cpp
+++ b/lldb/source/Core/ValueObjectConstResultImpl.cpp
@@ -11,6 +11,7 @@
#include "lldb/Core/ValueObjectChild.h"
#include "lldb/Core/ValueObjectConstResult.h"
+#include "lldb/Core/ValueObjectConstResultCast.h"
#include "lldb/Core/ValueObjectConstResultChild.h"
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/Core/DataExtractor.h"
@@ -96,7 +97,7 @@ ValueObjectConstResultImpl::CreateChildAtIndex (size_t idx, bool synthetic_array
ConstString child_name;
if (!child_name_str.empty())
child_name.SetCString (child_name_str.c_str());
-
+
valobj = new ValueObjectConstResultChild (*m_impl_backend,
child_clang_type,
child_name,
@@ -155,6 +156,17 @@ ValueObjectConstResultImpl::AddressOf (Error &error)
return m_impl_backend->ValueObject::AddressOf(error);
}
+lldb::ValueObjectSP
+ValueObjectConstResultImpl::Cast (const ClangASTType &clang_ast_type)
+{
+ if (m_impl_backend == NULL)
+ return lldb::ValueObjectSP();
+
+ ValueObjectConstResultCast *result_cast = new ValueObjectConstResultCast(
+ *m_impl_backend, m_impl_backend->GetName(), clang_ast_type, m_live_address);
+ return result_cast->GetSP();
+}
+
lldb::addr_t
ValueObjectConstResultImpl::GetAddressOf (bool scalar_is_load_address,
AddressType *address_type)
OpenPOWER on IntegriCloud