SBDebugger.h revision 24943d2ee8bfaa7cf5893e4709143924157a5c1e
1//===-- SBDebugger.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#ifndef LLDB_SBDebugger_h_
11#define LLDB_SBDebugger_h_
12
13#include <LLDB/SBDefines.h>
14
15namespace lldb {
16
17class SBDebugger
18{
19public:
20
21    static void
22    Initialize();
23
24    static void
25    Terminate();
26
27    static void
28    SetAsync (bool b);
29
30    static void
31    SetInputFile (const char *tty_name);    // DEPRECATED: will be removed in next submission
32
33    static void
34    SetOutputFile (const char *tty_name);   // DEPRECATED: will be removed in next submission
35
36    static void
37    SetErrorFile (const char *tty_name);    // DEPRECATED: will be removed in next submission
38
39    static void
40    SetInputFileHandle (FILE *f, bool transfer_ownership);
41
42    static void
43    SetOutputFileHandle (FILE *f, bool transfer_ownership);
44
45    static void
46    SetErrorFileHandle (FILE *f, bool transfer_ownership);
47
48    static FILE *
49    GetInputFileHandle ();
50
51    static FILE *
52    GetOutputFileHandle ();
53
54    static FILE *
55    GetErrorFileHandle ();
56
57    static lldb::SBCommandInterpreter
58    GetCommandInterpreter ();
59
60    static void
61    HandleCommand (const char *command);
62
63    static lldb::SBListener
64    GetListener ();
65
66    static void
67    HandleProcessEvent (const lldb::SBProcess &process,
68                        const lldb::SBEvent &event,
69                        FILE *out,
70                        FILE *err);
71
72    static lldb::SBTarget
73    CreateTargetWithFileAndTargetTriple (const char *filename,
74                                         const char *target_triple);
75
76    static lldb::SBTarget
77    CreateTargetWithFileAndArch (const char *filename,
78                                 const char *archname);
79
80    static lldb::SBTarget
81    CreateTarget (const char *filename);
82
83    static lldb::SBTarget
84    GetTargetAtIndex (uint32_t idx);
85
86    static lldb::SBTarget
87    FindTargetWithProcessID (pid_t pid);
88
89    static lldb::SBTarget
90    FindTargetWithFileAndArch (const char *filename,
91                               const char *arch);
92
93    static uint32_t
94    GetNumTargets ();
95
96    static lldb::SBTarget
97    GetCurrentTarget ();
98
99    static void
100    UpdateCurrentThread (lldb::SBProcess &process);
101
102    static void
103    ReportCurrentLocation (FILE *out = stdout,
104                           FILE *err = stderr);
105
106    static lldb::SBSourceManager &
107    GetSourceManager ();
108
109    static bool
110    GetDefaultArchitecture (char *arch_name, size_t arch_name_len);
111
112    static bool
113    SetDefaultArchitecture (const char *arch_name);
114
115    static lldb::ScriptLanguage
116    GetScriptingLanguage (const char *script_language_name);
117
118    static const char *
119    GetVersionString ();
120
121    static const char *
122    StateAsCString (lldb::StateType state);
123
124    static bool
125    StateIsRunningState (lldb::StateType state);
126
127    static bool
128    StateIsStoppedState (lldb::StateType state);
129
130    static void
131    DispatchInput (void *baton, const void *data, size_t data_len);
132
133    static void
134    PushInputReader (lldb::SBInputReader &reader);
135
136private:
137#ifndef SWIG
138    friend class SBProcess;
139
140    static lldb::SBTarget
141    FindTargetWithLLDBProcess (const lldb::ProcessSP &processSP);
142#endif
143}; // class SBDebugger
144
145
146} // namespace lldb
147
148#endif // LLDB_SBDebugger_h_
149