[Lldb-commits] [lldb] 705f24c - [lldb] Accept optional module in Value::ResolveValue (#66286)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 13 14:23:54 PDT 2023
Author: Augusto Noronha
Date: 2023-09-13T14:23:50-07:00
New Revision: 705f24cdabea6b7bf36ba068aa15adae566857f0
URL: https://github.com/llvm/llvm-project/commit/705f24cdabea6b7bf36ba068aa15adae566857f0
DIFF: https://github.com/llvm/llvm-project/commit/705f24cdabea6b7bf36ba068aa15adae566857f0.diff
LOG: [lldb] Accept optional module in Value::ResolveValue (#66286)
Value::ResolveValue calls Value::GetValueAsData as part of its
implementation. The latter can receive an optional Module pointer, which
is always null when called from the former. Allow threading in the
Module in Value::ResolveValue.
rdar://115021869
Added:
Modified:
lldb/include/lldb/Core/Value.h
lldb/source/Core/Value.cpp
lldb/source/Core/ValueObject.cpp
Removed:
################################################################################
diff --git a/lldb/include/lldb/Core/Value.h b/lldb/include/lldb/Core/Value.h
index ead23acc6f9b1a2..d0c338ffec0cd3d 100644
--- a/lldb/include/lldb/Core/Value.h
+++ b/lldb/include/lldb/Core/Value.h
@@ -107,7 +107,7 @@ class Value {
Type *GetType();
- Scalar &ResolveValue(ExecutionContext *exe_ctx);
+ Scalar &ResolveValue(ExecutionContext *exe_ctx, Module *module = nullptr);
const Scalar &GetScalar() const { return m_value; }
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 5a2631ca501f6c7..8efcfd3b4a1adac 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -572,7 +572,7 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
return error;
}
-Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
+Scalar &Value::ResolveValue(ExecutionContext *exe_ctx, Module *module) {
const CompilerType &compiler_type = GetCompilerType();
if (compiler_type.IsValid()) {
switch (m_value_type) {
@@ -587,7 +587,7 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
{
DataExtractor data;
lldb::addr_t addr = m_value.ULongLong(LLDB_INVALID_ADDRESS);
- Status error(GetValueAsData(exe_ctx, data, nullptr));
+ Status error(GetValueAsData(exe_ctx, data, module));
if (error.Success()) {
Scalar scalar;
if (compiler_type.GetValueAsScalar(
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 3e9116f2d922933..ebfc1cf4d6fe9e1 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -334,7 +334,7 @@ bool ValueObject::ResolveValue(Scalar &scalar) {
{
ExecutionContext exe_ctx(GetExecutionContextRef());
Value tmp_value(m_value);
- scalar = tmp_value.ResolveValue(&exe_ctx);
+ scalar = tmp_value.ResolveValue(&exe_ctx, GetModule().get());
if (scalar.IsValid()) {
const uint32_t bitfield_bit_size = GetBitfieldBitSize();
if (bitfield_bit_size)
More information about the lldb-commits
mailing list