xref: /llvm-project/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h (revision 5790759a061522a60903efba2bab67937062729d)
1 //===-- OperatingSystemPython.h ---------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_DISABLE_PYTHON
10 
11 #ifndef liblldb_OperatingSystemPython_h_
12 #define liblldb_OperatingSystemPython_h_
13 
14 // C Includes
15 // C++ Includes
16 // Other libraries and framework includes
17 #include "lldb/Interpreter/ScriptInterpreter.h"
18 #include "lldb/Target/OperatingSystem.h"
19 
20 class DynamicRegisterInfo;
21 
22 class OperatingSystemPython : public lldb_private::OperatingSystem
23 {
24 public:
25     //------------------------------------------------------------------
26     // Static Functions
27     //------------------------------------------------------------------
28     static lldb_private::OperatingSystem *
29     CreateInstance (lldb_private::Process *process, bool force);
30 
31     static void
32     Initialize();
33 
34     static void
35     Terminate();
36 
37     static const char *
38     GetPluginNameStatic();
39 
40     static const char *
41     GetPluginDescriptionStatic();
42 
43     //------------------------------------------------------------------
44     // Class Methods
45     //------------------------------------------------------------------
46     OperatingSystemPython (lldb_private::Process *process);
47 
48     virtual
49     ~OperatingSystemPython ();
50 
51     //------------------------------------------------------------------
52     // lldb_private::PluginInterface Methods
53     //------------------------------------------------------------------
54     virtual const char *
55     GetPluginName();
56 
57     virtual const char *
58     GetShortPluginName();
59 
60     virtual uint32_t
61     GetPluginVersion();
62 
63     //------------------------------------------------------------------
64     // lldb_private::OperatingSystem Methods
65     //------------------------------------------------------------------
66     virtual bool
67     UpdateThreadList (lldb_private::ThreadList &old_thread_list,
68                       lldb_private::ThreadList &new_thread_list);
69 
70     virtual void
71     ThreadWasSelected (lldb_private::Thread *thread);
72 
73     virtual lldb::RegisterContextSP
74     CreateRegisterContextForThread (lldb_private::Thread *thread);
75 
76     virtual lldb::StopInfoSP
77     CreateThreadStopReason (lldb_private::Thread *thread);
78 
79 protected:
80 
81     DynamicRegisterInfo *
82     GetDynamicRegisterInfo ();
83 
84     lldb::ValueObjectSP m_thread_list_valobj_sp;
85     std::auto_ptr<DynamicRegisterInfo> m_register_info_ap;
86     lldb_private::ScriptInterpreter *m_interpreter;
87     void* m_python_object;
88 
89 };
90 
91 #endif // #ifndef liblldb_OperatingSystemPython_h_
92 #endif // #ifndef LLDB_DISABLE_PYTHON
93