[Lldb-commits] [lldb] Make result variables obey their dynamic values in subsequent expressions (PR #168611)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 9 18:05:59 PST 2025
================
@@ -52,31 +60,39 @@ class ExpressionVariable
Value::ContextType::RegisterInfo, const_cast<RegisterInfo *>(reg_info));
}
- CompilerType GetCompilerType() { return m_frozen_sp->GetCompilerType(); }
+ CompilerType GetCompilerType() { return GetValueObject()->GetCompilerType(); }
void SetCompilerType(const CompilerType &compiler_type) {
m_frozen_sp->GetValue().SetCompilerType(compiler_type);
}
void SetName(ConstString name) { m_frozen_sp->SetName(name); }
- // this function is used to copy the address-of m_live_sp into m_frozen_sp
- // this is necessary because the results of certain cast and pointer-
+ // 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
- void TransferAddress(bool force = false) {
- if (m_live_sp.get() == nullptr)
- return;
-
- if (m_frozen_sp.get() == nullptr)
- return;
-
- if (force || (m_frozen_sp->GetLiveAddress() == LLDB_INVALID_ADDRESS))
- m_frozen_sp->SetLiveAddress(m_live_sp->GetLiveAddress());
+ // 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.
----------------
adrian-prantl wrote:
These should be `///` comments.
https://github.com/llvm/llvm-project/pull/168611
More information about the lldb-commits
mailing list