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_
15 #include "lldb/API/SBDefines.h"
16 #include "lldb/API/SBPlatform.h"
26 SBError Initialize(lldb::SBDebugger&, unsigned long (*)(void*, lldb::SBInputReader*, lldb::InputReaderAction, char const*, unsigned long), void*, lldb::InputReaderGranularity, char const*, char const*, bool);
28 bool IsActive() const;
40 // Deprecated, use the one that takes a source_init_files bool.
41 static lldb::SBDebugger
44 static lldb::SBDebugger
45 Create(bool source_init_files);
47 static lldb::SBDebugger
48 Create(bool source_init_files, lldb::LogOutputCallback log_callback, void *baton);
51 Destroy (lldb::SBDebugger &debugger);
54 MemoryPressureDetected ();
58 SBDebugger(const lldb::SBDebugger &rhs);
60 SBDebugger(const lldb::DebuggerSP &debugger_sp);
63 operator = (const lldb::SBDebugger &rhs);
80 SkipLLDBInitFiles (bool b);
83 SkipAppInitFiles (bool b);
86 SetInputFileHandle (FILE *f, bool transfer_ownership);
89 SetOutputFileHandle (FILE *f, bool transfer_ownership);
92 SetErrorFileHandle (FILE *f, bool transfer_ownership);
95 GetInputFileHandle ();
98 GetOutputFileHandle ();
101 GetErrorFileHandle ();
104 SaveInputTerminalState();
107 RestoreInputTerminalState();
109 lldb::SBCommandInterpreter
110 GetCommandInterpreter ();
113 HandleCommand (const char *command);
119 HandleProcessEvent (const lldb::SBProcess &process,
120 const lldb::SBEvent &event,
125 CreateTarget (const char *filename,
126 const char *target_triple,
127 const char *platform_name,
128 bool add_dependent_modules,
129 lldb::SBError& error);
132 CreateTargetWithFileAndTargetTriple (const char *filename,
133 const char *target_triple);
136 CreateTargetWithFileAndArch (const char *filename,
137 const char *archname);
140 CreateTarget (const char *filename);
142 // Return true if target is deleted from the target list of the debugger.
144 DeleteTarget (lldb::SBTarget &target);
147 GetTargetAtIndex (uint32_t idx);
150 GetIndexOfTarget (lldb::SBTarget target);
153 FindTargetWithProcessID (pid_t pid);
156 FindTargetWithFileAndArch (const char *filename,
163 GetSelectedTarget ();
166 SetSelectedTarget (SBTarget& target);
169 GetSelectedPlatform();
172 SetSelectedPlatform(lldb::SBPlatform &platform);
174 lldb::SBSourceManager
177 // REMOVE: just for a quick fix, need to expose platforms through
178 // SBPlatform from this class.
180 SetCurrentPlatform (const char *platform_name);
183 SetCurrentPlatformSDKRoot (const char *sysroot);
185 // FIXME: Once we get the set show stuff in place, the driver won't need
186 // an interface to the Set/Get UseExternalEditor.
188 SetUseExternalEditor (bool input);
191 GetUseExternalEditor ();
194 SetUseColor (bool use_color);
197 GetUseColor () const;
200 GetDefaultArchitecture (char *arch_name, size_t arch_name_len);
203 SetDefaultArchitecture (const char *arch_name);
206 GetScriptingLanguage (const char *script_language_name);
212 StateAsCString (lldb::StateType state);
215 StateIsRunningState (lldb::StateType state);
218 StateIsStoppedState (lldb::StateType state);
221 EnableLog (const char *channel, const char **categories);
224 SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton);
228 DispatchInput (void* baton,
233 DispatchInput (const void *data, size_t data_len);
236 DispatchInputInterrupt ();
239 DispatchInputEndOfFile ();
242 PushInputReader (lldb::SBInputReader &reader);
248 FindDebuggerWithID (int id);
251 SetInternalVariable (const char *var_name, const char *value, const char *debugger_instance_name);
253 static lldb::SBStringList
254 GetInternalVariableValue (const char *var_name, const char *debugger_instance_name);
257 GetDescription (lldb::SBStream &description);
260 GetTerminalWidth () const;
263 SetTerminalWidth (uint32_t term_width);
272 SetPrompt (const char *prompt);
275 GetScriptLanguage() const;
278 SetScriptLanguage (lldb::ScriptLanguage script_lang);
281 GetCloseInputOnEOF () const;
284 SetCloseInputOnEOF (bool b);
287 GetCategory (const char* category_name);
290 CreateCategory (const char* category_name);
293 DeleteCategory (const char* category_name);
299 GetCategoryAtIndex (uint32_t);
302 GetDefaultCategory();
305 GetFormatForType (SBTypeNameSpecifier);
307 #ifndef LLDB_DISABLE_PYTHON
309 GetSummaryForType (SBTypeNameSpecifier);
313 GetFilterForType (SBTypeNameSpecifier);
315 #ifndef LLDB_DISABLE_PYTHON
317 GetSyntheticForType (SBTypeNameSpecifier);
321 RunCommandInterpreter (bool auto_handle_events,
326 friend class SBCommandInterpreter;
327 friend class SBInputReader;
328 friend class SBListener;
329 friend class SBProcess;
330 friend class SBSourceManager;
331 friend class SBTarget;
334 FindTargetWithLLDBProcess (const lldb::ProcessSP &processSP);
337 reset (const lldb::DebuggerSP &debugger_sp);
339 lldb_private::Debugger *
342 lldb_private::Debugger &
345 const lldb::DebuggerSP &
348 lldb::DebuggerSP m_opaque_sp;
350 }; // class SBDebugger
355 #endif // LLDB_SBDebugger_h_