-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[lldb] Accept optional module in Value::ResolveValue #66286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb] Accept optional module in Value::ResolveValue #66286
Conversation
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
@llvm/pr-subscribers-lldb ChangesValue::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://115021869Full diff: https://github.com/llvm/llvm-project/pull/66286.diff 3 Files Affected:
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) |
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 (cherry picked from commit 705f24c)
[lldb] Accept optional module in Value::ResolveValue (llvm#66286)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change testable in a test case? I assume it must be somehow as it is fixing a bug?
IIUC, this is an infrastructure change that fixes a test failure in swift branch. Augusto can speak to whether it's testable on |
@clayborg as Adrian said, this fixes a test failure downstream. I don't there's any visible change in behavior to test in main, unfortunately. |
Gotcha. Let me guess: Swift? :-) |
Exactly :) |
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
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