summaryrefslogtreecommitdiffstats
path: root/lldb/include/lldb/API/SBDebugger.h
blob: 3dcc4890f5f660bbb0e3c2318b39afb97b329076 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
//===-- SBDebugger.h --------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SBDebugger_h_
#define LLDB_SBDebugger_h_

#include <LLDB/SBDefines.h>

namespace lldb {

class SBDebugger
{
public:

    static void
    Initialize();
    
    static void
    Terminate();
    
    static void
    SetAsync (bool b);

    static void
    SetInputFile (const char *tty_name);    // DEPRECATED: will be removed in next submission

    static void
    SetOutputFile (const char *tty_name);   // DEPRECATED: will be removed in next submission

    static void
    SetErrorFile (const char *tty_name);    // DEPRECATED: will be removed in next submission

    static void
    SetInputFileHandle (FILE *f, bool transfer_ownership);

    static void
    SetOutputFileHandle (FILE *f, bool transfer_ownership);

    static void
    SetErrorFileHandle (FILE *f, bool transfer_ownership);

    static FILE *
    GetInputFileHandle ();

    static FILE *
    GetOutputFileHandle ();

    static FILE *
    GetErrorFileHandle ();

    static lldb::SBCommandInterpreter
    GetCommandInterpreter ();

    static void
    HandleCommand (const char *command);

    static lldb::SBListener
    GetListener ();

    static void
    HandleProcessEvent (const lldb::SBProcess &process,
                        const lldb::SBEvent &event,
                        FILE *out,
                        FILE *err);

    static lldb::SBTarget
    CreateTargetWithFileAndTargetTriple (const char *filename,
                                         const char *target_triple);

    static lldb::SBTarget
    CreateTargetWithFileAndArch (const char *filename,
                                 const char *archname);

    static lldb::SBTarget
    CreateTarget (const char *filename);

    static lldb::SBTarget
    GetTargetAtIndex (uint32_t idx);

    static lldb::SBTarget
    FindTargetWithProcessID (pid_t pid);

    static lldb::SBTarget
    FindTargetWithFileAndArch (const char *filename,
                               const char *arch);

    static uint32_t
    GetNumTargets ();

    static lldb::SBTarget
    GetCurrentTarget ();

    static void
    UpdateCurrentThread (lldb::SBProcess &process);

    static void
    ReportCurrentLocation (FILE *out = stdout,
                           FILE *err = stderr);

    static lldb::SBSourceManager &
    GetSourceManager ();

    static bool
    GetDefaultArchitecture (char *arch_name, size_t arch_name_len);

    static bool
    SetDefaultArchitecture (const char *arch_name);

    static lldb::ScriptLanguage
    GetScriptingLanguage (const char *script_language_name);

    static const char *
    GetVersionString ();

    static const char *
    StateAsCString (lldb::StateType state);

    static bool
    StateIsRunningState (lldb::StateType state);

    static bool
    StateIsStoppedState (lldb::StateType state);

    static void
    DispatchInput (void *baton, const void *data, size_t data_len);

    static void
    PushInputReader (lldb::SBInputReader &reader);

private:
#ifndef SWIG
    friend class SBProcess;

    static lldb::SBTarget
    FindTargetWithLLDBProcess (const lldb::ProcessSP &processSP);
#endif
}; // class SBDebugger


} // namespace lldb

#endif // LLDB_SBDebugger_h_
OpenPOWER on IntegriCloud