LLDB mainline
lldb_private::Debugger Class Reference

A class to manage flag bits. More...

#include "lldb/Core/Debugger.h"

Inheritance diagram for lldb_private::Debugger:
[legend]

Classes

struct  DestroyCallbackInfo
class  InterruptionReport
struct  ProgressReport

Public Types

using DebuggerList = std::vector<lldb::DebuggerSP>

Public Member Functions

BroadcasterGetBroadcaster ()
 Get the public broadcaster for this debugger.
const BroadcasterGetBroadcaster () const
 ~Debugger () override
void Clear ()
void DispatchClientTelemetry (const lldb_private::StructuredDataImpl &entry)
bool GetAsyncExecution ()
void SetAsyncExecution (bool async)
lldb::FileSP GetInputFileSP ()
FileGetInputFile ()
lldb::FileSP GetOutputFileSP ()
lldb::FileSP GetErrorFileSP ()
Status SetInputString (const char *data)
void SetInputFile (lldb::FileSP file)
void SetOutputFile (lldb::FileSP file)
void SetErrorFile (lldb::FileSP file)
void SaveInputTerminalState ()
void RestoreInputTerminalState ()
lldb::StreamUP GetAsyncOutputStream ()
lldb::StreamUP GetAsyncErrorStream ()
CommandInterpreterGetCommandInterpreter ()
ScriptInterpreterGetScriptInterpreter (bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
lldb::ListenerSP GetListener ()
SourceManagerGetSourceManager ()
lldb::TargetSP GetSelectedTarget ()
ExecutionContext GetSelectedExecutionContext ()
TargetListGetTargetList ()
 Get accessor for the target list.
PlatformListGetPlatformList ()
void DispatchInputInterrupt ()
void DispatchInputEndOfFile ()
void AdoptTopIOHandlerFilesIfInvalid (lldb::FileSP &in, lldb::LockableStreamFileSP &out, lldb::LockableStreamFileSP &err)
void RunIOHandlerAsync (const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
 Run the given IO handler and return immediately.
void RunIOHandlerSync (const lldb::IOHandlerSP &reader_sp)
 Run the given IO handler and block until it's complete.
bool RemoveIOHandler (const lldb::IOHandlerSP &reader_sp)
 Remove the given IO handler if it's currently active.
bool IsTopIOHandler (const lldb::IOHandlerSP &reader_sp)
bool CheckTopIOHandlerTypes (IOHandler::Type top_type, IOHandler::Type second_top_type)
void PrintAsync (const char *s, size_t len, bool is_stdout)
llvm::StringRef GetTopIOHandlerControlSequence (char ch)
const char * GetIOHandlerCommandPrefix ()
const char * GetIOHandlerHelpPrologue ()
void RefreshIOHandler ()
void ClearIOHandlers ()
bool EnableLog (llvm::StringRef channel, llvm::ArrayRef< const char * > categories, llvm::StringRef log_file, uint32_t log_options, size_t buffer_size, LogHandlerKind log_handler_kind, llvm::raw_ostream &error_stream)
void SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton)
Status SetPropertyValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value) override
bool GetAutoConfirm () const
FormatEntity::Entry GetDisassemblyFormat () const
FormatEntity::Entry GetFrameFormat () const
FormatEntity::Entry GetFrameFormatUnique () const
uint64_t GetStopDisassemblyMaxSize () const
FormatEntity::Entry GetThreadFormat () const
FormatEntity::Entry GetThreadStopFormat () const
lldb::ScriptLanguage GetScriptLanguage () const
bool SetScriptLanguage (lldb::ScriptLanguage script_lang)
lldb::LanguageType GetREPLLanguage () const
bool SetREPLLanguage (lldb::LanguageType repl_lang)
uint64_t GetTerminalWidth () const
bool SetTerminalWidth (uint64_t term_width)
uint64_t GetTerminalHeight () const
bool SetTerminalHeight (uint64_t term_height)
llvm::StringRef GetPrompt () const
llvm::StringRef GetPromptAnsiPrefix () const
llvm::StringRef GetPromptAnsiSuffix () const
void SetPrompt (llvm::StringRef p)
void SetPrompt (const char *)=delete
bool GetUseExternalEditor () const
bool SetUseExternalEditor (bool use_external_editor_p)
llvm::StringRef GetExternalEditor () const
bool SetExternalEditor (llvm::StringRef editor)
bool GetUseColor () const
bool SetUseColor (bool use_color)
bool GetShowProgress () const
bool SetShowProgress (bool show_progress)
bool GetShowStatusline () const
FormatEntity::Entry GetStatuslineFormat () const
bool SetStatuslineFormat (const FormatEntity::Entry &format)
llvm::StringRef GetSeparator () const
bool SetSeparator (llvm::StringRef s)
llvm::StringRef GetShowProgressAnsiPrefix () const
llvm::StringRef GetShowProgressAnsiSuffix () const
llvm::StringRef GetDisabledAnsiPrefix () const
llvm::StringRef GetDisabledAnsiSuffix () const
bool GetUseAutosuggestion () const
llvm::StringRef GetAutosuggestionAnsiPrefix () const
llvm::StringRef GetAutosuggestionAnsiSuffix () const
llvm::StringRef GetRegexMatchAnsiPrefix () const
llvm::StringRef GetRegexMatchAnsiSuffix () const
bool GetShowDontUsePoHint () const
bool GetUseSourceCache () const
bool SetUseSourceCache (bool use_source_cache)
bool GetHighlightSource () const
lldb::StopShowColumn GetStopShowColumn () const
llvm::StringRef GetStopShowColumnAnsiPrefix () const
llvm::StringRef GetStopShowColumnAnsiSuffix () const
uint64_t GetStopSourceLineCount (bool before) const
lldb::StopDisassemblyType GetStopDisassemblyDisplay () const
uint64_t GetDisassemblyLineCount () const
llvm::StringRef GetStopShowLineMarkerAnsiPrefix () const
llvm::StringRef GetStopShowLineMarkerAnsiSuffix () const
bool GetAutoOneLineSummaries () const
bool GetAutoIndent () const
bool SetAutoIndent (bool b)
bool GetPrintDecls () const
bool SetPrintDecls (bool b)
uint64_t GetTabSize () const
bool SetTabSize (uint64_t tab_size)
lldb::DWIMPrintVerbosity GetDWIMPrintVerbosity () const
bool GetEscapeNonPrintables () const
bool GetNotifyVoid () const
const std::string & GetInstanceName () const
bool GetShowInlineDiagnostics () const
bool SetShowInlineDiagnostics (bool)
bool LoadPlugin (const FileSpec &spec, Status &error)
void RunIOHandlers ()
bool IsForwardingEvents ()
void EnableForwardEvents (const lldb::ListenerSP &listener_sp)
void CancelForwardEvents (const lldb::ListenerSP &listener_sp)
bool IsHandlingEvents () const
Status RunREPL (lldb::LanguageType language, const char *repl_options)
void RequestInterrupt ()
 Interruption in LLDB:
void CancelInterruptRequest ()
 Decrement the "interrupt requested" counter.
void RedrawStatusline (bool update=true)
 Redraw the statusline if enabled.
template<typename... Args>
bool InterruptRequested (const char *cur_func, const char *formatv, Args &&...args)
 This is the correct way to query the state of Interruption.
bool InterruptRequested ()
void ReportInterruption (const InterruptionReport &report)
TargetGetSelectedOrDummyTarget (bool prefer_dummy=false)
TargetGetDummyTarget ()
lldb::BroadcasterManagerSP GetBroadcasterManager ()
void SetDestroyCallback (lldb_private::DebuggerDestroyCallback destroy_callback, void *baton)
 DEPRECATED: We used to only support one Destroy callback.
lldb::callback_token_t AddDestroyCallback (lldb_private::DebuggerDestroyCallback destroy_callback, void *baton)
 Add a callback for when the debugger is destroyed.
bool RemoveDestroyCallback (lldb::callback_token_t token)
 Remove the specified callback. Return true if successful.
bool StartEventHandlerThread ()
 Manually start the global event handler thread.
void StopEventHandlerThread ()
 Manually stop the debugger's default event handler.
void FlushProcessOutput (Process &process, bool flush_stdout, bool flush_stderr)
 Force flushing the process's pending stdout and stderr to the debugger's asynchronous stdout and stderr streams.
SourceManager::SourceFileCacheGetSourceFileCache ()
std::optional< ProgressReportGetCurrentProgressReport () const
Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID.
 ~UserID ()=default
 Destructor.
void Clear ()
 Clears the object state.
lldb::user_id_t GetID () const
 Get accessor for the user ID.
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.
Public Member Functions inherited from lldb_private::Properties
 Properties ()
 Properties (const lldb::OptionValuePropertiesSP &collection_sp)
virtual ~Properties ()
lldb::OptionValuePropertiesSP GetValueProperties () const
virtual lldb::OptionValueSP GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, Status &error) const
virtual Status DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, llvm::StringRef property_path, uint32_t dump_mask, bool is_json=false)
virtual void DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask, bool is_json=false)
virtual void DumpAllDescriptions (CommandInterpreter &interpreter, Stream &strm) const
size_t Apropos (llvm::StringRef keyword, std::vector< const Property * > &matching_properties) const
template<typename T>
GetPropertyAtIndexAs (uint32_t idx, T default_value, const ExecutionContext *exe_ctx=nullptr) const
template<typename T, typename U = typename std::remove_pointer<T>::type, std::enable_if_t< std::is_pointer_v< T >, bool > = true>
const U * GetPropertyAtIndexAs (uint32_t idx, const ExecutionContext *exe_ctx=nullptr) const
template<typename T>
bool SetPropertyAtIndex (uint32_t idx, T t, const ExecutionContext *exe_ctx=nullptr) const

Static Public Member Functions

static llvm::StringRef GetStaticBroadcasterClass ()
static lldb::DebuggerSP CreateInstance (lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
static lldb::TargetSP FindTargetWithProcessID (lldb::pid_t pid)
static lldb::TargetSP FindTargetWithProcess (Process *process)
static void Initialize (LoadPluginCallbackType load_plugin_callback)
static void Terminate ()
static void SettingsInitialize ()
static void SettingsTerminate ()
static void Destroy (lldb::DebuggerSP &debugger_sp)
static lldb::DebuggerSP FindDebuggerWithID (lldb::user_id_t id)
static lldb::DebuggerSP FindDebuggerWithInstanceName (llvm::StringRef instance_name)
static size_t GetNumDebuggers ()
static lldb::DebuggerSP GetDebuggerAtIndex (size_t index)
static bool FormatDisassemblerAddress (const FormatEntity::Entry *format, const SymbolContext *sc, const SymbolContext *prev_sc, const ExecutionContext *exe_ctx, const Address *addr, Stream &s)
static void AssertCallback (llvm::StringRef message, llvm::StringRef backtrace, llvm::StringRef prompt)
static DebuggerList DebuggersRequestingInterruption ()
static llvm::ThreadPoolInterface & GetThreadPool ()
 Shared thread pool. Use only with ThreadPoolTaskGroup.
static void ReportWarning (std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *once=nullptr)
 Report warning events.
static void ReportError (std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *once=nullptr)
 Report error events.
static void ReportInfo (std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *once=nullptr)
 Report info events.
static void ReportSymbolChange (const ModuleSpec &module_spec)
Static Public Member Functions inherited from lldb_private::Properties
static llvm::StringRef GetExperimentalSettingsName ()
static bool IsSettingExperimental (llvm::StringRef setting)

Protected Types

enum  { eBroadcastBitEventThreadIsListening = (1 << 0) }
typedef std::vector< llvm::sys::DynamicLibrary > LoadedPluginsList

Protected Member Functions

void HandleDestroyCallback ()
void PrintProgress (const ProgressEventData &data)
bool StatuslineSupported ()
void PushIOHandler (const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler=true)
bool PopIOHandler (const lldb::IOHandlerSP &reader_sp)
bool HasIOHandlerThread () const
bool StartIOHandlerThread ()
void StopIOHandlerThread ()
HostThread SetIOHandlerThread (HostThread &new_thread)
void JoinIOHandlerThread ()
bool IsIOHandlerThreadCurrentThread () const
lldb::thread_result_t IOHandlerThread ()
lldb::thread_result_t DefaultEventHandler ()
void HandleBreakpointEvent (const lldb::EventSP &event_sp)
void HandleProcessEvent (const lldb::EventSP &event_sp)
void HandleThreadEvent (const lldb::EventSP &event_sp)
void HandleProgressEvent (const lldb::EventSP &event_sp)
void HandleDiagnosticEvent (const lldb::EventSP &event_sp)
void InstanceInitialize ()
lldb::LockableStreamFileSP GetOutputStreamSP ()
 Except for Debugger and IOHandler, GetOutputStreamSP and GetErrorStreamSP should not be used directly.
lldb::LockableStreamFileSP GetErrorStreamSP ()

Static Protected Member Functions

static void ReportProgress (uint64_t progress_id, std::string title, std::string details, uint64_t completed, uint64_t total, std::optional< lldb::user_id_t > debugger_id, uint32_t progress_category_bit=lldb::eBroadcastBitProgress)
 Report progress events.
static void ReportDiagnosticImpl (lldb::Severity severity, std::string message, std::optional< lldb::user_id_t > debugger_id, std::once_flag *once)

Protected Attributes

std::mutex m_output_flush_mutex
lldb::FileSP m_input_file_sp
lldb::LockableStreamFileSP m_output_stream_sp
lldb::LockableStreamFileSP m_error_stream_sp
LockableStreamFile::Mutex m_output_mutex
lldb::BroadcasterManagerSP m_broadcaster_manager_sp
TerminalState m_terminal_state
TargetList m_target_list
PlatformList m_platform_list
lldb::ListenerSP m_listener_sp
std::unique_ptr< SourceManagerm_source_manager_up
SourceManager::SourceFileCache m_source_file_cache
std::unique_ptr< CommandInterpreterm_command_interpreter_up
std::recursive_mutex m_script_interpreter_mutex
std::array< lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknownm_script_interpreters
IOHandlerStack m_io_handler_stack
std::recursive_mutex m_io_handler_synchronous_mutex
std::mutex m_statusline_mutex
 Mutex protecting the m_statusline member.
std::optional< Statuslinem_statusline
llvm::StringMap< std::weak_ptr< LogHandler > > m_stream_handlers
std::shared_ptr< CallbackLogHandlerm_callback_handler_sp
const std::string m_instance_name
LoadedPluginsList m_loaded_plugins
HostThread m_event_handler_thread
HostThread m_io_handler_thread
Broadcaster m_sync_broadcaster
 Private debugger synchronization.
Broadcaster m_broadcaster
 Public Debugger event broadcaster.
lldb::ListenerSP m_forward_listener_sp
llvm::once_flag m_clear_once
lldb::TargetSP m_dummy_target_sp
Diagnostics::CallbackID m_diagnostics_callback_id
std::mutex m_destroy_callback_mutex
lldb::callback_token_t m_destroy_callback_next_token = 0
llvm::SmallVector< DestroyCallbackInfo, 2 > m_destroy_callbacks
uint32_t m_interrupt_requested = 0
 Tracks interrupt requests.
std::mutex m_interrupt_mutex
llvm::SmallVector< ProgressReport, 4 > m_progress_reports
 Bookkeeping for command line progress events.
std::mutex m_progress_reports_mutex
Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.
Protected Attributes inherited from lldb_private::Properties
lldb::OptionValuePropertiesSP m_collection_sp

Static Protected Attributes

static LoadPluginCallbackType g_load_plugin_callback = nullptr

Private Member Functions

 Debugger (lldb::LogOutputCallback m_log_callback, void *baton)
 Debugger (const Debugger &)=delete
const Debuggeroperator= (const Debugger &)=delete

Friends

class CommandInterpreter
class REPL
class Progress
class ProgressManager
class Statusline

Detailed Description

A class to manage flag bits.

Provides a global root objects for the debugger core.

Definition at line 78 of file Debugger.h.

Member Typedef Documentation

◆ DebuggerList

Definition at line 82 of file Debugger.h.

◆ LoadedPluginsList

typedef std::vector<llvm::sys::DynamicLibrary> lldb_private::Debugger::LoadedPluginsList
protected

Definition at line 760 of file Debugger.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
eBroadcastBitEventThreadIsListening 

Definition at line 795 of file Debugger.h.

Constructor & Destructor Documentation

◆ ~Debugger()

Debugger::~Debugger ( )
override

Definition at line 1072 of file Debugger.cpp.

References Clear().

◆ Debugger() [1/2]

Debugger::Debugger ( lldb::LogOutputCallback m_log_callback,
void * baton )
private

Definition at line 963 of file Debugger.cpp.

References lldb_private::Diagnostics::AddCallback(), CommandInterpreter, lldb_private::FileSpec::CopyByAppendingPathComponent(), lldb_private::Diagnostics::Enabled(), g_unique_id, lldb_private::Target::GetDefaultArchitecture(), lldb_private::Language::GetGlobalLanguageProperties(), lldb_private::ModuleList::GetGlobalModuleListProperties(), lldb_private::Platform::GetGlobalPlatformProperties(), lldb_private::Target::GetGlobalProperties(), lldb_private::Platform::GetHostPlatform(), lldb_private::UserID::GetID(), GetOutputFileSP(), lldb_private::FileSpec::GetPath(), lldb_private::LanguageProperties::GetSettingName(), GetStaticBroadcasterClass(), lldb_private::Properties::GetValueProperties(), lldb_private::Diagnostics::Instance(), lldb_private::ArchSpec::IsValid(), m_broadcaster, m_broadcaster_manager_sp, m_callback_handler_sp, m_clear_once, lldb_private::Properties::m_collection_sp, m_command_interpreter_up, m_diagnostics_callback_id, m_dummy_target_sp, m_error_stream_sp, m_event_handler_thread, m_forward_listener_sp, m_input_file_sp, m_instance_name, m_io_handler_stack, m_io_handler_thread, m_listener_sp, m_loaded_plugins, m_output_mutex, m_output_stream_sp, m_platform_list, m_source_file_cache, m_source_manager_up, m_stream_handlers, m_sync_broadcaster, m_target_list, m_terminal_state, lldb_private::Properties::Properties(), lldb_private::OptionValueUInt64::SetMinimumValue(), SetSeparator(), SetUseColor(), lldb_private::Target, and lldb_private::UserID::UserID().

Referenced by CreateInstance(), Debugger(), and operator=().

◆ Debugger() [2/2]

lldb_private::Debugger::Debugger ( const Debugger & )
privatedelete

References Debugger().

Member Function Documentation

◆ AddDestroyCallback()

lldb::callback_token_t Debugger::AddDestroyCallback ( lldb_private::DebuggerDestroyCallback destroy_callback,
void * baton )

Add a callback for when the debugger is destroyed.

Return a token, which can be used to remove said callback. Multiple callbacks can be added by calling this function multiple times, and will be invoked in FIFO order.

Definition at line 1621 of file Debugger.cpp.

References m_destroy_callback_mutex, m_destroy_callback_next_token, and m_destroy_callbacks.

◆ AdoptTopIOHandlerFilesIfInvalid()

◆ AssertCallback()

void Debugger::AssertCallback ( llvm::StringRef message,
llvm::StringRef backtrace,
llvm::StringRef prompt )
static

◆ CancelForwardEvents()

void Debugger::CancelForwardEvents ( const lldb::ListenerSP & listener_sp)

Definition at line 2052 of file Debugger.cpp.

References m_forward_listener_sp.

◆ CancelInterruptRequest()

void Debugger::CancelInterruptRequest ( )

Decrement the "interrupt requested" counter.

Definition at line 1470 of file Debugger.cpp.

References m_interrupt_mutex, and m_interrupt_requested.

◆ CheckTopIOHandlerTypes()

bool Debugger::CheckTopIOHandlerTypes ( IOHandler::Type top_type,
IOHandler::Type second_top_type )

Definition at line 1314 of file Debugger.cpp.

References m_io_handler_stack.

Referenced by lldb_private::REPL::IOHandlerInputComplete().

◆ Clear()

◆ ClearIOHandlers()

void Debugger::ClearIOHandlers ( )

Definition at line 1243 of file Debugger.cpp.

References m_io_handler_stack, and PopIOHandler().

Referenced by Clear(), and RunIOHandlers().

◆ CreateInstance()

DebuggerSP Debugger::CreateInstance ( lldb::LogOutputCallback log_callback = nullptr,
void * baton = nullptr )
static

◆ DebuggersRequestingInterruption()

Debugger::DebuggerList Debugger::DebuggersRequestingInterruption ( )
static

◆ DefaultEventHandler()

lldb::thread_result_t Debugger::DefaultEventHandler ( )
protected

Definition at line 2071 of file Debugger.cpp.

References CommandInterpreter, lldb_private::CommandInterpreter::eBroadcastBitAsynchronousErrorData, lldb_private::CommandInterpreter::eBroadcastBitAsynchronousOutputData, lldb_private::Target::eBroadcastBitBreakpointChanged, lldb::eBroadcastBitError, eBroadcastBitEventThreadIsListening, lldb::eBroadcastBitExternalProgress, lldb::eBroadcastBitProgress, lldb_private::CommandInterpreter::eBroadcastBitQuitCommandReceived, lldb_private::Thread::eBroadcastBitStackChanged, lldb_private::Process::eBroadcastBitStateChanged, lldb_private::Process::eBroadcastBitSTDERR, lldb_private::Process::eBroadcastBitSTDOUT, lldb_private::Process::eBroadcastBitStructuredData, lldb_private::Thread::eBroadcastBitThreadSelected, lldb::eBroadcastBitWarning, lldb::eBroadcastSymbolChange, GetAsyncErrorStream(), GetAsyncOutputStream(), lldb_private::Broadcaster::GetBroadcasterClass(), lldb_private::EventDataBytes::GetBytesFromEvent(), lldb_private::Breakpoint::BreakpointEventData::GetEventDataFromEvent(), GetListener(), lldb_private::Process::GetStaticBroadcasterClass(), lldb_private::Target::GetStaticBroadcasterClass(), lldb_private::Thread::GetStaticBroadcasterClass(), HandleBreakpointEvent(), HandleDiagnosticEvent(), HandleProcessEvent(), HandleProgressEvent(), HandleThreadEvent(), m_broadcaster, m_broadcaster_manager_sp, m_command_interpreter_up, m_forward_listener_sp, m_statusline, m_statusline_mutex, m_sync_broadcaster, RedrawStatusline(), and StatuslineSupported().

Referenced by StartEventHandlerThread().

◆ Destroy()

◆ DispatchClientTelemetry()

◆ DispatchInputEndOfFile()

void Debugger::DispatchInputEndOfFile ( )

Definition at line 1236 of file Debugger.cpp.

References m_io_handler_stack.

◆ DispatchInputInterrupt()

void Debugger::DispatchInputInterrupt ( )

Definition at line 1229 of file Debugger.cpp.

References m_io_handler_stack.

◆ EnableForwardEvents()

void Debugger::EnableForwardEvents ( const lldb::ListenerSP & listener_sp)

Definition at line 2048 of file Debugger.cpp.

References m_forward_listener_sp.

◆ EnableLog()

◆ FindDebuggerWithID()

◆ FindDebuggerWithInstanceName()

DebuggerSP Debugger::FindDebuggerWithInstanceName ( llvm::StringRef instance_name)
static

◆ FindTargetWithProcess()

TargetSP Debugger::FindTargetWithProcess ( Process * process)
static

Definition at line 944 of file Debugger.cpp.

References g_debugger_list_mutex_ptr, and g_debugger_list_ptr.

◆ FindTargetWithProcessID()

TargetSP Debugger::FindTargetWithProcessID ( lldb::pid_t pid)
static

◆ FlushProcessOutput()

void Debugger::FlushProcessOutput ( Process & process,
bool flush_stdout,
bool flush_stderr )

Force flushing the process's pending stdout and stderr to the debugger's asynchronous stdout and stderr streams.

Definition at line 1924 of file Debugger.cpp.

References error(), lldb_private::Stream::Flush(), GetAsyncErrorStream(), GetAsyncOutputStream(), lldb_private::Process::GetSTDERR(), lldb_private::Process::GetSTDOUT(), m_output_flush_mutex, and lldb_private::Stream::Write().

Referenced by HandleProcessEvent().

◆ FormatDisassemblerAddress()

◆ GetAsyncErrorStream()

◆ GetAsyncExecution()

◆ GetAsyncOutputStream()

◆ GetAutoConfirm()

bool Debugger::GetAutoConfirm ( ) const

Definition at line 292 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetAutoIndent()

bool Debugger::GetAutoIndent ( ) const

◆ GetAutoOneLineSummaries()

bool Debugger::GetAutoOneLineSummaries ( ) const

Definition at line 640 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetAutosuggestionAnsiPrefix()

llvm::StringRef Debugger::GetAutosuggestionAnsiPrefix ( ) const

◆ GetAutosuggestionAnsiSuffix()

llvm::StringRef Debugger::GetAutosuggestionAnsiSuffix ( ) const

◆ GetBroadcaster() [1/2]

Broadcaster & lldb_private::Debugger::GetBroadcaster ( )
inline

Get the public broadcaster for this debugger.

Definition at line 87 of file Debugger.h.

References m_broadcaster.

Referenced by PrivateReportDiagnostic(), and PrivateReportProgress().

◆ GetBroadcaster() [2/2]

const Broadcaster & lldb_private::Debugger::GetBroadcaster ( ) const
inline

Definition at line 88 of file Debugger.h.

References m_broadcaster.

◆ GetBroadcasterManager()

lldb::BroadcasterManagerSP lldb_private::Debugger::GetBroadcasterManager ( )
inline

◆ GetCommandInterpreter()

◆ GetCurrentProgressReport()

std::optional< Debugger::ProgressReport > Debugger::GetCurrentProgressReport ( ) const

Definition at line 2267 of file Debugger.cpp.

References m_progress_reports, and m_progress_reports_mutex.

◆ GetDebuggerAtIndex()

◆ GetDisabledAnsiPrefix()

llvm::StringRef Debugger::GetDisabledAnsiPrefix ( ) const

Definition at line 514 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetDisabledAnsiSuffix()

llvm::StringRef Debugger::GetDisabledAnsiSuffix ( ) const

Definition at line 520 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetDisassemblyFormat()

◆ GetDisassemblyLineCount()

uint64_t Debugger::GetDisassemblyLineCount ( ) const

◆ GetDummyTarget()

Target & lldb_private::Debugger::GetDummyTarget ( )
inline

◆ GetDWIMPrintVerbosity()

lldb::DWIMPrintVerbosity Debugger::GetDWIMPrintVerbosity ( ) const

◆ GetErrorFileSP()

lldb::FileSP lldb_private::Debugger::GetErrorFileSP ( )
inline

◆ GetErrorStreamSP()

lldb::LockableStreamFileSP lldb_private::Debugger::GetErrorStreamSP ( )
inlineprotected

Definition at line 674 of file Debugger.h.

References m_error_stream_sp.

Referenced by AdoptTopIOHandlerFilesIfInvalid().

◆ GetEscapeNonPrintables()

bool Debugger::GetEscapeNonPrintables ( ) const

Definition at line 646 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetExternalEditor()

llvm::StringRef Debugger::GetExternalEditor ( ) const

◆ GetFrameFormat()

FormatEntity::Entry Debugger::GetFrameFormat ( ) const

◆ GetFrameFormatUnique()

FormatEntity::Entry Debugger::GetFrameFormatUnique ( ) const

◆ GetHighlightSource()

bool Debugger::GetHighlightSource ( ) const

Definition at line 583 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetInputFile()

File & lldb_private::Debugger::GetInputFile ( )
inline

Definition at line 137 of file Debugger.h.

References m_input_file_sp.

Referenced by Clear(), SaveInputTerminalState(), and StopIOHandlerThread().

◆ GetInputFileSP()

◆ GetInstanceName()

const std::string & lldb_private::Debugger::GetInstanceName ( ) const
inline

◆ GetIOHandlerCommandPrefix()

const char * Debugger::GetIOHandlerCommandPrefix ( )

Definition at line 1333 of file Debugger.cpp.

References m_io_handler_stack.

Referenced by lldb_private::CommandInterpreter::GetCommandPrefix().

◆ GetIOHandlerHelpPrologue()

const char * Debugger::GetIOHandlerHelpPrologue ( )

Definition at line 1337 of file Debugger.cpp.

References m_io_handler_stack.

◆ GetListener()

◆ GetNotifyVoid()

bool Debugger::GetNotifyVoid ( ) const

◆ GetNumDebuggers()

◆ GetOutputFileSP()

◆ GetOutputStreamSP()

lldb::LockableStreamFileSP lldb_private::Debugger::GetOutputStreamSP ( )
inlineprotected

Except for Debugger and IOHandler, GetOutputStreamSP and GetErrorStreamSP should not be used directly.

Use GetAsyncOutputStream and GetAsyncErrorStream instead.

Definition at line 673 of file Debugger.h.

References m_output_stream_sp.

Referenced by AdoptTopIOHandlerFilesIfInvalid(), and StatuslineSupported().

◆ GetPlatformList()

◆ GetPrintDecls()

bool Debugger::GetPrintDecls ( ) const

◆ GetPrompt()

llvm::StringRef Debugger::GetPrompt ( ) const

◆ GetPromptAnsiPrefix()

llvm::StringRef Debugger::GetPromptAnsiPrefix ( ) const

Definition at line 331 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetPromptAnsiSuffix()

llvm::StringRef Debugger::GetPromptAnsiSuffix ( ) const

Definition at line 337 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetRegexMatchAnsiPrefix()

llvm::StringRef Debugger::GetRegexMatchAnsiPrefix ( ) const

Definition at line 551 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

Referenced by LookupSymbolInModule().

◆ GetRegexMatchAnsiSuffix()

llvm::StringRef Debugger::GetRegexMatchAnsiSuffix ( ) const

Definition at line 557 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

Referenced by LookupSymbolInModule().

◆ GetREPLLanguage()

lldb::LanguageType Debugger::GetREPLLanguage ( ) const

Definition at line 376 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

Referenced by RunREPL().

◆ GetScriptInterpreter()

ScriptInterpreter * Debugger::GetScriptInterpreter ( bool can_create = true,
std::optional< lldb::ScriptLanguage > language = {} )

Definition at line 1855 of file Debugger.cpp.

References lldb_private::PluginManager::GetScriptInterpreterForLanguage(), GetScriptLanguage(), m_script_interpreter_mutex, and m_script_interpreters.

Referenced by lldb_private::ScriptInterpreterLua::BreakpointCallbackFunction(), CommandObjectScriptingObjectParsed::CommandObjectScriptingObjectParsed(), lldb_private::BreakpointOptions::CreateFromStructuredData(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectFrameRecognizerAdd::DoExecute(), CommandObjectPythonFunction::DoExecute(), CommandObjectScriptingObjectParsed::DoExecute(), CommandObjectScriptingObjectRaw::DoExecute(), CommandObjectScriptingRun::DoExecute(), CommandObjectScriptingObjectParsed::GetHelp(), CommandObjectScriptingObjectRaw::GetHelp(), CommandObjectPythonFunction::GetHelpLong(), CommandObjectScriptingObjectParsed::GetHelpLong(), CommandObjectScriptingObjectRaw::GetHelpLong(), CommandObjectScriptingObjectParsed::GetRepeatCommand(), CommandObjectScriptingObjectRaw::GetRepeatCommand(), CommandObjectScriptingObjectParsed::HandleArgumentCompletion(), CommandObjectScriptingObjectParsed::CommandOptions::HandleOptionArgumentCompletion(), CommandObjectCommandsScriptAdd::IOHandlerInputComplete(), CommandObjectTypeSummaryAdd::IOHandlerInputComplete(), CommandObjectTypeSynthAdd::IOHandlerInputComplete(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), CommandObjectTypeFilterAdd::CommandOptions::OptionParsingStarting(), lldb_private::process_gdb_remote::ProcessGDBRemote::ParsePythonTargetDefinition(), RunScriptFormatKeyword(), and lldb_private::ScriptInterpreterLua::WatchpointCallbackFunction().

◆ GetScriptLanguage()

◆ GetSelectedExecutionContext()

ExecutionContext Debugger::GetSelectedExecutionContext ( )

Definition at line 1223 of file Debugger.cpp.

References GetSelectedTarget().

◆ GetSelectedOrDummyTarget()

Target & Debugger::GetSelectedOrDummyTarget ( bool prefer_dummy = false)

Definition at line 2328 of file Debugger.cpp.

References GetDummyTarget(), and m_target_list.

◆ GetSelectedTarget()

◆ GetSeparator()

llvm::StringRef Debugger::GetSeparator ( ) const

Definition at line 508 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetShowDontUsePoHint()

bool Debugger::GetShowDontUsePoHint ( ) const

Definition at line 563 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetShowInlineDiagnostics()

bool Debugger::GetShowInlineDiagnostics ( ) const

◆ GetShowProgress()

bool Debugger::GetShowProgress ( ) const

Definition at line 467 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetShowProgressAnsiPrefix()

llvm::StringRef Debugger::GetShowProgressAnsiPrefix ( ) const

Definition at line 478 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetShowProgressAnsiSuffix()

llvm::StringRef Debugger::GetShowProgressAnsiSuffix ( ) const

Definition at line 484 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetShowStatusline()

bool Debugger::GetShowStatusline ( ) const

Definition at line 490 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

Referenced by StatuslineSupported().

◆ GetSourceFileCache()

SourceManager::SourceFileCache & lldb_private::Debugger::GetSourceFileCache ( )
inline

◆ GetSourceManager()

SourceManager & Debugger::GetSourceManager ( )

Definition at line 1871 of file Debugger.cpp.

References m_source_manager_up.

Referenced by lldb_private::Disassembler::PrintInstructions().

◆ GetStaticBroadcasterClass()

llvm::StringRef Debugger::GetStaticBroadcasterClass ( )
static

Definition at line 958 of file Debugger.cpp.

Referenced by Debugger(), and lldb::SBDebugger::GetBroadcasterClass().

◆ GetStatuslineFormat()

FormatEntity::Entry Debugger::GetStatuslineFormat ( ) const

Definition at line 496 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetStopDisassemblyDisplay()

lldb::StopDisassemblyType Debugger::GetStopDisassemblyDisplay ( ) const

◆ GetStopDisassemblyMaxSize()

uint64_t Debugger::GetStopDisassemblyMaxSize ( ) const

Definition at line 313 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetStopShowColumn()

StopShowColumn Debugger::GetStopShowColumn ( ) const

◆ GetStopShowColumnAnsiPrefix()

llvm::StringRef Debugger::GetStopShowColumnAnsiPrefix ( ) const

Definition at line 596 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetStopShowColumnAnsiSuffix()

llvm::StringRef Debugger::GetStopShowColumnAnsiSuffix ( ) const

Definition at line 602 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetStopShowLineMarkerAnsiPrefix()

llvm::StringRef Debugger::GetStopShowLineMarkerAnsiPrefix ( ) const

Definition at line 608 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetStopShowLineMarkerAnsiSuffix()

llvm::StringRef Debugger::GetStopShowLineMarkerAnsiSuffix ( ) const

Definition at line 614 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetStopSourceLineCount()

uint64_t Debugger::GetStopSourceLineCount ( bool before) const

◆ GetTabSize()

uint64_t Debugger::GetTabSize ( ) const

◆ GetTargetList()

TargetList & lldb_private::Debugger::GetTargetList ( )
inline

Get accessor for the target list.

The target list is part of the global debugger object. This the single debugger shared instance to control where targets get created and to allow for tracking and searching for targets based on certain criteria.

Returns
A global shared target list.

Definition at line 193 of file Debugger.h.

References m_target_list.

Referenced by lldb_private::platform_gdb_server::PlatformRemoteGDBServer::Attach(), lldb_private::PlatformWindows::Attach(), PlatformPOSIX::Attach(), lldb_private::TargetList::CreateTargetInternal(), lldb_private::Platform::DoConnectProcess(), CommandObjectProcessAttach::DoExecute(), CommandObjectTargetCreate::DoExecute(), CommandObjectTargetDelete::DoExecute(), CommandObjectTargetSelect::DoExecute(), lldb_private::Process::HandleProcessStateChangedEvent(), lldb_private::DebuggerStats::ResetStatistics(), and lldb_private::Target::SetLabel().

◆ GetTerminalHeight()

uint64_t Debugger::GetTerminalHeight ( ) const

Definition at line 408 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

◆ GetTerminalWidth()

uint64_t Debugger::GetTerminalWidth ( ) const

◆ GetThreadFormat()

FormatEntity::Entry Debugger::GetThreadFormat ( ) const

◆ GetThreadPool()

◆ GetThreadStopFormat()

FormatEntity::Entry Debugger::GetThreadStopFormat ( ) const

◆ GetTopIOHandlerControlSequence()

llvm::StringRef Debugger::GetTopIOHandlerControlSequence ( char ch)

Definition at line 1329 of file Debugger.cpp.

References m_io_handler_stack.

◆ GetUseAutosuggestion()

bool Debugger::GetUseAutosuggestion ( ) const

◆ GetUseColor()

◆ GetUseExternalEditor()

bool Debugger::GetUseExternalEditor ( ) const

◆ GetUseSourceCache()

bool Debugger::GetUseSourceCache ( ) const

Definition at line 569 of file Debugger.cpp.

References lldb_private::Properties::GetPropertyAtIndexAs().

Referenced by SetPropertyValue().

◆ HandleBreakpointEvent()

◆ HandleDestroyCallback()

◆ HandleDiagnosticEvent()

void Debugger::HandleDiagnosticEvent ( const lldb::EventSP & event_sp)
protected

◆ HandleProcessEvent()

◆ HandleProgressEvent()

void Debugger::HandleProgressEvent ( const lldb::EventSP & event_sp)
protected

◆ HandleThreadEvent()

◆ HasIOHandlerThread()

bool Debugger::HasIOHandlerThread ( ) const
protected

◆ Initialize()

void Debugger::Initialize ( LoadPluginCallbackType load_plugin_callback)
static

◆ InstanceInitialize()

◆ InterruptRequested() [1/2]

◆ InterruptRequested() [2/2]

template<typename... Args>
bool lldb_private::Debugger::InterruptRequested ( const char * cur_func,
const char * formatv,
Args &&... args )
inline

This is the correct way to query the state of Interruption.

If you are on the RunCommandInterpreter thread, it will check the command interpreter state, and if it is on another thread it will check the debugger Interrupt Request state.

Parameters
[in]cur_funcFor reporting if the interruption was requested. Don't provide this by hand, use INTERRUPT_REQUESTED so this gets done consistently.
[in]formatvA formatv string for the interrupt message. If the elements of the message are expensive to compute, you can use the no-argument form of InterruptRequested, then make up the report using REPORT_INTERRUPTION.
Returns
A boolean value, if true an interruptible operation should interrupt itself.

Definition at line 441 of file Debugger.h.

References InterruptRequested(), and ReportInterruption().

◆ IOHandlerThread()

lldb::thread_result_t Debugger::IOHandlerThread ( )
protected

Definition at line 2232 of file Debugger.cpp.

References RunIOHandlers(), and StopEventHandlerThread().

Referenced by StartIOHandlerThread().

◆ IsForwardingEvents()

bool Debugger::IsForwardingEvents ( )

Definition at line 2046 of file Debugger.cpp.

References m_forward_listener_sp.

Referenced by HandleProcessEvent().

◆ IsHandlingEvents()

bool lldb_private::Debugger::IsHandlingEvents ( ) const
inline

Definition at line 386 of file Debugger.h.

References m_event_handler_thread.

◆ IsIOHandlerThreadCurrentThread()

bool Debugger::IsIOHandlerThreadCurrentThread ( ) const
protected

◆ IsTopIOHandler()

bool Debugger::IsTopIOHandler ( const lldb::IOHandlerSP & reader_sp)

Definition at line 1310 of file Debugger.cpp.

References m_io_handler_stack.

Referenced by lldb_private::Process::ProcessIOHandlerIsActive().

◆ JoinIOHandlerThread()

void Debugger::JoinIOHandlerThread ( )
protected

◆ LoadPlugin()

bool Debugger::LoadPlugin ( const FileSpec & spec,
Status & error )

◆ operator=()

const Debugger & lldb_private::Debugger::operator= ( const Debugger & )
privatedelete

References Debugger().

◆ PopIOHandler()

bool Debugger::PopIOHandler ( const lldb::IOHandlerSP & reader_sp)
protected

Definition at line 1421 of file Debugger.cpp.

References m_io_handler_stack.

Referenced by ClearIOHandlers(), RemoveIOHandler(), RunIOHandlers(), and RunIOHandlerSync().

◆ PrintAsync()

void Debugger::PrintAsync ( const char * s,
size_t len,
bool is_stdout )

◆ PrintProgress()

void lldb_private::Debugger::PrintProgress ( const ProgressEventData & data)
protected

◆ PushIOHandler()

void Debugger::PushIOHandler ( const lldb::IOHandlerSP & reader_sp,
bool cancel_top_handler = true )
protected

Definition at line 1394 of file Debugger.cpp.

References m_io_handler_stack.

Referenced by RunIOHandlerAsync(), and RunIOHandlerSync().

◆ RedrawStatusline()

void Debugger::RedrawStatusline ( bool update = true)

Redraw the statusline if enabled.

Definition at line 1217 of file Debugger.cpp.

References m_statusline, and m_statusline_mutex.

Referenced by DefaultEventHandler(), SetPropertyValue(), SetSeparator(), and SetStatuslineFormat().

◆ RefreshIOHandler()

void Debugger::RefreshIOHandler ( )

Definition at line 1448 of file Debugger.cpp.

References m_io_handler_stack.

◆ RemoveDestroyCallback()

bool Debugger::RemoveDestroyCallback ( lldb::callback_token_t token)

Remove the specified callback. Return true if successful.

Definition at line 1629 of file Debugger.cpp.

References m_destroy_callback_mutex, and m_destroy_callbacks.

◆ RemoveIOHandler()

bool Debugger::RemoveIOHandler ( const lldb::IOHandlerSP & reader_sp)

Remove the given IO handler if it's currently active.

Definition at line 1341 of file Debugger.cpp.

References PopIOHandler().

Referenced by lldb_private::Process::PopProcessIOHandler().

◆ ReportDiagnosticImpl()

void Debugger::ReportDiagnosticImpl ( lldb::Severity severity,
std::string message,
std::optional< lldb::user_id_t > debugger_id,
std::once_flag * once )
staticprotected

◆ ReportError()

void Debugger::ReportError ( std::string message,
std::optional< lldb::user_id_t > debugger_id = std::nullopt,
std::once_flag * once = nullptr )
static

Report error events.

Error events will be delivered to any debuggers that have listeners for the eBroadcastBitError.

Parameters
[in]messageThe error message to be reported.
[in]debugger_idIf this optional parameter has a value, it indicates the unique debugger identifier that this diagnostic should be delivered to. If this optional parameter does not have a value, the diagnostic event will be delivered to all debuggers.
[in]onceIf a pointer is passed to a std::once_flag, then it will be used to ensure the given error is only broadcast once.

Definition at line 1764 of file Debugger.cpp.

References lldb::eSeverityError, and ReportDiagnosticImpl().

Referenced by AssertCallback(), lldb_private::process_gdb_remote::ProcessGDBRemote::BuildDynamicRegisterInfo(), lldb_private::TargetProperties::CheckJITObjectsDir(), lldb_private::StructuredDataDarwinLog::EnableNow(), lldb_private::Function::GetBlock(), lldb_private::DWARFCallFrameInfo::GetFDEIndex(), lldb_private::Options::GetLongOptions(), lldb_private::PlatformMacOSX::GetSDKDirectory(), MachSymtabSectionInfo::GetSection(), GetXcodeSDKDir(), lldb_private::DWARFCallFrameInfo::ParseCIE(), ObjectFileMachO::ParseSymtab(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::StopInfoWatchpoint::PerformAction(), lldb_private::Module::RegisterXcodeSDK(), lldb_private::Module::ReportError(), lldb_private::Module::ReportErrorIfModifyDetected(), and lldb_private::CompactUnwindInfo::ScanIndex().

◆ ReportInfo()

void Debugger::ReportInfo ( std::string message,
std::optional< lldb::user_id_t > debugger_id = std::nullopt,
std::once_flag * once = nullptr )
static

Report info events.

Unlike warning and error events, info events are not broadcast but are logged for diagnostic purposes.

Parameters
[in]messageThe info message to be reported.
[in]debugger_idIf this optional parameter has a value, it indicates this diagnostic is associated with a unique debugger instance.
[in]onceIf a pointer is passed to a std::once_flag, then it will be used to ensure the given info is only logged once.

Definition at line 1770 of file Debugger.cpp.

References lldb::eSeverityInfo, and ReportDiagnosticImpl().

◆ ReportInterruption()

void Debugger::ReportInterruption ( const InterruptionReport & report)

◆ ReportProgress()

void Debugger::ReportProgress ( uint64_t progress_id,
std::string title,
std::string details,
uint64_t completed,
uint64_t total,
std::optional< lldb::user_id_t > debugger_id,
uint32_t progress_category_bit = lldb::eBroadcastBitProgress )
staticprotected

Report progress events.

Progress events will be delivered to any debuggers that have listeners for the eBroadcastBitProgress. This function is called by the lldb_private::Progress class to deliver the events to any debuggers that qualify.

Parameters
[in]progress_idThe unique integer identifier for the progress to report.
[in]messageThe title of the progress dialog to display in the UI.
[in]completedThe amount of work completed. If completed is zero, then this event is a progress started event. If completed is equal to total, then this event is a progress end event. Otherwise completed indicates the current progress compare to the total value.
[in]totalThe total amount of work units that need to be completed. If this value is UINT64_MAX, then an indeterminate progress indicator should be displayed.
[in]debugger_idIf this optional parameter has a value, it indicates the unique debugger identifier that this progress should be delivered to. If this optional parameter does not have a value, the progress will be delivered to all debuggers.

Definition at line 1657 of file Debugger.cpp.

References FindDebuggerWithID(), g_debugger_list_mutex_ptr, g_debugger_list_ptr, and PrivateReportProgress().

Referenced by lldb_private::Progress::ReportProgress().

◆ ReportSymbolChange()

void Debugger::ReportSymbolChange ( const ModuleSpec & module_spec)
static

◆ ReportWarning()

void Debugger::ReportWarning ( std::string message,
std::optional< lldb::user_id_t > debugger_id = std::nullopt,
std::once_flag * once = nullptr )
static

Report warning events.

Warning events will be delivered to any debuggers that have listeners for the eBroadcastBitWarning.

Parameters
[in]messageThe warning message to be reported.
[in]debugger_idIf this optional parameter has a value, it indicates the unique debugger identifier that this diagnostic should be delivered to. If this optional parameter does not have a value, the diagnostic event will be delivered to all debuggers.
[in]onceIf a pointer is passed to a std::once_flag, then it will be used to ensure the given warning is only broadcast once.

Definition at line 1758 of file Debugger.cpp.

References lldb::eSeverityWarning, and ReportDiagnosticImpl().

Referenced by lldb_private::TypeSystemClang::CreateASTContext(), lldb_private::SourceManager::DisplaySourceLinesWithLineNumbersUsingLastFile(), lldb_private::minidump::ProcessMinidump::DoLoadCore(), lldb_private::MemoryHistoryASan::GetHistoryThreads(), lldb_private::SymbolContext::GetParentOfInlinedScope(), DynamicLoaderMacOS::NotifyBreakpointHit(), DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::Module::ReportWarning(), lldb_private::Module::ReportWarningOptimization(), lldb_private::Module::ReportWarningUnsupportedLanguage(), lldb_private::InstrumentationRuntimeTSan::RetrieveReportData(), lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(), lldb_private::ReportRetriever::RetrieveReportData(), and lldb_private::DynamicLoaderDarwin::UnloadModuleSections().

◆ RequestInterrupt()

void Debugger::RequestInterrupt ( )

Interruption in LLDB:

This is a voluntary interruption mechanism, not preemptive. Parts of lldb that do work that can be safely interrupted call Debugger::InterruptRequested and if that returns true, they should return at a safe point, shortcutting the rest of the work they were to do.

lldb clients can both offer a CommandInterpreter (through RunCommandInterpreter) and use the SB API's for their own purposes, so it is convenient to separate "interrupting the CommandInterpreter execution" and interrupting the work it is doing with the SB API's. So there are two ways to cause an interrupt:

Since the two checks are mutually exclusive, however, it's also convenient to have just one function to check the interrupt state. Bump the "interrupt requested" count on the debugger to support cooperative interruption. If this is non-zero, InterruptRequested will return true. Interruptible operations are expected to query the InterruptRequested API periodically, and interrupt what they were doing if it returns true.

Definition at line 1465 of file Debugger.cpp.

References m_interrupt_mutex, and m_interrupt_requested.

◆ RestoreInputTerminalState()

void Debugger::RestoreInputTerminalState ( )

Definition at line 1208 of file Debugger.cpp.

References m_statusline, m_statusline_mutex, and m_terminal_state.

◆ RunIOHandlerAsync()

◆ RunIOHandlers()

void Debugger::RunIOHandlers ( )

◆ RunIOHandlerSync()

void Debugger::RunIOHandlerSync ( const lldb::IOHandlerSP & reader_sp)

Run the given IO handler and block until it's complete.

Definition at line 1279 of file Debugger.cpp.

References m_io_handler_stack, m_io_handler_synchronous_mutex, PopIOHandler(), and PushIOHandler().

Referenced by lldb_private::CommandInterpreter::HandleCommandsFromFile().

◆ RunREPL()

◆ SaveInputTerminalState()

void Debugger::SaveInputTerminalState ( )

◆ SetAsyncExecution()

◆ SetAutoIndent()

bool Debugger::SetAutoIndent ( bool b)

Definition at line 658 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetDestroyCallback()

void Debugger::SetDestroyCallback ( lldb_private::DebuggerDestroyCallback destroy_callback,
void * baton )

DEPRECATED: We used to only support one Destroy callback.

Now that we support Add and Remove, you should only remove callbacks that you added. Use Add and Remove instead.

Clear all previously added callbacks and only add the given one.

Definition at line 1613 of file Debugger.cpp.

References m_destroy_callback_mutex, m_destroy_callback_next_token, and m_destroy_callbacks.

◆ SetErrorFile()

void Debugger::SetErrorFile ( lldb::FileSP file)

Definition at line 1191 of file Debugger.cpp.

References m_error_stream_sp, and m_output_mutex.

◆ SetExternalEditor()

bool Debugger::SetExternalEditor ( llvm::StringRef editor)

Definition at line 447 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetInputFile()

void Debugger::SetInputFile ( lldb::FileSP file)

Definition at line 1177 of file Debugger.cpp.

References m_input_file_sp, and SaveInputTerminalState().

Referenced by SetInputString().

◆ SetInputString()

Status Debugger::SetInputString ( const char * data)

◆ SetIOHandlerThread()

HostThread Debugger::SetIOHandlerThread ( HostThread & new_thread)
protected

Definition at line 2286 of file Debugger.cpp.

References m_io_handler_thread.

◆ SetLoggingCallback()

void Debugger::SetLoggingCallback ( lldb::LogOutputCallback log_callback,
void * baton )

Definition at line 1604 of file Debugger.cpp.

References m_callback_handler_sp.

◆ SetOutputFile()

void Debugger::SetOutputFile ( lldb::FileSP file)

Definition at line 1185 of file Debugger.cpp.

References m_output_mutex, and m_output_stream_sp.

◆ SetPrintDecls()

bool Debugger::SetPrintDecls ( bool b)

Definition at line 669 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetPrompt() [1/2]

void lldb_private::Debugger::SetPrompt ( const char * )
delete

◆ SetPrompt() [2/2]

◆ SetPropertyValue()

◆ SetREPLLanguage()

bool Debugger::SetREPLLanguage ( lldb::LanguageType repl_lang)

Definition at line 381 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetScriptLanguage()

bool Debugger::SetScriptLanguage ( lldb::ScriptLanguage script_lang)

Definition at line 371 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetSeparator()

bool Debugger::SetSeparator ( llvm::StringRef s)

Definition at line 526 of file Debugger.cpp.

References RedrawStatusline(), and lldb_private::Properties::SetPropertyAtIndex().

Referenced by Debugger().

◆ SetShowInlineDiagnostics()

bool Debugger::SetShowInlineDiagnostics ( bool b)

Definition at line 698 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetShowProgress()

bool Debugger::SetShowProgress ( bool show_progress)

Definition at line 473 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

Referenced by lldb_private::REPL::REPL().

◆ SetStatuslineFormat()

bool Debugger::SetStatuslineFormat ( const FormatEntity::Entry & format)

◆ SetTabSize()

bool Debugger::SetTabSize ( uint64_t tab_size)

Definition at line 680 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetTerminalHeight()

bool Debugger::SetTerminalHeight ( uint64_t term_height)

◆ SetTerminalWidth()

bool Debugger::SetTerminalWidth ( uint64_t term_width)

◆ SettingsInitialize()

void Debugger::SettingsInitialize ( )
static

◆ SettingsTerminate()

void Debugger::SettingsTerminate ( )
static

◆ SetUseColor()

◆ SetUseExternalEditor()

bool Debugger::SetUseExternalEditor ( bool use_external_editor_p)

Definition at line 436 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetUseSourceCache()

bool Debugger::SetUseSourceCache ( bool use_source_cache)

◆ StartEventHandlerThread()

bool Debugger::StartEventHandlerThread ( )

◆ StartIOHandlerThread()

◆ StatuslineSupported()

◆ StopEventHandlerThread()

void Debugger::StopEventHandlerThread ( )

◆ StopIOHandlerThread()

void Debugger::StopIOHandlerThread ( )
protected

Definition at line 2307 of file Debugger.cpp.

References lldb_private::File::Close(), GetInputFile(), and m_io_handler_thread.

Referenced by Clear().

◆ Terminate()

void Debugger::Terminate ( )
static

◆ CommandInterpreter

friend class CommandInterpreter
friend

◆ Progress

friend class Progress
friend

Definition at line 622 of file Debugger.h.

References Progress.

Referenced by Progress.

◆ ProgressManager

friend class ProgressManager
friend

Definition at line 623 of file Debugger.h.

References ProgressManager.

Referenced by ProgressManager.

◆ REPL

friend class REPL
friend

Definition at line 621 of file Debugger.h.

References REPL.

Referenced by REPL.

◆ Statusline

friend class Statusline
friend

Definition at line 624 of file Debugger.h.

References lldb::eBroadcastBitProgress, and Statusline.

Referenced by Statusline.

Member Data Documentation

◆ g_load_plugin_callback

LoadPluginCallbackType Debugger::g_load_plugin_callback = nullptr
staticprotected

Definition at line 759 of file Debugger.h.

Referenced by Initialize(), and LoadPlugin().

◆ m_broadcaster

Broadcaster lldb_private::Debugger::m_broadcaster
protected

Public Debugger event broadcaster.

Definition at line 765 of file Debugger.h.

Referenced by Debugger(), DefaultEventHandler(), GetBroadcaster(), and GetBroadcaster().

◆ m_broadcaster_manager_sp

lldb::BroadcasterManagerSP lldb_private::Debugger::m_broadcaster_manager_sp
protected

Definition at line 723 of file Debugger.h.

Referenced by Clear(), Debugger(), DefaultEventHandler(), and GetBroadcasterManager().

◆ m_callback_handler_sp

std::shared_ptr<CallbackLogHandler> lldb_private::Debugger::m_callback_handler_sp
protected

Definition at line 757 of file Debugger.h.

Referenced by Debugger(), EnableLog(), and SetLoggingCallback().

◆ m_clear_once

llvm::once_flag lldb_private::Debugger::m_clear_once
protected

Definition at line 767 of file Debugger.h.

Referenced by Clear(), and Debugger().

◆ m_command_interpreter_up

std::unique_ptr<CommandInterpreter> lldb_private::Debugger::m_command_interpreter_up
protected

◆ m_destroy_callback_mutex

std::mutex lldb_private::Debugger::m_destroy_callback_mutex
protected

◆ m_destroy_callback_next_token

lldb::callback_token_t lldb_private::Debugger::m_destroy_callback_next_token = 0
protected

Definition at line 778 of file Debugger.h.

Referenced by AddDestroyCallback(), and SetDestroyCallback().

◆ m_destroy_callbacks

llvm::SmallVector<DestroyCallbackInfo, 2> lldb_private::Debugger::m_destroy_callbacks
protected

◆ m_diagnostics_callback_id

Diagnostics::CallbackID lldb_private::Debugger::m_diagnostics_callback_id
protected

Definition at line 769 of file Debugger.h.

Referenced by Clear(), and Debugger().

◆ m_dummy_target_sp

lldb::TargetSP lldb_private::Debugger::m_dummy_target_sp
protected

Definition at line 768 of file Debugger.h.

Referenced by Debugger(), and GetDummyTarget().

◆ m_error_stream_sp

lldb::LockableStreamFileSP lldb_private::Debugger::m_error_stream_sp
protected

Definition at line 720 of file Debugger.h.

Referenced by Debugger(), GetErrorFileSP(), GetErrorStreamSP(), PrintAsync(), and SetErrorFile().

◆ m_event_handler_thread

HostThread lldb_private::Debugger::m_event_handler_thread
protected

◆ m_forward_listener_sp

lldb::ListenerSP lldb_private::Debugger::m_forward_listener_sp
protected

◆ m_input_file_sp

lldb::FileSP lldb_private::Debugger::m_input_file_sp
protected

Definition at line 718 of file Debugger.h.

Referenced by Debugger(), GetInputFile(), GetInputFileSP(), and SetInputFile().

◆ m_instance_name

const std::string lldb_private::Debugger::m_instance_name
protected

Definition at line 758 of file Debugger.h.

Referenced by Debugger(), and GetInstanceName().

◆ m_interrupt_mutex

std::mutex lldb_private::Debugger::m_interrupt_mutex
protected

Definition at line 792 of file Debugger.h.

Referenced by CancelInterruptRequest(), InterruptRequested(), and RequestInterrupt().

◆ m_interrupt_requested

uint32_t lldb_private::Debugger::m_interrupt_requested = 0
protected

Tracks interrupt requests.

Definition at line 791 of file Debugger.h.

Referenced by CancelInterruptRequest(), InterruptRequested(), and RequestInterrupt().

◆ m_io_handler_stack

◆ m_io_handler_synchronous_mutex

std::recursive_mutex lldb_private::Debugger::m_io_handler_synchronous_mutex
protected

Definition at line 750 of file Debugger.h.

Referenced by RunIOHandlers(), and RunIOHandlerSync().

◆ m_io_handler_thread

HostThread lldb_private::Debugger::m_io_handler_thread
protected

◆ m_listener_sp

lldb::ListenerSP lldb_private::Debugger::m_listener_sp
protected

Definition at line 733 of file Debugger.h.

Referenced by Clear(), Debugger(), and GetListener().

◆ m_loaded_plugins

LoadedPluginsList lldb_private::Debugger::m_loaded_plugins
protected

Definition at line 761 of file Debugger.h.

Referenced by Debugger(), and LoadPlugin().

◆ m_output_flush_mutex

std::mutex lldb_private::Debugger::m_output_flush_mutex
protected

Definition at line 713 of file Debugger.h.

Referenced by FlushProcessOutput().

◆ m_output_mutex

LockableStreamFile::Mutex lldb_private::Debugger::m_output_mutex
protected

Definition at line 721 of file Debugger.h.

Referenced by AdoptTopIOHandlerFilesIfInvalid(), Debugger(), SetErrorFile(), and SetOutputFile().

◆ m_output_stream_sp

lldb::LockableStreamFileSP lldb_private::Debugger::m_output_stream_sp
protected

Definition at line 719 of file Debugger.h.

Referenced by Debugger(), GetOutputFileSP(), GetOutputStreamSP(), PrintAsync(), and SetOutputFile().

◆ m_platform_list

PlatformList lldb_private::Debugger::m_platform_list
protected

Definition at line 732 of file Debugger.h.

Referenced by Debugger(), and GetPlatformList().

◆ m_progress_reports

llvm::SmallVector<ProgressReport, 4> lldb_private::Debugger::m_progress_reports
protected

Bookkeeping for command line progress events.

Definition at line 773 of file Debugger.h.

Referenced by GetCurrentProgressReport(), and HandleProgressEvent().

◆ m_progress_reports_mutex

std::mutex lldb_private::Debugger::m_progress_reports_mutex
mutableprotected

Definition at line 774 of file Debugger.h.

Referenced by GetCurrentProgressReport(), and HandleProgressEvent().

◆ m_script_interpreter_mutex

std::recursive_mutex lldb_private::Debugger::m_script_interpreter_mutex
protected

Definition at line 745 of file Debugger.h.

Referenced by GetScriptInterpreter().

◆ m_script_interpreters

std::array<lldb::ScriptInterpreterSP, lldb::eScriptLanguageUnknown> lldb_private::Debugger::m_script_interpreters
protected

Definition at line 747 of file Debugger.h.

Referenced by GetScriptInterpreter().

◆ m_source_file_cache

SourceManager::SourceFileCache lldb_private::Debugger::m_source_file_cache
protected

Definition at line 738 of file Debugger.h.

Referenced by Debugger(), GetSourceFileCache(), SetPropertyValue(), and SetUseSourceCache().

◆ m_source_manager_up

std::unique_ptr<SourceManager> lldb_private::Debugger::m_source_manager_up
protected

Definition at line 734 of file Debugger.h.

Referenced by Debugger(), and GetSourceManager().

◆ m_statusline

std::optional<Statusline> lldb_private::Debugger::m_statusline
protected

◆ m_statusline_mutex

std::mutex lldb_private::Debugger::m_statusline_mutex
protected

◆ m_stream_handlers

llvm::StringMap<std::weak_ptr<LogHandler> > lldb_private::Debugger::m_stream_handlers
protected

Definition at line 756 of file Debugger.h.

Referenced by Debugger(), and EnableLog().

◆ m_sync_broadcaster

Broadcaster lldb_private::Debugger::m_sync_broadcaster
protected

Private debugger synchronization.

Definition at line 764 of file Debugger.h.

Referenced by Debugger(), DefaultEventHandler(), and StartEventHandlerThread().

◆ m_target_list

TargetList lldb_private::Debugger::m_target_list
protected

◆ m_terminal_state

TerminalState lldb_private::Debugger::m_terminal_state
protected

Definition at line 729 of file Debugger.h.

Referenced by Clear(), Debugger(), RestoreInputTerminalState(), and SaveInputTerminalState().


The documentation for this class was generated from the following files: