Skip to content

Commit 930f3c6

Browse files
committed
Revert "[lldb] Set result error state in 'frame variable'"
This reverts commit 2c7d10c.
1 parent 2c7d10c commit 930f3c6

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lldb/source/Commands/CommandObjectFrame.cpp

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -558,16 +558,18 @@ may even involve JITing and running code in the target program.)");
558558
}
559559
}
560560
} else if (num_matches == 0) {
561-
result.AppendErrorWithFormat(
562-
"no variables matched the regular expression '%s'.",
563-
entry.c_str());
561+
result.GetErrorStream().Printf("error: no variables matched "
562+
"the regular expression '%s'.\n",
563+
entry.c_str());
564564
}
565565
} else {
566566
if (llvm::Error err = regex.GetError())
567-
result.AppendError(llvm::toString(std::move(err)));
567+
result.GetErrorStream().Printf(
568+
"error: %s\n", llvm::toString(std::move(err)).c_str());
568569
else
569-
result.AppendErrorWithFormat(
570-
"unknown regex error when compiling '%s'", entry.c_str());
570+
result.GetErrorStream().Printf(
571+
"error: unknown regex error when compiling '%s'\n",
572+
entry.c_str());
571573
}
572574
} else // No regex, either exact variable names or variable
573575
// expressions.
@@ -603,13 +605,14 @@ may even involve JITing and running code in the target program.)");
603605
valobj_sp->GetParent() ? entry.c_str() : nullptr);
604606
valobj_sp->Dump(output_stream, options);
605607
} else {
606-
if (auto error_cstr = error.AsCString(nullptr))
607-
result.AppendError(error_cstr);
608+
const char *error_cstr = error.AsCString(nullptr);
609+
if (error_cstr)
610+
result.GetErrorStream().Printf("error: %s\n", error_cstr);
608611
else
609-
result.AppendErrorWithFormat(
610-
"unable to find any variable expression path that matches "
611-
"'%s'.",
612-
entry.c_str());
612+
result.GetErrorStream().Printf("error: unable to find any "
613+
"variable expression path that "
614+
"matches '%s'.\n",
615+
entry.c_str());
613616
}
614617
}
615618
}
@@ -677,8 +680,7 @@ may even involve JITing and running code in the target program.)");
677680
}
678681
}
679682
}
680-
if (result.GetStatus() != eReturnStatusFailed)
681-
result.SetStatus(eReturnStatusSuccessFinishResult);
683+
result.SetStatus(eReturnStatusSuccessFinishResult);
682684
}
683685

684686
if (m_option_variable.show_recognized_args) {

0 commit comments

Comments
 (0)