1 //===-- SBDebugger.h --------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLDB_SBDebugger_h_
11 #define LLDB_SBDebugger_h_
13 #include "lldb/API/SBDefines.h"
28 // Deprecated, use the one that takes a source_init_files bool.
29 static lldb::SBDebugger
32 static lldb::SBDebugger
33 Create(bool source_init_files);
35 static lldb::SBDebugger
36 Create(bool source_init_files, lldb::LogOutputCallback log_callback, void *baton);
39 Destroy (lldb::SBDebugger &debugger);
42 MemoryPressureDetected ();
46 SBDebugger(const lldb::SBDebugger &rhs);
48 SBDebugger(const lldb::DebuggerSP &debugger_sp);
51 operator = (const lldb::SBDebugger &rhs);
68 SkipLLDBInitFiles (bool b);
71 SkipAppInitFiles (bool b);
74 SetInputFileHandle (FILE *f, bool transfer_ownership);
77 SetOutputFileHandle (FILE *f, bool transfer_ownership);
80 SetErrorFileHandle (FILE *f, bool transfer_ownership);
83 GetInputFileHandle ();
86 GetOutputFileHandle ();
89 GetErrorFileHandle ();
92 SaveInputTerminalState();
95 RestoreInputTerminalState();
97 lldb::SBCommandInterpreter
98 GetCommandInterpreter ();
101 HandleCommand (const char *command);
107 HandleProcessEvent (const lldb::SBProcess &process,
108 const lldb::SBEvent &event,
113 CreateTarget (const char *filename,
114 const char *target_triple,
115 const char *platform_name,
116 bool add_dependent_modules,
117 lldb::SBError& error);
120 CreateTargetWithFileAndTargetTriple (const char *filename,
121 const char *target_triple);
124 CreateTargetWithFileAndArch (const char *filename,
125 const char *archname);
128 CreateTarget (const char *filename);
130 // Return true if target is deleted from the target list of the debugger.
132 DeleteTarget (lldb::SBTarget &target);
135 GetTargetAtIndex (uint32_t idx);
138 GetIndexOfTarget (lldb::SBTarget target);
141 FindTargetWithProcessID (pid_t pid);
144 FindTargetWithFileAndArch (const char *filename,
151 GetSelectedTarget ();
154 SetSelectedTarget (SBTarget& target);
156 lldb::SBSourceManager
159 // REMOVE: just for a quick fix, need to expose platforms through
160 // SBPlatform from this class.
162 SetCurrentPlatform (const char *platform_name);
165 SetCurrentPlatformSDKRoot (const char *sysroot);
167 // FIXME: Once we get the set show stuff in place, the driver won't need
168 // an interface to the Set/Get UseExternalEditor.
170 SetUseExternalEditor (bool input);
173 GetUseExternalEditor ();
176 SetUseColor (bool use_color);
179 GetUseColor () const;
182 GetDefaultArchitecture (char *arch_name, size_t arch_name_len);
185 SetDefaultArchitecture (const char *arch_name);
188 GetScriptingLanguage (const char *script_language_name);
194 StateAsCString (lldb::StateType state);
197 StateIsRunningState (lldb::StateType state);
200 StateIsStoppedState (lldb::StateType state);
203 EnableLog (const char *channel, const char **categories);
206 SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton);
210 DispatchInput (void* baton,
215 DispatchInput (const void *data, size_t data_len);
218 DispatchInputInterrupt ();
221 DispatchInputEndOfFile ();
224 PushInputReader (lldb::SBInputReader &reader);
227 NotifyTopInputReader (lldb::InputReaderAction notification);
230 InputReaderIsTopReader (const lldb::SBInputReader &reader);
236 FindDebuggerWithID (int id);
239 SetInternalVariable (const char *var_name, const char *value, const char *debugger_instance_name);
241 static lldb::SBStringList
242 GetInternalVariableValue (const char *var_name, const char *debugger_instance_name);
245 GetDescription (lldb::SBStream &description);
248 GetTerminalWidth () const;
251 SetTerminalWidth (uint32_t term_width);
260 SetPrompt (const char *prompt);
263 GetScriptLanguage() const;
266 SetScriptLanguage (lldb::ScriptLanguage script_lang);
269 GetCloseInputOnEOF () const;
272 SetCloseInputOnEOF (bool b);
275 GetCategory (const char* category_name);
278 CreateCategory (const char* category_name);
281 DeleteCategory (const char* category_name);
287 GetCategoryAtIndex (uint32_t);
290 GetDefaultCategory();
293 GetFormatForType (SBTypeNameSpecifier);
295 #ifndef LLDB_DISABLE_PYTHON
297 GetSummaryForType (SBTypeNameSpecifier);
301 GetFilterForType (SBTypeNameSpecifier);
303 #ifndef LLDB_DISABLE_PYTHON
305 GetSyntheticForType (SBTypeNameSpecifier);
310 friend class SBCommandInterpreter;
311 friend class SBInputReader;
312 friend class SBListener;
313 friend class SBProcess;
314 friend class SBSourceManager;
315 friend class SBTarget;
318 FindTargetWithLLDBProcess (const lldb::ProcessSP &processSP);
321 reset (const lldb::DebuggerSP &debugger_sp);
323 lldb_private::Debugger *
326 lldb_private::Debugger &
329 const lldb::DebuggerSP &
332 lldb::DebuggerSP m_opaque_sp;
334 }; // class SBDebugger
339 #endif // LLDB_SBDebugger_h_