|
LLDB mainline
|
#include <ExpressionVariable.h>
Public Types | |
| enum | Flags { EVNone = 0 , EVIsLLDBAllocated = 1 << 0 , EVIsProgramReference = 1 << 1 , EVNeedsAllocation = 1 << 2 , EVIsFreezeDried = 1 << 3 , EVNeedsFreezeDry , EVKeepInTarget = 1 << 5 , EVTypeIsReference = 1 << 6 , EVBareRegister = 1 << 7 } |
| typedef uint16_t | FlagType |
Public Member Functions | |
| ExpressionVariable () | |
| virtual | ~ExpressionVariable ()=default |
| llvm::Expected< uint64_t > | GetByteSize () |
| ConstString | GetName () |
| lldb::ValueObjectSP | GetValueObject () |
| uint8_t * | GetValueBytes () |
| void | ValueUpdated () |
| RegisterInfo * | GetRegisterInfo () |
| void | SetRegisterInfo (const RegisterInfo *reg_info) |
| CompilerType | GetCompilerType () |
| void | SetCompilerType (const CompilerType &compiler_type) |
| void | SetName (ConstString name) |
| void | TransferAddress (bool force=false) |
| This function is used to copy the address-of m_live_sp into m_frozen_sp. | |
| void | PreserveDynamicOption (lldb::DynamicValueType dyn_type) |
| When we build an expression variable we know whether we're going to use the static or dynamic result. | |
| lldb::ValueObjectSP | GetLiveObject () |
| We don't try to get the dynamic value of the live object when we fetch it here. | |
Public Attributes | |
| FlagType | m_flags |
| lldb::DynamicValueType | m_dyn_option = lldb::eNoDynamicValues |
| lldb::ValueObjectSP | m_frozen_sp |
| These members should be private. | |
| lldb::ValueObjectSP | m_live_sp |
| The ValueObject counterpart to m_frozen_sp that tracks the value in inferior memory. | |
Static Public Attributes | |
| static char | ID |
| LLVM RTTI support. | |
Definition at line 25 of file ExpressionVariable.h.
| typedef uint16_t lldb_private::ExpressionVariable::FlagType |
Definition at line 122 of file ExpressionVariable.h.
Definition at line 97 of file ExpressionVariable.h.
| ExpressionVariable::ExpressionVariable | ( | ) |
Definition at line 20 of file ExpressionVariable.cpp.
References m_flags.
|
virtualdefault |
|
inline |
Definition at line 36 of file ExpressionVariable.h.
References GetValueObject().
|
inline |
Definition at line 63 of file ExpressionVariable.h.
References GetValueObject().
|
inline |
We don't try to get the dynamic value of the live object when we fetch it here.
The live object describes the container of the value in the target, but it's type is of the object for convenience. So it can't produce the dynamic value. Instead, we use TransferAddress to adjust the value held by the LiveObject.
Definition at line 95 of file ExpressionVariable.h.
References m_live_sp.
|
inline |
Definition at line 40 of file ExpressionVariable.h.
References m_frozen_sp.
Referenced by lldb_private::ClangREPL::PrintOneVariable().
|
inline |
Definition at line 54 of file ExpressionVariable.h.
References m_frozen_sp.
| uint8_t * ExpressionVariable::GetValueBytes | ( | ) |
Definition at line 22 of file ExpressionVariable.cpp.
References GetValueObject().
|
inline |
Definition at line 42 of file ExpressionVariable.h.
References lldb::eDynamicDontRunTarget, and m_frozen_sp.
Referenced by GetByteSize(), GetCompilerType(), and GetValueBytes().
|
inline |
When we build an expression variable we know whether we're going to use the static or dynamic result.
If we present the dynamic value once, we should use the dynamic value in future references to the variable, so we record that fact here.
Definition at line 87 of file ExpressionVariable.h.
References m_dyn_option.
|
inline |
Definition at line 65 of file ExpressionVariable.h.
References m_frozen_sp.
|
inline |
Definition at line 69 of file ExpressionVariable.h.
References m_frozen_sp.
|
inline |
Definition at line 58 of file ExpressionVariable.h.
References m_frozen_sp, and lldb_private::Value::RegisterInfo.
| void ExpressionVariable::TransferAddress | ( | bool | force = false | ) |
This function is used to copy the address-of m_live_sp into m_frozen_sp.
It is necessary because the results of certain cast and pointer- arithmetic operations (such as those described in bugzilla issues 11588 and 11618) generate frozen objects that do not have a valid address-of, which can be troublesome when using synthetic children providers. Transferring the address-of the live object solves these issues and provides the expected user-level behavior. The other job we do in TransferAddress is adjust the value in the live address slot in the target for the "offset to top" in multiply inherited class hierarchies.
Definition at line 40 of file ExpressionVariable.cpp.
References lldb_private::ValueObject::AddrAndType::address, lldb_private::eAddressTypeLoad, error(), lldb_private::Expressions, lldb_private::GetLog(), LLDB_INVALID_ADDRESS, LLDB_LOG, m_dyn_option, m_frozen_sp, m_live_sp, and lldb_private::ValueObject::AddrAndType::type.
|
inline |
Definition at line 52 of file ExpressionVariable.h.
References m_frozen_sp.
|
static |
LLVM RTTI support.
Definition at line 30 of file ExpressionVariable.h.
| lldb::DynamicValueType lldb_private::ExpressionVariable::m_dyn_option = lldb::eNoDynamicValues |
Definition at line 147 of file ExpressionVariable.h.
Referenced by PreserveDynamicOption(), and TransferAddress().
| FlagType lldb_private::ExpressionVariable::m_flags |
Definition at line 124 of file ExpressionVariable.h.
Referenced by ExpressionVariable().
| lldb::ValueObjectSP lldb_private::ExpressionVariable::m_frozen_sp |
These members should be private.
A value object whose value's data lives in host (lldb's) memory. The m_frozen_sp holds the data & type of the expression variable or result in the host. The m_frozen_sp also can present a dynamic value if one is available. The m_frozen_sp manages the copy of this value in m_frozen_sp that we insert in the target so that it can be referred to in future expressions. We don't actually use the contents of the live_sp to create the value in the target, that comes from the frozen sp. The live_sp is mostly to track the target-side of the value.
Definition at line 137 of file ExpressionVariable.h.
Referenced by GetName(), GetRegisterInfo(), GetValueObject(), SetCompilerType(), SetName(), SetRegisterInfo(), TransferAddress(), and ValueUpdated().
| lldb::ValueObjectSP lldb_private::ExpressionVariable::m_live_sp |
The ValueObject counterpart to m_frozen_sp that tracks the value in inferior memory.
This object may not always exist; its presence depends on whether it is logical for the value to exist in the inferior memory. For example, when evaluating a C++ expression that generates an r-value, such as a single function call, there is no memory address in the inferior to track.
Definition at line 144 of file ExpressionVariable.h.
Referenced by GetLiveObject(), and TransferAddress().