aboutsummaryrefslogtreecommitdiff
path: root/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-01-17 11:29:35 +0100
committerPavel Labath <pavel@labath.sk>2022-01-18 10:28:58 +0100
commitc154f397eeb86ea1a5b8fa46405104ace962cec3 (patch)
treedf2a6b975c72e1933494dab0a909e1253035e6e8 /lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
parentcc0d208805c3d1dac3ec5a44f971b1b5c8ab3a2a (diff)
downloadllvm-c154f397eeb86ea1a5b8fa46405104ace962cec3.zip
llvm-c154f397eeb86ea1a5b8fa46405104ace962cec3.tar.gz
llvm-c154f397eeb86ea1a5b8fa46405104ace962cec3.tar.bz2
[lldb/python] Use PythonObject in LLDBSwigPython functions
Return our PythonObject wrappers instead of raw PyObjects (obfuscated as void *). This ensures that ownership (reference counts) of python objects is automatically tracked. Differential Revision: https://reviews.llvm.org/D117462
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp')
-rw-r--r--lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
index 837f6cb..ba96cc6 100644
--- a/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
+++ b/lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
@@ -80,23 +80,23 @@ bool lldb_private::LLDBSwigPythonCallTypeScript(
return false;
}
-void *lldb_private::LLDBSwigPythonCreateSyntheticProvider(
+python::PythonObject lldb_private::LLDBSwigPythonCreateSyntheticProvider(
const char *python_class_name, const char *session_dictionary_name,
const lldb::ValueObjectSP &valobj_sp) {
- return nullptr;
+ return python::PythonObject();
}
-void *lldb_private::LLDBSwigPythonCreateCommandObject(
+python::PythonObject lldb_private::LLDBSwigPythonCreateCommandObject(
const char *python_class_name, const char *session_dictionary_name,
lldb::DebuggerSP debugger_sp) {
- return nullptr;
+ return python::PythonObject();
}
-void *lldb_private::LLDBSwigPythonCreateScriptedThreadPlan(
+python::PythonObject lldb_private::LLDBSwigPythonCreateScriptedThreadPlan(
const char *python_class_name, const char *session_dictionary_name,
const StructuredDataImpl &args_data, std::string &error_string,
const lldb::ThreadPlanSP &thread_plan_sp) {
- return nullptr;
+ return python::PythonObject();
}
bool lldb_private::LLDBSWIGPythonCallThreadPlan(void *implementor,
@@ -106,10 +106,11 @@ bool lldb_private::LLDBSWIGPythonCallThreadPlan(void *implementor,
return false;
}
-void *lldb_private::LLDBSwigPythonCreateScriptedBreakpointResolver(
+python::PythonObject
+lldb_private::LLDBSwigPythonCreateScriptedBreakpointResolver(
const char *python_class_name, const char *session_dictionary_name,
const StructuredDataImpl &args, const lldb::BreakpointSP &bkpt_sp) {
- return nullptr;
+ return python::PythonObject();
}
unsigned int lldb_private::LLDBSwigPythonCallBreakpointResolver(
@@ -191,30 +192,30 @@ bool lldb_private::LLDBSwigPythonCallModuleInit(
return false;
}
-void *
+python::PythonObject
lldb_private::LLDBSWIGPythonCreateOSPlugin(const char *python_class_name,
const char *session_dictionary_name,
const lldb::ProcessSP &process_sp) {
- return nullptr;
+ return python::PythonObject();
}
-void *lldb_private::LLDBSwigPythonCreateScriptedProcess(
+python::PythonObject lldb_private::LLDBSwigPythonCreateScriptedProcess(
const char *python_class_name, const char *session_dictionary_name,
const lldb::TargetSP &target_sp, const StructuredDataImpl &args_impl,
std::string &error_string) {
- return nullptr;
+ return python::PythonObject();
}
-void *lldb_private::LLDBSwigPythonCreateScriptedThread(
+python::PythonObject lldb_private::LLDBSwigPythonCreateScriptedThread(
const char *python_class_name, const char *session_dictionary_name,
const lldb::ProcessSP &process_sp, const StructuredDataImpl &args_impl,
std::string &error_string) {
- return nullptr;
+ return python::PythonObject();
}
-void *lldb_private::LLDBSWIGPython_CreateFrameRecognizer(
+python::PythonObject lldb_private::LLDBSWIGPython_CreateFrameRecognizer(
const char *python_class_name, const char *session_dictionary_name) {
- return nullptr;
+ return python::PythonObject();
}
PyObject *lldb_private::LLDBSwigPython_GetRecognizedArguments(
@@ -257,11 +258,11 @@ void *lldb_private::LLDBSWIGPython_GetDynamicSetting(
return nullptr;
}
-void *lldb_private::LLDBSwigPythonCreateScriptedStopHook(
+python::PythonObject lldb_private::LLDBSwigPythonCreateScriptedStopHook(
lldb::TargetSP target_sp, const char *python_class_name,
const char *session_dictionary_name, const StructuredDataImpl &args_impl,
Status &error) {
- return nullptr;
+ return python::PythonObject();
}
bool lldb_private::LLDBSwigPythonStopHookCallHandleStop(