ScriptInterpreterPython.h revision 60dde64d699c71807dc95d75b40f5b777d167cc4
1//===-- ScriptInterpreterPython.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 10 11#ifndef liblldb_ScriptInterpreterPython_h_ 12#define liblldb_ScriptInterpreterPython_h_ 13 14#include "lldb/Interpreter/ScriptInterpreter.h" 15#include "lldb/Core/InputReader.h" 16 17namespace lldb_private { 18 19class ScriptInterpreterPython : public ScriptInterpreter 20{ 21public: 22 23 ScriptInterpreterPython (CommandInterpreter &interpreter); 24 25 ~ScriptInterpreterPython (); 26 27 bool 28 ExecuteOneLine (CommandInterpreter &interpreter, const char *command, CommandReturnObject *result); 29 30 void 31 ExecuteInterpreterLoop (CommandInterpreter &interpreter); 32 33 bool 34 ExecuteOneLineWithReturn (const char *in_string, 35 ScriptInterpreter::ReturnType return_type, 36 void *ret_value); 37 38 bool 39 ExecuteMultipleLines (const char *in_string); 40 41 bool 42 ExportFunctionDefinitionToInterpreter (StringList &function_def); 43 44 bool 45 GenerateBreakpointCommandCallbackData (StringList &input, StringList &output); 46 47 static size_t 48 GenerateBreakpointOptionsCommandCallback (void *baton, 49 InputReader &reader, 50 lldb::InputReaderAction notification, 51 const char *bytes, 52 size_t bytes_len); 53 54 static bool 55 BreakpointCallbackFunction (void *baton, 56 StoppointCallbackContext *context, 57 lldb::user_id_t break_id, 58 lldb::user_id_t break_loc_id); 59 60 void 61 CollectDataForBreakpointCommandCallback (CommandInterpreter &interpreter, 62 BreakpointOptions *bp_options, 63 CommandReturnObject &result); 64 65 StringList 66 ReadCommandInputFromUser (FILE *in_file); 67 68private: 69 70 static size_t 71 InputReaderCallback (void *baton, 72 InputReader &reader, 73 lldb::InputReaderAction notification, 74 const char *bytes, 75 size_t bytes_len); 76 77 void *m_compiled_module; 78 struct termios m_termios; 79 bool m_termios_valid; 80}; 81 82} // namespace lldb_private 83 84 85#endif // #ifndef liblldb_ScriptInterpreterPython_h_ 86