summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-11-13 21:28:45 +0000
committerZachary Turner <zturner@google.com>2015-11-13 21:28:45 +0000
commit2419f1d57cd20c3d8a0161f24700a47172a46b2f (patch)
treea316d8d2f1a3d9b003c256f480a24f6d89046612 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
parent75b4be9a1198c53384980eadca2708628b97622c (diff)
downloadbcm5719-llvm-2419f1d57cd20c3d8a0161f24700a47172a46b2f.tar.gz
bcm5719-llvm-2419f1d57cd20c3d8a0161f24700a47172a46b2f.zip
Modernize FormatBacktrace() and make portable for Python 3.
llvm-svn: 253085
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 73f9b8cae88..e3f84f53df0 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -825,6 +825,14 @@ PythonModule::AddModule(llvm::StringRef module)
return PythonModule(PyRefType::Borrowed, PyImport_AddModule(str.c_str()));
}
+
+PythonModule
+PythonModule::ImportModule(llvm::StringRef module)
+{
+ std::string str = module.str();
+ return PythonModule(PyRefType::Owned, PyImport_ImportModule(str.c_str()));
+}
+
bool
PythonModule::Check(PyObject *py_obj)
{
OpenPOWER on IntegriCloud