aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces
diff options
context:
space:
mode:
authorMed Ismail Bennani <ismail@bennani.ma>2024-06-28 11:53:19 -0700
committerGitHub <noreply@github.com>2024-06-28 11:53:19 -0700
commit6cb45aea92dc87974a0064c182600228c6e94329 (patch)
tree2629f7f0db47e37b88e3c3abe970d2999f7a1afb /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces
parent72c801f843d95546d92e2b15fe832503ba3bfab6 (diff)
downloadllvm-6cb45aea92dc87974a0064c182600228c6e94329.zip
llvm-6cb45aea92dc87974a0064c182600228c6e94329.tar.gz
llvm-6cb45aea92dc87974a0064c182600228c6e94329.tar.bz2
Reland "[lldb/Interpreter] Discard ScriptedThreadPlan::GetStopDescription return value (#96985)" (#97092)
This reverts commit a2e3af5d581547d3ea53e5383d6f7f1cab45120a and solves the build error in https://lab.llvm.org/buildbot/#/builders/141/builds/369. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp12
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h7
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp8
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h2
4 files changed, 11 insertions, 18 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
index 7d07221..699412e 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
@@ -27,15 +27,6 @@ ScriptedPythonInterface::ScriptedPythonInterface(
: ScriptedInterface(), m_interpreter(interpreter) {}
template <>
-void ScriptedPythonInterface::ReverseTransform(
- lldb_private::Stream *&original_arg, python::PythonObject transformed_arg,
- Status &error) {
- Stream *s = ExtractValueFromPythonObject<Stream *>(transformed_arg, error);
- *original_arg = *s;
- original_arg->PutCString(static_cast<StreamString *>(s)->GetData());
-}
-
-template <>
StructuredData::ArraySP
ScriptedPythonInterface::ExtractValueFromPythonObject<StructuredData::ArraySP>(
python::PythonObject &p, Status &error) {
@@ -74,7 +65,8 @@ Event *ScriptedPythonInterface::ExtractValueFromPythonObject<Event *>(
}
template <>
-Stream *ScriptedPythonInterface::ExtractValueFromPythonObject<Stream *>(
+lldb::StreamSP
+ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StreamSP>(
python::PythonObject &p, Status &error) {
if (lldb::SBStream *sb_stream = reinterpret_cast<lldb::SBStream *>(
python::LLDBSWIGPython_CastPyObjectToSBStream(p.get())))
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
index 062bf1f..e1a3156 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.h
@@ -341,8 +341,8 @@ protected:
return python::SWIGBridge::ToSWIGWrapper(arg);
}
- python::PythonObject Transform(Stream *arg) {
- return python::SWIGBridge::ToSWIGWrapper(arg);
+ python::PythonObject Transform(lldb::StreamSP arg) {
+ return python::SWIGBridge::ToSWIGWrapper(arg.get());
}
python::PythonObject Transform(lldb::DataExtractorSP arg) {
@@ -447,7 +447,8 @@ Event *ScriptedPythonInterface::ExtractValueFromPythonObject<Event *>(
python::PythonObject &p, Status &error);
template <>
-Stream *ScriptedPythonInterface::ExtractValueFromPythonObject<Stream *>(
+lldb::StreamSP
+ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StreamSP>(
python::PythonObject &p, Status &error);
template <>
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp
index b7e4758..f23858c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.cpp
@@ -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
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h
index 33f0867..6ec89b9 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h
@@ -40,7 +40,7 @@ public:
lldb::StateType GetRunState() override;
- llvm::Expected<bool> GetStopDescription(lldb_private::Stream *s) override;
+ llvm::Error GetStopDescription(lldb::StreamSP &stream) override;
};
} // namespace lldb_private