aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2024-06-17 14:29:01 -0700
committerAdrian Prantl <aprantl@apple.com>2024-06-20 10:32:06 -0700
commitd1bc75c0bce141b94f9afadfde4e784760735ec0 (patch)
tree03017088ee5f5862a92de9630b95182e8f26bb70 /lldb/source/Commands/CommandObjectFrame.cpp
parent6bc71cdd32de0add80d620b1342b5549efff363a (diff)
downloadllvm-d1bc75c0bce141b94f9afadfde4e784760735ec0.zip
llvm-d1bc75c0bce141b94f9afadfde4e784760735ec0.tar.gz
llvm-d1bc75c0bce141b94f9afadfde4e784760735ec0.tar.bz2
Convert ValueObject::Dump() to return llvm::Error() (NFCish)
This change by itself has no measurable effect on the LLDB testsuite. I'm making it in preparation for threading through more errors in the Swift language plugin.
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index b1d060b..3f4178c 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -170,7 +170,8 @@ protected:
assert(valobj_sp.get() && "Must have a valid ValueObject to print");
ValueObjectPrinter printer(*valobj_sp, &result.GetOutputStream(),
options);
- printer.PrintValueObject();
+ if (llvm::Error error = printer.PrintValueObject())
+ result.AppendError(toString(std::move(error)));
}
CommandOptions m_options;
@@ -555,7 +556,9 @@ protected:
show_module))
s.PutCString(": ");
}
- valobj_sp->Dump(result.GetOutputStream(), options);
+ auto &strm = result.GetOutputStream();
+ if (llvm::Error error = valobj_sp->Dump(strm, options))
+ result.AppendError(toString(std::move(error)));
}
}
} else {
@@ -597,7 +600,8 @@ protected:
Stream &output_stream = result.GetOutputStream();
options.SetRootValueObjectName(
valobj_sp->GetParent() ? entry.c_str() : nullptr);
- valobj_sp->Dump(output_stream, options);
+ if (llvm::Error error = valobj_sp->Dump(output_stream, options))
+ result.AppendError(toString(std::move(error)));
} else {
if (auto error_cstr = error.AsCString(nullptr))
result.AppendError(error_cstr);
@@ -648,7 +652,9 @@ protected:
valobj_sp->GetPreferredDisplayLanguage());
options.SetRootValueObjectName(
var_sp ? var_sp->GetName().AsCString() : nullptr);
- valobj_sp->Dump(result.GetOutputStream(), options);
+ if (llvm::Error error =
+ valobj_sp->Dump(result.GetOutputStream(), options))
+ result.AppendError(toString(std::move(error)));
}
}
}
@@ -669,7 +675,9 @@ protected:
options.SetVariableFormatDisplayLanguage(
rec_value_sp->GetPreferredDisplayLanguage());
options.SetRootValueObjectName(rec_value_sp->GetName().AsCString());
- rec_value_sp->Dump(result.GetOutputStream(), options);
+ if (llvm::Error error =
+ rec_value_sp->Dump(result.GetOutputStream(), options))
+ result.AppendError(toString(std::move(error)));
}
}
}