1b3e77600SGreg Clayton //===-- OperatingSystemPython.cpp --------------------------------*- C++ -*-===//
2b3e77600SGreg Clayton //
3b3e77600SGreg Clayton //                     The LLVM Compiler Infrastructure
4b3e77600SGreg Clayton //
5b3e77600SGreg Clayton // This file is distributed under the University of Illinois Open Source
6b3e77600SGreg Clayton // License. See LICENSE.TXT for details.
7b3e77600SGreg Clayton //
8b3e77600SGreg Clayton //===----------------------------------------------------------------------===//
993a64300SDaniel Malea 
1093a64300SDaniel Malea #include "lldb/lldb-python.h"
1193a64300SDaniel Malea 
12b3e77600SGreg Clayton #ifndef LLDB_DISABLE_PYTHON
13b3e77600SGreg Clayton 
14b3e77600SGreg Clayton #include "OperatingSystemPython.h"
15b3e77600SGreg Clayton // C Includes
16b3e77600SGreg Clayton // C++ Includes
17b3e77600SGreg Clayton // Other libraries and framework includes
18b3e77600SGreg Clayton #include "lldb/Core/ArchSpec.h"
19b3e77600SGreg Clayton #include "lldb/Core/DataBufferHeap.h"
205790759aSEnrico Granata #include "lldb/Core/Debugger.h"
21b3e77600SGreg Clayton #include "lldb/Core/Module.h"
22b3e77600SGreg Clayton #include "lldb/Core/PluginManager.h"
23b3e77600SGreg Clayton #include "lldb/Core/RegisterValue.h"
24b3e77600SGreg Clayton #include "lldb/Core/ValueObjectVariable.h"
255790759aSEnrico Granata #include "lldb/Interpreter/CommandInterpreter.h"
265790759aSEnrico Granata #include "lldb/Interpreter/PythonDataObjects.h"
27b3e77600SGreg Clayton #include "lldb/Symbol/ClangNamespaceDecl.h"
28b3e77600SGreg Clayton #include "lldb/Symbol/ObjectFile.h"
29b3e77600SGreg Clayton #include "lldb/Symbol/VariableList.h"
30b3e77600SGreg Clayton #include "lldb/Target/Process.h"
31b3e77600SGreg Clayton #include "lldb/Target/StopInfo.h"
32b3e77600SGreg Clayton #include "lldb/Target/Target.h"
33b3e77600SGreg Clayton #include "lldb/Target/ThreadList.h"
34b3e77600SGreg Clayton #include "lldb/Target/Thread.h"
35b3e77600SGreg Clayton #include "Plugins/Process/Utility/DynamicRegisterInfo.h"
36b3e77600SGreg Clayton #include "Plugins/Process/Utility/RegisterContextMemory.h"
37b3e77600SGreg Clayton #include "Plugins/Process/Utility/ThreadMemory.h"
38b3e77600SGreg Clayton 
39b3e77600SGreg Clayton using namespace lldb;
40b3e77600SGreg Clayton using namespace lldb_private;
41b3e77600SGreg Clayton 
42b3e77600SGreg Clayton void
43b3e77600SGreg Clayton OperatingSystemPython::Initialize()
44b3e77600SGreg Clayton {
45b3e77600SGreg Clayton     PluginManager::RegisterPlugin (GetPluginNameStatic(),
46b3e77600SGreg Clayton                                    GetPluginDescriptionStatic(),
47b3e77600SGreg Clayton                                    CreateInstance);
48b3e77600SGreg Clayton }
49b3e77600SGreg Clayton 
50b3e77600SGreg Clayton void
51b3e77600SGreg Clayton OperatingSystemPython::Terminate()
52b3e77600SGreg Clayton {
53b3e77600SGreg Clayton     PluginManager::UnregisterPlugin (CreateInstance);
54b3e77600SGreg Clayton }
55b3e77600SGreg Clayton 
56b3e77600SGreg Clayton OperatingSystem *
57b3e77600SGreg Clayton OperatingSystemPython::CreateInstance (Process *process, bool force)
58b3e77600SGreg Clayton {
59b3e77600SGreg Clayton     // Python OperatingSystem plug-ins must be requested by name, so force must be true
60c9d645d3SGreg Clayton     FileSpec python_os_plugin_spec (process->GetPythonOSPluginPath());
61c9d645d3SGreg Clayton     if (python_os_plugin_spec && python_os_plugin_spec.Exists())
62c9d645d3SGreg Clayton     {
63c9d645d3SGreg Clayton         std::auto_ptr<OperatingSystemPython> os_ap (new OperatingSystemPython (process, python_os_plugin_spec));
64c9d645d3SGreg Clayton         if (os_ap.get() && os_ap->IsValid())
65c9d645d3SGreg Clayton             return os_ap.release();
66c9d645d3SGreg Clayton     }
67b3e77600SGreg Clayton     return NULL;
68b3e77600SGreg Clayton }
69b3e77600SGreg Clayton 
70b3e77600SGreg Clayton 
71b3e77600SGreg Clayton const char *
72b3e77600SGreg Clayton OperatingSystemPython::GetPluginNameStatic()
73b3e77600SGreg Clayton {
74b3e77600SGreg Clayton     return "python";
75b3e77600SGreg Clayton }
76b3e77600SGreg Clayton 
77b3e77600SGreg Clayton const char *
78b3e77600SGreg Clayton OperatingSystemPython::GetPluginDescriptionStatic()
79b3e77600SGreg Clayton {
80b3e77600SGreg Clayton     return "Operating system plug-in that gathers OS information from a python class that implements the necessary OperatingSystem functionality.";
81b3e77600SGreg Clayton }
82b3e77600SGreg Clayton 
83b3e77600SGreg Clayton 
84c9d645d3SGreg Clayton OperatingSystemPython::OperatingSystemPython (lldb_private::Process *process, const FileSpec &python_module_path) :
85b3e77600SGreg Clayton     OperatingSystem (process),
86b3e77600SGreg Clayton     m_thread_list_valobj_sp (),
875790759aSEnrico Granata     m_register_info_ap (),
885790759aSEnrico Granata     m_interpreter (NULL),
89*a4d8747dSGreg Clayton     m_python_object_sp ()
90b3e77600SGreg Clayton {
915790759aSEnrico Granata     if (!process)
925790759aSEnrico Granata         return;
93*a4d8747dSGreg Clayton     TargetSP target_sp = process->CalculateTarget();
945790759aSEnrico Granata     if (!target_sp)
955790759aSEnrico Granata         return;
965790759aSEnrico Granata     m_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
975790759aSEnrico Granata     if (m_interpreter)
985790759aSEnrico Granata     {
992443cbd7SGreg Clayton 
100c9d645d3SGreg Clayton         std::string os_plugin_class_name (python_module_path.GetFilename().AsCString(""));
101c9d645d3SGreg Clayton         if (!os_plugin_class_name.empty())
102c9d645d3SGreg Clayton         {
103c9d645d3SGreg Clayton             const bool init_session = false;
104c9d645d3SGreg Clayton             const bool allow_reload = true;
105c9d645d3SGreg Clayton             char python_module_path_cstr[PATH_MAX];
106c9d645d3SGreg Clayton             python_module_path.GetPath(python_module_path_cstr, sizeof(python_module_path_cstr));
107c9d645d3SGreg Clayton             Error error;
108c9d645d3SGreg Clayton             if (m_interpreter->LoadScriptingModule (python_module_path_cstr, allow_reload, init_session, error))
109c9d645d3SGreg Clayton             {
110c9d645d3SGreg Clayton                 // Strip the ".py" extension if there is one
111c9d645d3SGreg Clayton                 size_t py_extension_pos = os_plugin_class_name.rfind(".py");
112c9d645d3SGreg Clayton                 if (py_extension_pos != std::string::npos)
113c9d645d3SGreg Clayton                     os_plugin_class_name.erase (py_extension_pos);
114c9d645d3SGreg Clayton                 // Add ".OperatingSystemPlugIn" to the module name to get a string like "modulename.OperatingSystemPlugIn"
115c9d645d3SGreg Clayton                 os_plugin_class_name += ".OperatingSystemPlugIn";
116*a4d8747dSGreg Clayton                 ScriptInterpreterObjectSP object_sp = m_interpreter->OSPlugin_CreatePluginObject(os_plugin_class_name.c_str(), process->CalculateProcess());
117*a4d8747dSGreg Clayton                 if (object_sp && object_sp->GetObject())
118*a4d8747dSGreg Clayton                     m_python_object_sp = object_sp;
119c9d645d3SGreg Clayton             }
1202443cbd7SGreg Clayton         }
1215790759aSEnrico Granata     }
122b3e77600SGreg Clayton }
123b3e77600SGreg Clayton 
124b3e77600SGreg Clayton OperatingSystemPython::~OperatingSystemPython ()
125b3e77600SGreg Clayton {
126b3e77600SGreg Clayton }
127b3e77600SGreg Clayton 
128b3e77600SGreg Clayton DynamicRegisterInfo *
129b3e77600SGreg Clayton OperatingSystemPython::GetDynamicRegisterInfo ()
130b3e77600SGreg Clayton {
1312443cbd7SGreg Clayton     if (m_register_info_ap.get() == NULL)
1322443cbd7SGreg Clayton     {
133*a4d8747dSGreg Clayton         if (!m_interpreter || !m_python_object_sp)
1345790759aSEnrico Granata             return NULL;
1351c22be69SGreg Clayton         LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
1361c22be69SGreg Clayton 
1371c22be69SGreg Clayton         if (log)
138d01b2953SDaniel Malea             log->Printf ("OperatingSystemPython::GetDynamicRegisterInfo() fetching thread register definitions from python for pid %" PRIu64, m_process->GetID());
1391c22be69SGreg Clayton 
140*a4d8747dSGreg Clayton         PythonDictionary dictionary(m_interpreter->OSPlugin_RegisterInfo(m_python_object_sp));
1415790759aSEnrico Granata         if (!dictionary)
1425790759aSEnrico Granata             return NULL;
143b3e77600SGreg Clayton 
1442443cbd7SGreg Clayton         m_register_info_ap.reset (new DynamicRegisterInfo (dictionary));
1452443cbd7SGreg Clayton         assert (m_register_info_ap->GetNumRegisters() > 0);
1462443cbd7SGreg Clayton         assert (m_register_info_ap->GetNumRegisterSets() > 0);
147b3e77600SGreg Clayton     }
148b3e77600SGreg Clayton     return m_register_info_ap.get();
149b3e77600SGreg Clayton }
150b3e77600SGreg Clayton 
151b3e77600SGreg Clayton //------------------------------------------------------------------
152b3e77600SGreg Clayton // PluginInterface protocol
153b3e77600SGreg Clayton //------------------------------------------------------------------
154b3e77600SGreg Clayton const char *
155b3e77600SGreg Clayton OperatingSystemPython::GetPluginName()
156b3e77600SGreg Clayton {
157b3e77600SGreg Clayton     return "OperatingSystemPython";
158b3e77600SGreg Clayton }
159b3e77600SGreg Clayton 
160b3e77600SGreg Clayton const char *
161b3e77600SGreg Clayton OperatingSystemPython::GetShortPluginName()
162b3e77600SGreg Clayton {
163b3e77600SGreg Clayton     return GetPluginNameStatic();
164b3e77600SGreg Clayton }
165b3e77600SGreg Clayton 
166b3e77600SGreg Clayton uint32_t
167b3e77600SGreg Clayton OperatingSystemPython::GetPluginVersion()
168b3e77600SGreg Clayton {
169b3e77600SGreg Clayton     return 1;
170b3e77600SGreg Clayton }
171b3e77600SGreg Clayton 
172b3e77600SGreg Clayton bool
173b3e77600SGreg Clayton OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)
174b3e77600SGreg Clayton {
175*a4d8747dSGreg Clayton     if (!m_interpreter || !m_python_object_sp)
176a85e6b6cSDaniel Malea         return false;
1771c22be69SGreg Clayton 
1781c22be69SGreg Clayton     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
1791c22be69SGreg Clayton 
18085e276b8SJim Ingham     // First thing we have to do is get the API lock, and the run lock.  We're going to change the thread
18185e276b8SJim Ingham     // content of the process, and we're going to use python, which requires the API lock to do it.
18285e276b8SJim Ingham     // So get & hold that.  This is a recursive lock so we can grant it to any Python code called on the stack below us.
18385e276b8SJim Ingham     Target &target = m_process->GetTarget();
18485e276b8SJim Ingham     Mutex::Locker api_locker (target.GetAPIMutex());
18585e276b8SJim Ingham 
1861c22be69SGreg Clayton     if (log)
187d01b2953SDaniel Malea         log->Printf ("OperatingSystemPython::UpdateThreadList() fetching thread data from python for pid %" PRIu64, m_process->GetID());
1881c22be69SGreg Clayton 
189*a4d8747dSGreg Clayton     PythonList threads_list(m_interpreter->OSPlugin_ThreadsInfo(m_python_object_sp));
190*a4d8747dSGreg Clayton     if (threads_list)
191435ce139SGreg Clayton     {
192*a4d8747dSGreg Clayton         const uint32_t num_threads = threads_list.GetSize();
193435ce139SGreg Clayton         for (uint32_t i=0; i<num_threads; ++i)
194435ce139SGreg Clayton         {
195*a4d8747dSGreg Clayton             PythonDictionary thread_dict(threads_list.GetItemAtIndex(i));
196435ce139SGreg Clayton             if (thread_dict)
197435ce139SGreg Clayton             {
198*a4d8747dSGreg Clayton                 ThreadSP thread_sp (CreateThreadFromThreadInfo (thread_dict, &old_thread_list, NULL));
199*a4d8747dSGreg Clayton                 if (thread_sp)
200435ce139SGreg Clayton                     new_thread_list.AddThread(thread_sp);
201435ce139SGreg Clayton             }
202435ce139SGreg Clayton         }
203435ce139SGreg Clayton     }
204435ce139SGreg Clayton     else
205435ce139SGreg Clayton     {
206b3e77600SGreg Clayton         new_thread_list = old_thread_list;
207435ce139SGreg Clayton     }
208b3e77600SGreg Clayton     return new_thread_list.GetSize(false) > 0;
209b3e77600SGreg Clayton }
210b3e77600SGreg Clayton 
211*a4d8747dSGreg Clayton ThreadSP
212*a4d8747dSGreg Clayton OperatingSystemPython::CreateThreadFromThreadInfo (PythonDictionary &thread_dict, ThreadList *old_thread_list_ptr, bool *did_create_ptr)
213*a4d8747dSGreg Clayton {
214*a4d8747dSGreg Clayton     ThreadSP thread_sp;
215*a4d8747dSGreg Clayton     if (thread_dict)
216*a4d8747dSGreg Clayton     {
217*a4d8747dSGreg Clayton         PythonString tid_pystr("tid");
218*a4d8747dSGreg Clayton         PythonString name_pystr("name");
219*a4d8747dSGreg Clayton         PythonString queue_pystr("queue");
220*a4d8747dSGreg Clayton         PythonString state_pystr("state");
221*a4d8747dSGreg Clayton         PythonString stop_reason_pystr("stop_reason");
222*a4d8747dSGreg Clayton         PythonString reg_data_addr_pystr ("register_data_addr");
223*a4d8747dSGreg Clayton 
224*a4d8747dSGreg Clayton         const tid_t tid = thread_dict.GetItemForKeyAsInteger (tid_pystr, LLDB_INVALID_THREAD_ID);
225*a4d8747dSGreg Clayton         const addr_t reg_data_addr = thread_dict.GetItemForKeyAsInteger (reg_data_addr_pystr, LLDB_INVALID_ADDRESS);
226*a4d8747dSGreg Clayton         const char *name = thread_dict.GetItemForKeyAsString (name_pystr);
227*a4d8747dSGreg Clayton         const char *queue = thread_dict.GetItemForKeyAsString (queue_pystr);
228*a4d8747dSGreg Clayton         //const char *state = thread_dict.GetItemForKeyAsString (state_pystr);
229*a4d8747dSGreg Clayton         //const char *stop_reason = thread_dict.GetItemForKeyAsString (stop_reason_pystr);
230*a4d8747dSGreg Clayton 
231*a4d8747dSGreg Clayton         if (old_thread_list_ptr)
232*a4d8747dSGreg Clayton             thread_sp = old_thread_list_ptr->FindThreadByID (tid, false);
233*a4d8747dSGreg Clayton         if (!thread_sp)
234*a4d8747dSGreg Clayton         {
235*a4d8747dSGreg Clayton             if (did_create_ptr)
236*a4d8747dSGreg Clayton                 *did_create_ptr = true;
237*a4d8747dSGreg Clayton             thread_sp.reset (new ThreadMemory (*m_process,
238*a4d8747dSGreg Clayton                                                tid,
239*a4d8747dSGreg Clayton                                                name,
240*a4d8747dSGreg Clayton                                                queue,
241*a4d8747dSGreg Clayton                                                reg_data_addr));
242*a4d8747dSGreg Clayton         }
243*a4d8747dSGreg Clayton     }
244*a4d8747dSGreg Clayton     return thread_sp;
245*a4d8747dSGreg Clayton }
246*a4d8747dSGreg Clayton 
247*a4d8747dSGreg Clayton 
248*a4d8747dSGreg Clayton 
249b3e77600SGreg Clayton void
250b3e77600SGreg Clayton OperatingSystemPython::ThreadWasSelected (Thread *thread)
251b3e77600SGreg Clayton {
252b3e77600SGreg Clayton }
253b3e77600SGreg Clayton 
254b3e77600SGreg Clayton RegisterContextSP
255*a4d8747dSGreg Clayton OperatingSystemPython::CreateRegisterContextForThread (Thread *thread, addr_t reg_data_addr)
256b3e77600SGreg Clayton {
257435ce139SGreg Clayton     RegisterContextSP reg_ctx_sp;
258*a4d8747dSGreg Clayton     if (!m_interpreter || !m_python_object_sp || !thread)
259c44306f7SFilipe Cabecinhas         return RegisterContextSP();
2601c22be69SGreg Clayton 
26185e276b8SJim Ingham     // First thing we have to do is get the API lock, and the run lock.  We're going to change the thread
26285e276b8SJim Ingham     // content of the process, and we're going to use python, which requires the API lock to do it.
26385e276b8SJim Ingham     // So get & hold that.  This is a recursive lock so we can grant it to any Python code called on the stack below us.
26485e276b8SJim Ingham     Target &target = m_process->GetTarget();
26585e276b8SJim Ingham     Mutex::Locker api_locker (target.GetAPIMutex());
26685e276b8SJim Ingham 
2671c22be69SGreg Clayton     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
2681c22be69SGreg Clayton 
269ead45e01SGreg Clayton     if (reg_data_addr != LLDB_INVALID_ADDRESS)
270ead45e01SGreg Clayton     {
271ead45e01SGreg Clayton         // The registers data is in contiguous memory, just create the register
272ead45e01SGreg Clayton         // context using the address provided
273ead45e01SGreg Clayton         if (log)
274d01b2953SDaniel Malea             log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%" PRIx64 ", reg_data_addr = 0x%" PRIx64 ") creating memory register context", thread->GetID(), reg_data_addr);
275ead45e01SGreg Clayton         reg_ctx_sp.reset (new RegisterContextMemory (*thread, 0, *GetDynamicRegisterInfo (), reg_data_addr));
276ead45e01SGreg Clayton     }
277ead45e01SGreg Clayton     else
278ead45e01SGreg Clayton     {
279ead45e01SGreg Clayton         // No register data address is provided, query the python plug-in to let
280ead45e01SGreg Clayton         // it make up the data as it sees fit
2811c22be69SGreg Clayton         if (log)
282d01b2953SDaniel Malea             log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%" PRIx64 ") fetching register data from python", thread->GetID());
2831c22be69SGreg Clayton 
284*a4d8747dSGreg Clayton         PythonString reg_context_data(m_interpreter->OSPlugin_RegisterContextData (m_python_object_sp, thread->GetID()));
285435ce139SGreg Clayton         if (reg_context_data)
286435ce139SGreg Clayton         {
287435ce139SGreg Clayton             DataBufferSP data_sp (new DataBufferHeap (reg_context_data.GetString(),
288435ce139SGreg Clayton                                                       reg_context_data.GetSize()));
289435ce139SGreg Clayton             if (data_sp->GetByteSize())
290435ce139SGreg Clayton             {
291435ce139SGreg Clayton                 RegisterContextMemory *reg_ctx_memory = new RegisterContextMemory (*thread, 0, *GetDynamicRegisterInfo (), LLDB_INVALID_ADDRESS);
292435ce139SGreg Clayton                 if (reg_ctx_memory)
293435ce139SGreg Clayton                 {
294435ce139SGreg Clayton                     reg_ctx_sp.reset(reg_ctx_memory);
295435ce139SGreg Clayton                     reg_ctx_memory->SetAllRegisterData (data_sp);
296435ce139SGreg Clayton                 }
297435ce139SGreg Clayton             }
298435ce139SGreg Clayton         }
299ead45e01SGreg Clayton     }
300b3e77600SGreg Clayton     return reg_ctx_sp;
301b3e77600SGreg Clayton }
302b3e77600SGreg Clayton 
303b3e77600SGreg Clayton StopInfoSP
304b3e77600SGreg Clayton OperatingSystemPython::CreateThreadStopReason (lldb_private::Thread *thread)
305b3e77600SGreg Clayton {
306b3e77600SGreg Clayton     // We should have gotten the thread stop info from the dictionary of data for
307b3e77600SGreg Clayton     // the thread in the initial call to get_thread_info(), this should have been
308b3e77600SGreg Clayton     // cached so we can return it here
309b3e77600SGreg Clayton     StopInfoSP stop_info_sp; //(StopInfo::CreateStopReasonWithSignal (*thread, SIGSTOP));
310b3e77600SGreg Clayton     return stop_info_sp;
311b3e77600SGreg Clayton }
312b3e77600SGreg Clayton 
313*a4d8747dSGreg Clayton lldb::ThreadSP
314*a4d8747dSGreg Clayton OperatingSystemPython::CreateThread (lldb::tid_t tid, addr_t context)
315*a4d8747dSGreg Clayton {
316*a4d8747dSGreg Clayton     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
317*a4d8747dSGreg Clayton 
318*a4d8747dSGreg Clayton     if (log)
319*a4d8747dSGreg Clayton         log->Printf ("OperatingSystemPython::CreateThread (tid = 0x%" PRIx64 ", context = 0x%" PRIx64 ") fetching register data from python", tid, context);
320*a4d8747dSGreg Clayton 
321*a4d8747dSGreg Clayton     if (m_interpreter && m_python_object_sp)
322*a4d8747dSGreg Clayton     {
323*a4d8747dSGreg Clayton         // First thing we have to do is get the API lock, and the run lock.  We're going to change the thread
324*a4d8747dSGreg Clayton         // content of the process, and we're going to use python, which requires the API lock to do it.
325*a4d8747dSGreg Clayton         // So get & hold that.  This is a recursive lock so we can grant it to any Python code called on the stack below us.
326*a4d8747dSGreg Clayton         Target &target = m_process->GetTarget();
327*a4d8747dSGreg Clayton         Mutex::Locker api_locker (target.GetAPIMutex());
328*a4d8747dSGreg Clayton 
329*a4d8747dSGreg Clayton         PythonDictionary thread_info_dict (m_interpreter->OSPlugin_CreateThread(m_python_object_sp, tid, context));
330*a4d8747dSGreg Clayton         if (thread_info_dict)
331*a4d8747dSGreg Clayton         {
332*a4d8747dSGreg Clayton             ThreadList &thread_list = m_process->GetThreadList();
333*a4d8747dSGreg Clayton             bool did_create = false;
334*a4d8747dSGreg Clayton             ThreadSP thread_sp (CreateThreadFromThreadInfo (thread_info_dict, &thread_list, &did_create));
335*a4d8747dSGreg Clayton             if (did_create)
336*a4d8747dSGreg Clayton                 thread_list.AddThread(thread_sp);
337*a4d8747dSGreg Clayton             return thread_sp;
338*a4d8747dSGreg Clayton         }
339*a4d8747dSGreg Clayton     }
340*a4d8747dSGreg Clayton     return ThreadSP();
341*a4d8747dSGreg Clayton }
342*a4d8747dSGreg Clayton 
343*a4d8747dSGreg Clayton 
344b3e77600SGreg Clayton 
345b3e77600SGreg Clayton #endif // #ifndef LLDB_DISABLE_PYTHON
346