ScriptInterpreterPython.h revision 3c90d99d1520c45942479257a632f38f0191a360
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 ();
24
25    ~ScriptInterpreterPython ();
26
27    void
28    ExecuteOneLine (const std::string &line, FILE *out, FILE *err);
29
30    void
31    ExecuteInterpreterLoop (FILE *out, FILE *err);
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 (BreakpointOptions *bp_options,
62                                             CommandReturnObject &result);
63
64    StringList
65    ReadCommandInputFromUser (FILE *in_file);
66
67private:
68
69    static size_t
70    InputReaderCallback (void *baton,
71                         InputReader *reader,
72                         lldb::InputReaderAction notification,
73                         const char *bytes,
74                         size_t bytes_len);
75
76    void *m_compiled_module;
77    struct termios m_termios;
78    bool m_termios_valid;
79};
80
81} // namespace lldb_private
82
83
84#endif // #ifndef liblldb_ScriptInterpreterPython_h_
85