[lldb/Interpreter] Discard ScriptedThreadPlan::GetStopDescription return value (#96985)

This patch changes `ScriptedThreadPlan::GetStopDescription` behavior by
discarding its return value since it is optional in the first place (the
user doesn't need to provide a return value in their implementation).

This patch also addresses the test failures in TestStepScripted
following 9a9ec22 and re-enables the tests that were XFAIL'd previously.

The issue here was that the `Stream*` that's passed to
`ThreadPlanPython::GetDescription` wasn't being passed by reference to
the python method so it was never updated to reflect how the python
method interacted with it.

This patch solves this issue by making a temporary `StreamSP` that will
be passed to the python method by reference, after what we will copy its
content to the caller `Stream` pointer argument.

---------

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
This commit is contained in:
Med Ismail Bennani authored and GitHub committed 2024-06-28 01:40:03 -07:00
1 parent bb83a3df25
commit 1130e923e2
9 files changed
+28 -32

No files matched your search

@@ -91,15 +91,15 @@ lldb::StateType ScriptedThreadPlanPythonInterface::GetRunState() {
static_cast<uint32_t>(lldb::eStateStepping)));
}
llvm::Expected<bool>
ScriptedThreadPlanPythonInterface::GetStopDescription(lldb_private::Stream *s) {
llvm::Error
ScriptedThreadPlanPythonInterface::GetStopDescription(lldb::StreamSP &stream) {
Status error;
Dispatch("stop_description", error, s);
Dispatch("stop_description", error, stream);
if (error.Fail())
return error.ToError();
return true;
return llvm::Error::success();
}
#endif