mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 21:55:39 +08:00
An SBValue whose underlying ValueObject has no valid value, but does
hold an error should:
(a) return false for IsValid, since that's the current behavior and is
a convenient way to check "should I get the value for this".
(b) preserve the error when an SBValue is made from it, and print the
error in the ValueObjectPrinter.
Make that happen.
Differential Revision: https://reviews.llvm.org/D144664
This commit is contained in:
@@ -71,6 +71,18 @@ void ValueObjectPrinter::Init(
|
||||
}
|
||||
|
||||
bool ValueObjectPrinter::PrintValueObject() {
|
||||
if (!m_orig_valobj)
|
||||
return false;
|
||||
|
||||
// If the incoming ValueObject is in an error state, the best we're going to
|
||||
// get out of it is its type. But if we don't even have that, just print
|
||||
// the error and exit early.
|
||||
if (m_orig_valobj->GetError().Fail()
|
||||
&& !m_orig_valobj->GetCompilerType().IsValid()) {
|
||||
m_stream->Printf("Error: '%s'", m_orig_valobj->GetError().AsCString());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!GetMostSpecializedValue() || m_valobj == nullptr)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user