diff options
author | Med Ismail Bennani <ismail@bennani.ma> | 2024-06-28 01:40:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-28 01:40:03 -0700 |
commit | 1130e923e2d7fe046101bf639bc5ebcde194c005 (patch) | |
tree | fe4e98c482ff4a2fe82be33d551180e846a0b059 /lldb/source/Interpreter/ScriptInterpreter.cpp | |
parent | bb83a3df25a8c46dd586caf26635f5658e7b3316 (diff) | |
download | llvm-1130e923e2d7fe046101bf639bc5ebcde194c005.zip llvm-1130e923e2d7fe046101bf639bc5ebcde194c005.tar.gz llvm-1130e923e2d7fe046101bf639bc5ebcde194c005.tar.bz2 |
[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>
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp index 75b2a39..65e4cbd 100644 --- a/lldb/source/Interpreter/ScriptInterpreter.cpp +++ b/lldb/source/Interpreter/ScriptInterpreter.cpp @@ -106,10 +106,13 @@ ScriptInterpreter::GetOpaqueTypeFromSBEvent(const lldb::SBEvent &event) const { return event.m_opaque_ptr; } -Stream *ScriptInterpreter::GetOpaqueTypeFromSBStream( +lldb::StreamSP ScriptInterpreter::GetOpaqueTypeFromSBStream( const lldb::SBStream &stream) const { - if (stream.m_opaque_up) - return const_cast<lldb::SBStream &>(stream).m_opaque_up.get(); + if (stream.m_opaque_up) { + lldb::StreamSP s = std::make_shared<lldb_private::StreamString>(); + *s << const_cast<lldb::SBStream &>(stream).GetData(); + return s; + } return nullptr; } |