[Lldb-commits] [lldb] [NFC][lldb] Document a few ivars on the value object system. (PR #124971)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 29 10:56:00 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Augusto Noronha (augusto2112)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/124971.diff
3 Files Affected:
- (modified) lldb/include/lldb/Expression/ExpressionVariable.h (+7)
- (modified) lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h (+4)
- (modified) lldb/source/Expression/Materializer.cpp (+1)
``````````diff
diff --git a/lldb/include/lldb/Expression/ExpressionVariable.h b/lldb/include/lldb/Expression/ExpressionVariable.h
index fc36793b3a475c..a2175dee7dca9e 100644
--- a/lldb/include/lldb/Expression/ExpressionVariable.h
+++ b/lldb/include/lldb/Expression/ExpressionVariable.h
@@ -108,7 +108,14 @@ class ExpressionVariable
FlagType m_flags; // takes elements of Flags
// these should be private
+ /// A value object whose value's data lives in host (lldb's) memory.
lldb::ValueObjectSP m_frozen_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.
lldb::ValueObjectSP m_live_sp;
};
diff --git a/lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h b/lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h
index dbd68160acb4dc..5509886a8965da 100644
--- a/lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h
+++ b/lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h
@@ -66,6 +66,10 @@ class ValueObjectConstResultImpl {
private:
ValueObject *m_impl_backend;
+ /// The memory address in the inferior process that this ValueObject tracks.
+ /// This address is used to request additional memory when the actual data
+ /// size exceeds the initial local buffer size, such as when a dynamic type
+ /// resolution results in a type larger than its statically determined type.
lldb::addr_t m_live_address;
AddressType m_live_address_type;
lldb::ValueObjectSP m_address_of_backend;
diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp
index 8cd050f9fdb7ef..500b8c098f7ca8 100644
--- a/lldb/source/Expression/Materializer.cpp
+++ b/lldb/source/Expression/Materializer.cpp
@@ -1187,6 +1187,7 @@ class EntityResultVariable : public Materializer::Entity {
private:
CompilerType m_type;
+ /// If this result entity can (and should) track the value on inferior memory.
bool m_is_program_reference;
bool m_keep_in_memory;
``````````
</details>
https://github.com/llvm/llvm-project/pull/124971
More information about the lldb-commits
mailing list