aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
index a015bd1..31757a2 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
@@ -113,6 +113,11 @@ protected:
return {object};
}
+ python::PythonObject Transform(bool arg) {
+ // Boolean arguments need to be turned into python objects.
+ return python::PythonBoolean(arg);
+ }
+
python::PythonObject Transform(Status arg) {
return python::ToSWIGWrapper(arg);
}
@@ -141,6 +146,15 @@ protected:
original_arg = ExtractValueFromPythonObject<T>(transformed_arg, error);
}
+ template <>
+ void ReverseTransform(bool &original_arg,
+ python::PythonObject transformed_arg, Status &error) {
+ python::PythonBoolean boolean_arg = python::PythonBoolean(
+ python::PyRefType::Borrowed, transformed_arg.get());
+ if (boolean_arg.IsValid())
+ original_arg = boolean_arg.GetValue();
+ }
+
template <std::size_t... I, typename... Args>
auto TransformTuple(const std::tuple<Args...> &args,
std::index_sequence<I...>) {