Skip to content

Commit 705f24c

Browse files
authored
[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
1 parent a866ce7 commit 705f24c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lldb/include/lldb/Core/Value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Value {
107107

108108
Type *GetType();
109109

110-
Scalar &ResolveValue(ExecutionContext *exe_ctx);
110+
Scalar &ResolveValue(ExecutionContext *exe_ctx, Module *module = nullptr);
111111

112112
const Scalar &GetScalar() const { return m_value; }
113113

lldb/source/Core/Value.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
572572
return error;
573573
}
574574

575-
Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
575+
Scalar &Value::ResolveValue(ExecutionContext *exe_ctx, Module *module) {
576576
const CompilerType &compiler_type = GetCompilerType();
577577
if (compiler_type.IsValid()) {
578578
switch (m_value_type) {
@@ -587,7 +587,7 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
587587
{
588588
DataExtractor data;
589589
lldb::addr_t addr = m_value.ULongLong(LLDB_INVALID_ADDRESS);
590-
Status error(GetValueAsData(exe_ctx, data, nullptr));
590+
Status error(GetValueAsData(exe_ctx, data, module));
591591
if (error.Success()) {
592592
Scalar scalar;
593593
if (compiler_type.GetValueAsScalar(

lldb/source/Core/ValueObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ bool ValueObject::ResolveValue(Scalar &scalar) {
334334
{
335335
ExecutionContext exe_ctx(GetExecutionContextRef());
336336
Value tmp_value(m_value);
337-
scalar = tmp_value.ResolveValue(&exe_ctx);
337+
scalar = tmp_value.ResolveValue(&exe_ctx, GetModule().get());
338338
if (scalar.IsValid()) {
339339
const uint32_t bitfield_bit_size = GetBitfieldBitSize();
340340
if (bitfield_bit_size)

0 commit comments

Comments
 (0)