Skip to content

[lldb] Accept optional module in Value::ResolveValue (#66286) #7460

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

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/include/lldb/Core/Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
4 changes: 2 additions & 2 deletions lldb/source/Core/Value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Core/ValueObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,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)
Expand Down