diff options
author | Enrico Granata <egranata@apple.com> | 2012-08-24 00:51:29 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-08-24 00:51:29 +0000 |
commit | 6167ab281965d4ebbcff77c1f392050bcd1c5e79 (patch) | |
tree | ff835b7dc2c33abb2c6cea083efb943020c7384d /lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | |
parent | 4bcd58b87db2ce661759fb9efdb055d964628d23 (diff) | |
download | bcm5719-llvm-6167ab281965d4ebbcff77c1f392050bcd1c5e79.tar.gz bcm5719-llvm-6167ab281965d4ebbcff77c1f392050bcd1c5e79.zip |
Hooking up two more calls for the PythonOSPlugin stuff. The part of code to fetch the data and convert it to C++ objects is still missing, but will come
llvm-svn: 162522
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp')
-rw-r--r-- | lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index fd84eb85d4a..ba57c731eb9 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -199,8 +199,19 @@ OperatingSystemPython::GetPluginVersion() bool OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list) { - // TODO: python: call "dict get_thread_info()" on the - // python object that represents our instance of the OperatingSystem plug-in + + if (!m_interpreter || !m_python_object) + return NULL; + auto object_sp = m_interpreter->OSPlugin_QueryForThreadsInfo(m_interpreter->MakeScriptObject(m_python_object)); + if (!object_sp) + return NULL; + PythonDataObject dictionary_data_obj((PyObject*)object_sp->GetObject()); + PythonDataDictionary dictionary = dictionary_data_obj.GetDictionaryObject(); + if(!dictionary) + return NULL; + + // TODO: read from the dict + // and parse the returned dictionary. We need to pass in the a Dictionary // with the same kind of info we want back so we can reuse old threads, but // only create new ones. @@ -227,8 +238,17 @@ OperatingSystemPython::ThreadWasSelected (Thread *thread) RegisterContextSP OperatingSystemPython::CreateRegisterContextForThread (Thread *thread) { - // TODO: python: call "bytes get_register_context_data(SBThread thread)" - // and populate resulting data into thread + + if (!m_interpreter || !m_python_object || !thread) + return NULL; + auto object_sp = m_interpreter->OSPlugin_QueryForThreadInfo(m_interpreter->MakeScriptObject(m_python_object), + thread->GetID()); + if (!object_sp) + return NULL; + PythonDataObject pack_info_data_obj((PyObject*)object_sp->GetObject()); + if(!pack_info_data_obj) + return NULL; + RegisterContextSP reg_ctx_sp; // bytes b = get_register_context_data(thread) // if (b) |