aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces
diff options
context:
space:
mode:
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, 18 insertions, 11 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
index 699412e..7d07221 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedPythonInterface.cpp
@@ -27,6 +27,15 @@ 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) {
@@ -65,8 +74,7 @@ Event *ScriptedPythonInterface::ExtractValueFromPythonObject<Event *>(
}
template <>
-lldb::StreamSP
-ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StreamSP>(
+Stream *ScriptedPythonInterface::ExtractValueFromPythonObject<Stream *>(
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 e1a3156..062bf1f 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(lldb::StreamSP arg) {
- return python::SWIGBridge::ToSWIGWrapper(arg.get());
+ python::PythonObject Transform(Stream *arg) {
+ return python::SWIGBridge::ToSWIGWrapper(arg);
}
python::PythonObject Transform(lldb::DataExtractorSP arg) {
@@ -447,8 +447,7 @@ Event *ScriptedPythonInterface::ExtractValueFromPythonObject<Event *>(
python::PythonObject &p, Status &error);
template <>
-lldb::StreamSP
-ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::StreamSP>(
+Stream *ScriptedPythonInterface::ExtractValueFromPythonObject<Stream *>(
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 f23858c..b7e4758 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::Error
-ScriptedThreadPlanPythonInterface::GetStopDescription(lldb::StreamSP &stream) {
+llvm::Expected<bool>
+ScriptedThreadPlanPythonInterface::GetStopDescription(lldb_private::Stream *s) {
Status error;
- Dispatch("stop_description", error, stream);
+ Dispatch("stop_description", error, s);
if (error.Fail())
return error.ToError();
- return llvm::Error::success();
+ return true;
}
#endif
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/ScriptedThreadPlanPythonInterface.h
index 6ec89b9..33f0867 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::Error GetStopDescription(lldb::StreamSP &stream) override;
+ llvm::Expected<bool> GetStopDescription(lldb_private::Stream *s) override;
};
} // namespace lldb_private