xref: /llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h (revision b29d82ebafc7bab6d6a98da3efa99ee4a16114b8)
1 //===-- ScriptInterpreterPython.h -------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
10 #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
11 
12 #ifdef LLDB_DISABLE_PYTHON
13 
14 // Python is disabled in this build
15 
16 #else
17 
18 #include <memory>
19 #include <string>
20 #include <vector>
21 
22 #include "PythonDataObjects.h"
23 #include "lldb/Breakpoint/BreakpointOptions.h"
24 #include "lldb/Core/IOHandler.h"
25 #include "lldb/Host/Terminal.h"
26 #include "lldb/Interpreter/ScriptInterpreter.h"
27 #include "lldb/lldb-private.h"
28 
29 class IOHandlerPythonInterpreter;
30 
31 namespace lldb_private {
32 
33 class ScriptInterpreterPython : public ScriptInterpreter,
34                                 public IOHandlerDelegateMultiline {
35 public:
36   class CommandDataPython : public BreakpointOptions::CommandData {
37   public:
38     CommandDataPython() : BreakpointOptions::CommandData() {
39       interpreter = lldb::eScriptLanguagePython;
40     }
41   };
42 
43   friend class ::IOHandlerPythonInterpreter;
44 
45   ScriptInterpreterPython(CommandInterpreter &interpreter);
46 
47   ~ScriptInterpreterPython() override;
48 
49   bool Interrupt() override;
50 
51   bool ExecuteOneLine(
52       llvm::StringRef command, CommandReturnObject *result,
53       const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
54 
55   void ExecuteInterpreterLoop() override;
56 
57   bool ExecuteOneLineWithReturn(
58       llvm::StringRef in_string,
59       ScriptInterpreter::ScriptReturnType return_type, void *ret_value,
60       const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
61 
62   lldb_private::Status ExecuteMultipleLines(
63       const char *in_string,
64       const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
65 
66   Status
67   ExportFunctionDefinitionToInterpreter(StringList &function_def) override;
68 
69   bool GenerateTypeScriptFunction(StringList &input, std::string &output,
70                                   const void *name_token = nullptr) override;
71 
72   bool GenerateTypeSynthClass(StringList &input, std::string &output,
73                               const void *name_token = nullptr) override;
74 
75   bool GenerateTypeSynthClass(const char *oneliner, std::string &output,
76                               const void *name_token = nullptr) override;
77 
78   // use this if the function code is just a one-liner script
79   bool GenerateTypeScriptFunction(const char *oneliner, std::string &output,
80                                   const void *name_token = nullptr) override;
81 
82   bool GenerateScriptAliasFunction(StringList &input,
83                                    std::string &output) override;
84 
85   StructuredData::ObjectSP
86   CreateSyntheticScriptedProvider(const char *class_name,
87                                   lldb::ValueObjectSP valobj) override;
88 
89   StructuredData::GenericSP
90   CreateScriptCommandObject(const char *class_name) override;
91 
92   StructuredData::ObjectSP
93   CreateScriptedThreadPlan(const char *class_name,
94                            lldb::ThreadPlanSP thread_plan) override;
95 
96   bool ScriptedThreadPlanExplainsStop(StructuredData::ObjectSP implementor_sp,
97                                       Event *event,
98                                       bool &script_error) override;
99 
100   bool ScriptedThreadPlanShouldStop(StructuredData::ObjectSP implementor_sp,
101                                     Event *event, bool &script_error) override;
102 
103   bool ScriptedThreadPlanIsStale(StructuredData::ObjectSP implementor_sp,
104                                  bool &script_error) override;
105 
106   lldb::StateType
107   ScriptedThreadPlanGetRunState(StructuredData::ObjectSP implementor_sp,
108                                 bool &script_error) override;
109 
110   StructuredData::GenericSP
111   CreateScriptedBreakpointResolver(const char *class_name,
112                                    StructuredDataImpl *args_data,
113                                    lldb::BreakpointSP &bkpt_sp) override;
114   bool
115   ScriptedBreakpointResolverSearchCallback(StructuredData::GenericSP
116                                                implementor_sp,
117                                            SymbolContext *sym_ctx) override;
118 
119   lldb::SearchDepth
120   ScriptedBreakpointResolverSearchDepth(StructuredData::GenericSP
121                                             implementor_sp) override;
122 
123   StructuredData::GenericSP
124   CreateFrameRecognizer(const char *class_name) override;
125 
126   lldb::ValueObjectListSP
127   GetRecognizedArguments(const StructuredData::ObjectSP &implementor,
128                          lldb::StackFrameSP frame_sp) override;
129 
130   StructuredData::GenericSP
131   OSPlugin_CreatePluginObject(const char *class_name,
132                               lldb::ProcessSP process_sp) override;
133 
134   StructuredData::DictionarySP
135   OSPlugin_RegisterInfo(StructuredData::ObjectSP os_plugin_object_sp) override;
136 
137   StructuredData::ArraySP
138   OSPlugin_ThreadsInfo(StructuredData::ObjectSP os_plugin_object_sp) override;
139 
140   StructuredData::StringSP
141   OSPlugin_RegisterContextData(StructuredData::ObjectSP os_plugin_object_sp,
142                                lldb::tid_t thread_id) override;
143 
144   StructuredData::DictionarySP
145   OSPlugin_CreateThread(StructuredData::ObjectSP os_plugin_object_sp,
146                         lldb::tid_t tid, lldb::addr_t context) override;
147 
148   StructuredData::ObjectSP
149   LoadPluginModule(const FileSpec &file_spec,
150                    lldb_private::Status &error) override;
151 
152   StructuredData::DictionarySP
153   GetDynamicSettings(StructuredData::ObjectSP plugin_module_sp, Target *target,
154                      const char *setting_name,
155                      lldb_private::Status &error) override;
156 
157   size_t CalculateNumChildren(const StructuredData::ObjectSP &implementor,
158                               uint32_t max) override;
159 
160   lldb::ValueObjectSP
161   GetChildAtIndex(const StructuredData::ObjectSP &implementor,
162                   uint32_t idx) override;
163 
164   int GetIndexOfChildWithName(const StructuredData::ObjectSP &implementor,
165                               const char *child_name) override;
166 
167   bool UpdateSynthProviderInstance(
168       const StructuredData::ObjectSP &implementor) override;
169 
170   bool MightHaveChildrenSynthProviderInstance(
171       const StructuredData::ObjectSP &implementor) override;
172 
173   lldb::ValueObjectSP
174   GetSyntheticValue(const StructuredData::ObjectSP &implementor) override;
175 
176   ConstString
177   GetSyntheticTypeName(const StructuredData::ObjectSP &implementor) override;
178 
179   bool
180   RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
181                         ScriptedCommandSynchronicity synchronicity,
182                         lldb_private::CommandReturnObject &cmd_retobj,
183                         Status &error,
184                         const lldb_private::ExecutionContext &exe_ctx) override;
185 
186   bool RunScriptBasedCommand(
187       StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
188       ScriptedCommandSynchronicity synchronicity,
189       lldb_private::CommandReturnObject &cmd_retobj, Status &error,
190       const lldb_private::ExecutionContext &exe_ctx) override;
191 
192   Status GenerateFunction(const char *signature,
193                           const StringList &input) override;
194 
195   Status GenerateBreakpointCommandCallbackData(StringList &input,
196                                                std::string &output) override;
197 
198   bool GenerateWatchpointCommandCallbackData(StringList &input,
199                                              std::string &output) override;
200 
201   static bool BreakpointCallbackFunction(void *baton,
202                                          StoppointCallbackContext *context,
203                                          lldb::user_id_t break_id,
204                                          lldb::user_id_t break_loc_id);
205 
206   static bool WatchpointCallbackFunction(void *baton,
207                                          StoppointCallbackContext *context,
208                                          lldb::user_id_t watch_id);
209 
210   bool GetScriptedSummary(const char *function_name, lldb::ValueObjectSP valobj,
211                           StructuredData::ObjectSP &callee_wrapper_sp,
212                           const TypeSummaryOptions &options,
213                           std::string &retval) override;
214 
215   void Clear() override;
216 
217   bool GetDocumentationForItem(const char *item, std::string &dest) override;
218 
219   bool GetShortHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp,
220                                     std::string &dest) override;
221 
222   uint32_t
223   GetFlagsForCommandObject(StructuredData::GenericSP cmd_obj_sp) override;
224 
225   bool GetLongHelpForCommandObject(StructuredData::GenericSP cmd_obj_sp,
226                                    std::string &dest) override;
227 
228   bool CheckObjectExists(const char *name) override {
229     if (!name || !name[0])
230       return false;
231     std::string temp;
232     return GetDocumentationForItem(name, temp);
233   }
234 
235   bool RunScriptFormatKeyword(const char *impl_function, Process *process,
236                               std::string &output, Status &error) override;
237 
238   bool RunScriptFormatKeyword(const char *impl_function, Thread *thread,
239                               std::string &output, Status &error) override;
240 
241   bool RunScriptFormatKeyword(const char *impl_function, Target *target,
242                               std::string &output, Status &error) override;
243 
244   bool RunScriptFormatKeyword(const char *impl_function, StackFrame *frame,
245                               std::string &output, Status &error) override;
246 
247   bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value,
248                               std::string &output, Status &error) override;
249 
250   bool
251   LoadScriptingModule(const char *filename, bool can_reload, bool init_session,
252                       lldb_private::Status &error,
253                       StructuredData::ObjectSP *module_sp = nullptr) override;
254 
255   bool IsReservedWord(const char *word) override;
256 
257   std::unique_ptr<ScriptInterpreterLocker> AcquireInterpreterLock() override;
258 
259   void CollectDataForBreakpointCommandCallback(
260       std::vector<BreakpointOptions *> &bp_options_vec,
261       CommandReturnObject &result) override;
262 
263   void
264   CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options,
265                                           CommandReturnObject &result) override;
266 
267   /// Set the callback body text into the callback for the breakpoint.
268   Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
269                                       const char *callback_body) override;
270 
271   void SetBreakpointCommandCallbackFunction(BreakpointOptions *bp_options,
272                                             const char *function_name) override;
273 
274   /// This one is for deserialization:
275   Status SetBreakpointCommandCallback(
276       BreakpointOptions *bp_options,
277       std::unique_ptr<BreakpointOptions::CommandData> &data_up) override;
278 
279   /// Set a one-liner as the callback for the watchpoint.
280   void SetWatchpointCommandCallback(WatchpointOptions *wp_options,
281                                     const char *oneliner) override;
282 
283   StringList ReadCommandInputFromUser(FILE *in_file);
284 
285   void ResetOutputFileHandle(FILE *new_fh) override;
286 
287   const char *GetDictionaryName() { return m_dictionary_name.c_str(); }
288 
289   PyThreadState *GetThreadState() { return m_command_thread_state; }
290 
291   void SetThreadState(PyThreadState *s) {
292     if (s)
293       m_command_thread_state = s;
294   }
295 
296   //----------------------------------------------------------------------
297   // IOHandlerDelegate
298   //----------------------------------------------------------------------
299   void IOHandlerActivated(IOHandler &io_handler, bool interactive) override;
300 
301   void IOHandlerInputComplete(IOHandler &io_handler,
302                               std::string &data) override;
303 
304   //------------------------------------------------------------------
305   // Static Functions
306   //------------------------------------------------------------------
307   static void InitializeSWIG();
308   static void Initialize();
309 
310   static void Terminate();
311 
312   static lldb::ScriptInterpreterSP
313   CreateInstance(CommandInterpreter &interpreter);
314 
315   static lldb_private::ConstString GetPluginNameStatic();
316 
317   static const char *GetPluginDescriptionStatic();
318 
319   static FileSpec GetPythonDir();
320 
321   //------------------------------------------------------------------
322   // PluginInterface protocol
323   //------------------------------------------------------------------
324   lldb_private::ConstString GetPluginName() override;
325 
326   uint32_t GetPluginVersion() override;
327 
328   class Locker : public ScriptInterpreterLocker {
329   public:
330     enum OnEntry {
331       AcquireLock = 0x0001,
332       InitSession = 0x0002,
333       InitGlobals = 0x0004,
334       NoSTDIN = 0x0008
335     };
336 
337     enum OnLeave {
338       FreeLock = 0x0001,
339       FreeAcquiredLock = 0x0002, // do not free the lock if we already held it
340                                  // when calling constructor
341       TearDownSession = 0x0004
342     };
343 
344     Locker(ScriptInterpreterPython *py_interpreter = nullptr,
345            uint16_t on_entry = AcquireLock | InitSession,
346            uint16_t on_leave = FreeLock | TearDownSession, FILE *in = nullptr,
347            FILE *out = nullptr, FILE *err = nullptr);
348 
349     ~Locker() override;
350 
351   private:
352     bool DoAcquireLock();
353 
354     bool DoInitSession(uint16_t on_entry_flags, FILE *in, FILE *out, FILE *err);
355 
356     bool DoFreeLock();
357 
358     bool DoTearDownSession();
359 
360     static void ReleasePythonLock();
361 
362     bool m_teardown_session;
363     ScriptInterpreterPython *m_python_interpreter;
364     //    	FILE*                    m_tmp_fh;
365     PyGILState_STATE m_GILState;
366   };
367 
368   // FIXME: This is currently used from the InitializePythonRAII. Make this
369   // private when we're able to break the dependency.
370 #if PY_MAJOR_VERSION >= 3
371   typedef PyObject *(*SWIGInitCallback)(void);
372 #else
373   typedef void (*SWIGInitCallback)(void);
374 #endif
375   static SWIGInitCallback g_swig_init_callback;
376 
377 protected:
378   typedef bool (*SWIGBreakpointCallbackFunction)(
379       const char *python_function_name, const char *session_dictionary_name,
380       const lldb::StackFrameSP &frame_sp,
381       const lldb::BreakpointLocationSP &bp_loc_sp);
382 
383   typedef bool (*SWIGWatchpointCallbackFunction)(
384       const char *python_function_name, const char *session_dictionary_name,
385       const lldb::StackFrameSP &frame_sp, const lldb::WatchpointSP &wp_sp);
386 
387   typedef bool (*SWIGPythonTypeScriptCallbackFunction)(
388       const char *python_function_name, void *session_dictionary,
389       const lldb::ValueObjectSP &valobj_sp, void **pyfunct_wrapper,
390       const lldb::TypeSummaryOptionsSP &options, std::string &retval);
391 
392   typedef void *(*SWIGPythonCreateSyntheticProvider)(
393       const char *python_class_name, const char *session_dictionary_name,
394       const lldb::ValueObjectSP &valobj_sp);
395 
396   typedef void *(*SWIGPythonCreateCommandObject)(
397       const char *python_class_name, const char *session_dictionary_name,
398       const lldb::DebuggerSP debugger_sp);
399 
400   typedef void *(*SWIGPythonCreateScriptedThreadPlan)(
401       const char *python_class_name, const char *session_dictionary_name,
402       const lldb::ThreadPlanSP &thread_plan_sp);
403 
404   typedef bool (*SWIGPythonCallThreadPlan)(void *implementor,
405                                            const char *method_name,
406                                            Event *event_sp, bool &got_error);
407 
408   typedef void *(*SWIGPythonCreateScriptedBreakpointResolver)(
409       const char *python_class_name, const char *session_dictionary_name,
410       lldb_private::StructuredDataImpl *args_impl, lldb::BreakpointSP &bkpt_sp);
411 
412   typedef unsigned int (*SWIGPythonCallBreakpointResolver)(
413       void *implementor, const char *method_name,
414       lldb_private::SymbolContext *sym_ctx);
415 
416   typedef void *(*SWIGPythonCreateOSPlugin)(const char *python_class_name,
417                                             const char *session_dictionary_name,
418                                             const lldb::ProcessSP &process_sp);
419 
420   typedef void *(*SWIGPythonCreateFrameRecognizer)(
421       const char *python_class_name, const char *session_dictionary_name);
422 
423   typedef void *(*SWIGPythonGetRecognizedArguments)(
424       void *implementor, const lldb::StackFrameSP &frame_sp);
425 
426   typedef size_t (*SWIGPythonCalculateNumChildren)(void *implementor,
427                                                    uint32_t max);
428 
429   typedef void *(*SWIGPythonGetChildAtIndex)(void *implementor, uint32_t idx);
430 
431   typedef int (*SWIGPythonGetIndexOfChildWithName)(void *implementor,
432                                                    const char *child_name);
433 
434   typedef void *(*SWIGPythonCastPyObjectToSBValue)(void *data);
435 
436   typedef lldb::ValueObjectSP (*SWIGPythonGetValueObjectSPFromSBValue)(
437       void *data);
438 
439   typedef bool (*SWIGPythonUpdateSynthProviderInstance)(void *data);
440 
441   typedef bool (*SWIGPythonMightHaveChildrenSynthProviderInstance)(void *data);
442 
443   typedef void *(*SWIGPythonGetValueSynthProviderInstance)(void *implementor);
444 
445   typedef bool (*SWIGPythonCallCommand)(
446       const char *python_function_name, const char *session_dictionary_name,
447       lldb::DebuggerSP &debugger, const char *args,
448       lldb_private::CommandReturnObject &cmd_retobj,
449       lldb::ExecutionContextRefSP exe_ctx_ref_sp);
450 
451   typedef bool (*SWIGPythonCallCommandObject)(
452       void *implementor, lldb::DebuggerSP &debugger, const char *args,
453       lldb_private::CommandReturnObject &cmd_retobj,
454       lldb::ExecutionContextRefSP exe_ctx_ref_sp);
455 
456   typedef bool (*SWIGPythonCallModuleInit)(const char *python_module_name,
457                                            const char *session_dictionary_name,
458                                            lldb::DebuggerSP &debugger);
459 
460   typedef bool (*SWIGPythonScriptKeyword_Process)(
461       const char *python_function_name, const char *session_dictionary_name,
462       lldb::ProcessSP &process, std::string &output);
463 
464   typedef bool (*SWIGPythonScriptKeyword_Thread)(
465       const char *python_function_name, const char *session_dictionary_name,
466       lldb::ThreadSP &thread, std::string &output);
467 
468   typedef bool (*SWIGPythonScriptKeyword_Target)(
469       const char *python_function_name, const char *session_dictionary_name,
470       lldb::TargetSP &target, std::string &output);
471 
472   typedef bool (*SWIGPythonScriptKeyword_Frame)(
473       const char *python_function_name, const char *session_dictionary_name,
474       lldb::StackFrameSP &frame, std::string &output);
475 
476   typedef bool (*SWIGPythonScriptKeyword_Value)(
477       const char *python_function_name, const char *session_dictionary_name,
478       lldb::ValueObjectSP &value, std::string &output);
479 
480   typedef void *(*SWIGPython_GetDynamicSetting)(
481       void *module, const char *setting, const lldb::TargetSP &target_sp);
482 
483   static void InitializePrivate();
484 
485   static void InitializeInterpreter(
486       SWIGInitCallback python_swig_init_callback,
487       SWIGBreakpointCallbackFunction swig_breakpoint_callback,
488       SWIGWatchpointCallbackFunction swig_watchpoint_callback,
489       SWIGPythonTypeScriptCallbackFunction swig_typescript_callback,
490       SWIGPythonCreateSyntheticProvider swig_synthetic_script,
491       SWIGPythonCreateCommandObject swig_create_cmd,
492       SWIGPythonCalculateNumChildren swig_calc_children,
493       SWIGPythonGetChildAtIndex swig_get_child_index,
494       SWIGPythonGetIndexOfChildWithName swig_get_index_child,
495       SWIGPythonCastPyObjectToSBValue swig_cast_to_sbvalue,
496       SWIGPythonGetValueObjectSPFromSBValue swig_get_valobj_sp_from_sbvalue,
497       SWIGPythonUpdateSynthProviderInstance swig_update_provider,
498       SWIGPythonMightHaveChildrenSynthProviderInstance
499           swig_mighthavechildren_provider,
500       SWIGPythonGetValueSynthProviderInstance swig_getvalue_provider,
501       SWIGPythonCallCommand swig_call_command,
502       SWIGPythonCallCommandObject swig_call_command_object,
503       SWIGPythonCallModuleInit swig_call_module_init,
504       SWIGPythonCreateOSPlugin swig_create_os_plugin,
505       SWIGPythonCreateFrameRecognizer swig_create_frame_recognizer,
506       SWIGPythonGetRecognizedArguments swig_get_recognized_arguments,
507       SWIGPythonScriptKeyword_Process swig_run_script_keyword_process,
508       SWIGPythonScriptKeyword_Thread swig_run_script_keyword_thread,
509       SWIGPythonScriptKeyword_Target swig_run_script_keyword_target,
510       SWIGPythonScriptKeyword_Frame swig_run_script_keyword_frame,
511       SWIGPythonScriptKeyword_Value swig_run_script_keyword_value,
512       SWIGPython_GetDynamicSetting swig_plugin_get,
513       SWIGPythonCreateScriptedThreadPlan swig_thread_plan_script,
514       SWIGPythonCallThreadPlan swig_call_thread_plan,
515       SWIGPythonCreateScriptedBreakpointResolver swig_bkpt_resolver_script,
516       SWIGPythonCallBreakpointResolver swig_call_breakpoint_resolver);
517 
518   class SynchronicityHandler {
519   private:
520     lldb::DebuggerSP m_debugger_sp;
521     ScriptedCommandSynchronicity m_synch_wanted;
522     bool m_old_asynch;
523 
524   public:
525     SynchronicityHandler(lldb::DebuggerSP, ScriptedCommandSynchronicity);
526 
527     ~SynchronicityHandler();
528   };
529 
530   enum class AddLocation { Beginning, End };
531 
532   static void AddToSysPath(AddLocation location, std::string path);
533 
534   static void ComputePythonDirForApple(llvm::SmallVectorImpl<char> &path);
535   static void ComputePythonDirForPosix(llvm::SmallVectorImpl<char> &path);
536   static void ComputePythonDirForWindows(llvm::SmallVectorImpl<char> &path);
537 
538   bool EnterSession(uint16_t on_entry_flags, FILE *in, FILE *out, FILE *err);
539 
540   void LeaveSession();
541 
542   void SaveTerminalState(int fd);
543 
544   void RestoreTerminalState();
545 
546   uint32_t IsExecutingPython() const { return m_lock_count > 0; }
547 
548   uint32_t IncrementLockCount() { return ++m_lock_count; }
549 
550   uint32_t DecrementLockCount() {
551     if (m_lock_count > 0)
552       --m_lock_count;
553     return m_lock_count;
554   }
555 
556   enum ActiveIOHandler {
557     eIOHandlerNone,
558     eIOHandlerBreakpoint,
559     eIOHandlerWatchpoint
560   };
561 
562   PythonObject &GetMainModule();
563 
564   PythonDictionary &GetSessionDictionary();
565 
566   PythonDictionary &GetSysModuleDictionary();
567 
568   bool GetEmbeddedInterpreterModuleObjects();
569 
570   bool SetStdHandle(File &file, const char *py_name, PythonFile &save_file,
571                     const char *mode);
572 
573   PythonFile m_saved_stdin;
574   PythonFile m_saved_stdout;
575   PythonFile m_saved_stderr;
576   PythonObject m_main_module;
577   PythonObject m_lldb_module;
578   PythonDictionary m_session_dict;
579   PythonDictionary m_sys_module_dict;
580   PythonObject m_run_one_line_function;
581   PythonObject m_run_one_line_str_global;
582   std::string m_dictionary_name;
583   TerminalState m_terminal_state;
584   ActiveIOHandler m_active_io_handler;
585   bool m_session_is_active;
586   bool m_pty_slave_is_open;
587   bool m_valid_session;
588   uint32_t m_lock_count;
589   PyThreadState *m_command_thread_state;
590 
591   static SWIGBreakpointCallbackFunction g_swig_breakpoint_callback;
592   static SWIGWatchpointCallbackFunction g_swig_watchpoint_callback;
593   static SWIGPythonTypeScriptCallbackFunction g_swig_typescript_callback;
594   static SWIGPythonCreateSyntheticProvider g_swig_synthetic_script;
595   static SWIGPythonCreateCommandObject g_swig_create_cmd;
596   static SWIGPythonCalculateNumChildren g_swig_calc_children;
597   static SWIGPythonGetChildAtIndex g_swig_get_child_index;
598   static SWIGPythonGetIndexOfChildWithName g_swig_get_index_child;
599   static SWIGPythonCastPyObjectToSBValue g_swig_cast_to_sbvalue;
600   static SWIGPythonGetValueObjectSPFromSBValue
601       g_swig_get_valobj_sp_from_sbvalue;
602   static SWIGPythonUpdateSynthProviderInstance g_swig_update_provider;
603   static SWIGPythonMightHaveChildrenSynthProviderInstance
604       g_swig_mighthavechildren_provider;
605   static SWIGPythonGetValueSynthProviderInstance g_swig_getvalue_provider;
606   static SWIGPythonCallCommand g_swig_call_command;
607   static SWIGPythonCallCommandObject g_swig_call_command_object;
608   static SWIGPythonCallModuleInit g_swig_call_module_init;
609   static SWIGPythonCreateOSPlugin g_swig_create_os_plugin;
610   static SWIGPythonCreateFrameRecognizer g_swig_create_frame_recognizer;
611   static SWIGPythonGetRecognizedArguments g_swig_get_recognized_arguments;
612   static SWIGPythonScriptKeyword_Process g_swig_run_script_keyword_process;
613   static SWIGPythonScriptKeyword_Thread g_swig_run_script_keyword_thread;
614   static SWIGPythonScriptKeyword_Target g_swig_run_script_keyword_target;
615   static SWIGPythonScriptKeyword_Frame g_swig_run_script_keyword_frame;
616   static SWIGPythonScriptKeyword_Value g_swig_run_script_keyword_value;
617   static SWIGPython_GetDynamicSetting g_swig_plugin_get;
618   static SWIGPythonCreateScriptedThreadPlan g_swig_thread_plan_script;
619   static SWIGPythonCallThreadPlan g_swig_call_thread_plan;
620   static SWIGPythonCreateScriptedBreakpointResolver g_swig_bkpt_resolver_script;
621   static SWIGPythonCallBreakpointResolver g_swig_call_bkpt_resolver;
622 };
623 
624 } // namespace lldb_private
625 
626 #endif // LLDB_DISABLE_PYTHON
627 
628 #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SCRIPTINTERPRETERPYTHON_H
629