[Lldb-commits] [lldb] [NFC][lldb] Document a few ivars on the value object system. (PR #124971)
Augusto Noronha via lldb-commits
lldb-commits at lists.llvm.org
Wed Jan 29 10:55:25 PST 2025
https://github.com/augusto2112 created https://github.com/llvm/llvm-project/pull/124971
None
>From cd28fcaf8739a32897a09bd661cb805b3960a7c7 Mon Sep 17 00:00:00 2001
From: Augusto Noronha <anoronha at apple.com>
Date: Wed, 29 Jan 2025 10:53:23 -0800
Subject: [PATCH] [NFC][lldb] Document a few ivars on the value object system.
---
lldb/include/lldb/Expression/ExpressionVariable.h | 7 +++++++
lldb/include/lldb/ValueObject/ValueObjectConstResultImpl.h | 4 ++++
lldb/source/Expression/Materializer.cpp | 1 +
3 files changed, 12 insertions(+)
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;
More information about the lldb-commits
mailing list