Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Siva Chandra
committed
Jul 16, 2015
1 parent
938bd6f
commit f8877ef
Showing
12 changed files
with
209 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
//===-- ValueObjectConstResultCast.h ----------------------------*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef liblldb_ValueObjectConstResultCast_h_ | ||
#define liblldb_ValueObjectConstResultCast_h_ | ||
|
||
// C Includes | ||
// C++ Includes | ||
// Other libraries and framework includes | ||
// Project includes | ||
#include "lldb/Core/ValueObjectCast.h" | ||
#include "lldb/Core/ValueObjectConstResultImpl.h" | ||
|
||
namespace lldb_private { | ||
|
||
class ValueObjectConstResultCast : public ValueObjectCast | ||
{ | ||
public: | ||
ValueObjectConstResultCast ( | ||
ValueObject &parent, | ||
const ConstString &name, | ||
const ClangASTType &cast_type, | ||
lldb::addr_t live_address = LLDB_INVALID_ADDRESS); | ||
|
||
virtual | ||
~ValueObjectConstResultCast (); | ||
|
||
virtual lldb::ValueObjectSP | ||
Dereference (Error &error); | ||
|
||
virtual ValueObject * | ||
CreateChildAtIndex (size_t idx, | ||
bool synthetic_array_member, | ||
int32_t synthetic_index); | ||
|
||
virtual ClangASTType | ||
GetClangType () | ||
{ | ||
return ValueObjectCast::GetClangType(); | ||
} | ||
|
||
virtual lldb::ValueObjectSP | ||
GetSyntheticChildAtOffset(uint32_t offset, | ||
const ClangASTType& type, | ||
bool can_create); | ||
|
||
virtual lldb::ValueObjectSP | ||
AddressOf (Error &error); | ||
|
||
virtual size_t | ||
GetPointeeData (DataExtractor& data, | ||
uint32_t item_idx = 0, | ||
uint32_t item_count = 1); | ||
|
||
virtual lldb::ValueObjectSP | ||
Cast (const ClangASTType &clang_ast_type); | ||
|
||
protected: | ||
ValueObjectConstResultImpl m_impl; | ||
|
||
private: | ||
friend class ValueObject; | ||
friend class ValueObjectConstResult; | ||
friend class ValueObjectConstResultImpl; | ||
|
||
DISALLOW_COPY_AND_ASSIGN (ValueObjectConstResultCast); | ||
}; | ||
|
||
} // namespace lldb_private | ||
|
||
#endif // liblldb_ValueObjectConstResultCast_h_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters