9#ifndef LLDB_API_SBDEBUGGER_H
10#define LLDB_API_SBDEBUGGER_H
37 char const *,
unsigned long),
39 char const *d,
bool e);
107 uint64_t &OUTPUT, uint64_t &OUTPUT,
111 uint64_t &progress_id,
112 uint64_t &completed, uint64_t &total,
113 bool &is_debugger_specific);
177 explicit operator
bool() const;
295 "Use HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, "
296 "SBFile) or HandleProcessEvent(const SBProcess &, const SBEvent &, "
298 "HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, SBFile)")
319 const char *platform_name,
324 const char *target_triple);
328 const char *archname);
451 bool EnableLog(
const char *channel,
const char **categories);
458 "AddDestroyCallback")
474 "DispatchInput(const void *, size_t)")
501 const char *debugger_instance_name);
506 const char *debugger_instance_name);
631 %apply
int& INOUT {
int& num_errors };
632 %apply
bool& INOUT {
bool& quit_requested };
633 %apply
bool& INOUT {
bool& stopped_for_crash };
635 void RunCommandInterpreter(
bool auto_handle_events,
bool spawn_thread,
636 SBCommandInterpreterRunOptions &options,
637 int &num_errors,
bool &quit_requested,
638 bool &stopped_for_crash);
643 RunCommandInterpreter(
const SBCommandInterpreterRunOptions &options);
663 const SBFileSpec &trace_description_file);
667 friend class lldb_private::python::SWIGBridge;
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_DEPRECATED_FIXME(MSG, FIX)
#define LLDB_DEPRECATED(MSG)
static lldb::SBError SetInternalVariable(const char *var_name, const char *value, const char *debugger_instance_name)
Set an internal variable.
bool DeleteCategory(const char *category_name)
Delete a type category.
lldb::LanguageType GetREPLLanguage() const
Get the current REPL language.
lldb::SBTarget GetTargetAtIndex(uint32_t idx)
Get a target by index.
lldb::SBTarget CreateTarget(const char *filename, const char *target_triple, const char *platform_name, bool add_dependent_modules, lldb::SBError &error)
Create a target with the specified parameters.
FLAGS_ANONYMOUS_ENUM()
Broadcast bit definitions for the SBDebugger.
SBTypeFilter GetFilterForType(SBTypeNameSpecifier type_name_spec)
Get the filter for a type.
bool DeleteTarget(lldb::SBTarget &target)
Delete a target from the debugger.
void SkipAppInitFiles(bool b)
Set whether to skip loading application-specific .lldbinit files.
lldb::SBDebugger & operator=(const lldb::SBDebugger &rhs)
Assignment operator.
static void Terminate()
Terminate LLDB and its subsystems.
lldb::SBPlatform GetPlatformAtIndex(uint32_t idx)
Get one of the currently active platforms.
void SkipLLDBInitFiles(bool b)
Set whether to skip loading .lldbinit files.
void SetAsync(bool b)
Set whether the debugger should run in asynchronous mode.
bool SetUseExternalEditor(bool input)
Set whether to use an external editor.
bool GetCloseInputOnEOF() const
Get whether to close input on EOF (deprecated).
static bool GetDefaultArchitecture(char *arch_name, size_t arch_name_len)
Get the default architecture.
static void MemoryPressureDetected()
Notify the debugger that system memory pressure has been detected.
void SetPrompt(const char *prompt)
Set the command prompt string.
bool GetDescription(lldb::SBStream &description)
Get a description of this debugger.
void DispatchInput(const void *data, size_t data_len)
Dispatch input to the debugger.
friend class SBStructuredData
bool GetUseExternalEditor()
Get whether an external editor is being used.
static void PrintStackTraceOnError()
Configure LLDB to print a stack trace when it crashes.
static lldb::SBDebugger Create()
Create a new debugger instance (deprecated).
void SetInputFileHandle(FILE *f, bool transfer_ownership)
Set the input file handle for the debugger.
void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread)
Run the command interpreter.
static const char * GetVersionString()
Get the LLDB version string.
lldb_private::Debugger & ref() const
lldb::SBStructuredData GetSetting(const char *setting=nullptr)
Get debugger settings as structured data.
const void size_t data_len
const char * GetReproducerPath() const
Get the path to the reproducer.
void SetOutputFileHandle(FILE *f, bool transfer_ownership)
Set the output file handle for the debugger.
static lldb::SBError InitializeWithErrorHandling()
Initialize the LLDB debugger subsystem with error handling.
void SetTerminalWidth(uint32_t term_width)
Set the terminal width.
SBTypeSummary GetSummaryForType(SBTypeNameSpecifier type_name_spec)
Get the summary for a type.
void HandleCommand(const char *command)
Execute a command in the command interpreter.
lldb::SBCommandInterpreter GetCommandInterpreter()
Get the command interpreter for this debugger.
SBFile GetInputFile()
Get the input file for the debugger.
const char * GetPrompt() const
Get the command prompt string.
friend class SBInputReader
LLDB_DEPRECATED_FIXME("Use DispatchInput(const void *, size_t)", "DispatchInput(const void *, size_t)") void DispatchInput(void *baton
Dispatch input to the debugger (deprecated).
bool SetUseColor(bool use_color)
Set whether to use color in output.
bool GetAsync()
Get whether the debugger is running in asynchronous mode.
const lldb::DebuggerSP & get_sp() const
static bool StateIsRunningState(lldb::StateType state)
Check if a state is a running state.
SBError SetErrorFile(SBFile file)
Set the error file for the debugger.
bool SetUseSourceCache(bool use_source_cache)
Set whether to use the source cache.
uint32_t GetNumCategories()
Get the number of type categories.
static lldb::SBStringList GetInternalVariableValue(const char *var_name, const char *debugger_instance_name)
Get the value of an internal variable.
void Clear()
Clear this debugger instance.
SBTypeFormat GetFormatForType(SBTypeNameSpecifier type_name_spec)
Get the format for a type.
bool GetUseColor() const
Get whether color is being used in output.
static bool SupportsLanguage(lldb::LanguageType language)
Check if a specific language is supported by LLDB.
lldb::SBListener GetListener()
Get the listener associated with this debugger.
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Set a callback for log output.
lldb::DebuggerSP m_opaque_sp
lldb::ScriptLanguage GetScriptLanguage() const
Get the current scripting language.
LLDB_DEPRECATED_FIXME("Use AddDestroyCallback and RemoveDestroyCallback", "AddDestroyCallback") void SetDestroyCallback(lldb lldb::callback_token_t AddDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback, void *baton)
Set a callback for when the debugger is destroyed (deprecated).
void SetScriptLanguage(lldb::ScriptLanguage script_lang)
Set the current scripting language.
uint32_t GetNumAvailablePlatforms()
Get the number of available platforms.
lldb::SBTarget FindTargetWithLLDBProcess(const lldb::ProcessSP &processSP)
SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier type_name_spec)
Get the synthetic for a type.
void DispatchClientTelemetry(const lldb::SBStructuredData &data)
Dispatch telemetry data from client to server.
SBTypeCategory GetCategoryAtIndex(uint32_t index)
Get a type category by index.
lldb::SBPlatform GetSelectedPlatform()
Get the selected platform.
static const char * GetBroadcasterClass()
Get the broadcaster class name.
lldb::SBTarget CreateTargetWithFileAndArch(const char *filename, const char *archname)
Create a target with the specified file and architecture.
void HandleProcessEvent(const lldb::SBProcess &process, const lldb::SBEvent &event, FileSP out, FileSP err)
Handle a process event using FileSP objects.
bool IsValid() const
Check if this is a valid SBDebugger object.
static void Initialize()
Initialize LLDB and its subsystems.
static bool StateIsStoppedState(lldb::StateType state)
Check if a state is a stopped state.
lldb::SBError SetCurrentPlatform(const char *platform_name)
Set the current platform by name.
lldb::SBSourceManager GetSourceManager()
Get the source manager for this debugger.
SBTypeCategory GetCategory(const char *category_name)
Get a type category by name.
void ResetStatistics()
Clear collected statistics for targets belonging to this debugger.
void SetREPLLanguage(lldb::LanguageType repl_lang)
Set the current REPL language.
SBStructuredData GetScriptInterpreterInfo(ScriptLanguage language)
Get information about a script interpreter as structured data.
static SBDebugger FindDebuggerWithID(int id)
Find a debugger by ID. Returns an invalid debugger if not found.
bool SetShowInlineDiagnostics(bool b)
Set whether to show inline diagnostics.
uint32_t GetNumPlatforms()
Get the number of currently active platforms.
void DispatchInputEndOfFile()
Signal end-of-file to the current input dispatch.
uint32_t GetTerminalWidth() const
Get the terminal width.
void SetTerminalHeight(uint32_t term_height)
Set the terminal height.
bool InterruptRequested()
Check if an interrupt has been requested.
lldb::SBTarget FindTargetWithFileAndArch(const char *filename, const char *arch)
Find a target with the specified file and architecture.
static lldb::SBStructuredData GetProgressDataFromEvent(const lldb::SBEvent &event)
Get progress data from an event.
static const char * StateAsCString(lldb::StateType state)
Convert a state type to a string.
void PushInputReader(lldb::SBInputReader &reader)
Push an input reader onto the IO handler stack.
static const char * GetProgressFromEvent(const lldb::SBEvent &event, uint64_t &progress_id, uint64_t &completed, uint64_t &total, bool &is_debugger_specific)
Get progress data from a SBEvent whose type is eBroadcastBitProgress.
lldb::SBTarget GetDummyTarget()
Get the dummy target.
bool EnableLog(const char *channel, const char **categories)
Enable logging for a specific channel and category.
static bool SetDefaultArchitecture(const char *arch_name)
Set the default architecture.
lldb_private::Debugger * get() const
void RestoreInputTerminalState()
Restore the previously saved terminal state.
SBFile GetOutputFile()
Get the output file for the debugger.
lldb::SBBroadcaster GetBroadcaster()
Get the broadcaster that allows subscribing to events from this debugger.
void SetSelectedTarget(SBTarget &target)
Set the selected target.
SBTypeCategory GetDefaultCategory()
Get the default type category.
bool GetUseSourceCache() const
Get whether the source cache is being used.
SBFile GetErrorFile()
Get the error file for the debugger.
uint32_t GetTerminalHeight() const
Get the terminal height.
LLDB_DEPRECATED_FIXME("Use HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, " "SBFile) or HandleProcessEvent(const SBProcess &, const SBEvent &, " "FileSP, FileSP)", "HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, SBFile)") void HandleProcessEvent(const lldb voi HandleProcessEvent)(const lldb::SBProcess &process, const lldb::SBEvent &event, SBFile out, SBFile err)
Handle a process event (deprecated).
lldb::SBStructuredData GetAvailablePlatformInfoAtIndex(uint32_t idx)
Get information about the available platform at the given index as structured data.
static SBStructuredData GetBuildConfiguration()
Get the build configuration as structured data.
SBTypeCategory CreateCategory(const char *category_name)
Create a new type category.
bool SetCurrentPlatformSDKRoot(const char *sysroot)
Set the SDK root for the current platform.
void SetErrorFileHandle(FILE *f, bool transfer_ownership)
Set the error file handle for the debugger.
void CancelInterruptRequest()
Cancel a previously requested interrupt.
uint32_t GetNumTargets()
Get the number of targets in the debugger.
FILE * GetInputFileHandle()
Get the input file handle for the debugger.
SBError SetInputFile(SBFile file)
Set the input file for the debugger.
void DispatchInputInterrupt()
Interrupt the current input dispatch.
SBError SetInputString(const char *data)
Set the input from a string.
uint32_t GetIndexOfTarget(lldb::SBTarget target)
Get the index of a target.
SBError SetOutputFile(SBFile file)
Set the output file for the debugger.
lldb::SBTarget GetSelectedTarget()
Get the currently selected target.
void SaveInputTerminalState()
Save the current terminal state.
FILE * GetErrorFileHandle()
Get the error file handle for the debugger.
void SetSelectedPlatform(lldb::SBPlatform &platform)
Set the selected platform.
friend class SBSourceManager
void reset(const lldb::DebuggerSP &debugger_sp)
FILE * GetOutputFileHandle()
Get the output file handle for the debugger.
const char * GetInstanceName()
Get the instance name of this debugger.
lldb::SBTarget FindTargetWithProcessID(lldb::pid_t pid)
Find a target with the specified process ID.
static void PrintDiagnosticsOnError()
Configure LLDB to print diagnostic information when it crashes.
void SetCloseInputOnEOF(bool b)
Set whether to close input on EOF (deprecated).
friend class SBCommandInterpreter
lldb::user_id_t GetID()
Get the unique ID of this debugger.
lldb::SBTarget CreateTargetWithFileAndTargetTriple(const char *filename, const char *target_triple)
Create a target with the specified file and target triple.
SBDebugger()
Default constructor creates an invalid SBDebugger instance.
bool RemoveDestroyCallback(lldb::callback_token_t token)
Remove a destroy callback.
static lldb::SBStructuredData GetDiagnosticFromEvent(const lldb::SBEvent &event)
Get diagnostic information from an event.
lldb::ScriptLanguage GetScriptingLanguage(const char *script_language_name)
Get the scripting language by name.
static void Destroy(lldb::SBDebugger &debugger)
Destroy a debugger instance.
void RequestInterrupt()
Request an interrupt of the current operation.
A class to manage flag bits.
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
@ eBroadcastBitProgressCategory
Deprecated.
@ eBroadcastBitExternalProgress
@ eBroadcastBitExternalProgressCategory
Deprecated.
StateType
Process and Thread States.
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
void(* SBDebuggerDestroyCallback)(lldb::user_id_t debugger_id, void *baton)
void(* LogOutputCallback)(const char *, void *baton)
std::shared_ptr< lldb_private::File > FileSP
class LLDB_API SBCommandInterpreterRunResult
InputReaderGranularity
Token size/granularities for Input Readers.