LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Friends | List of all members
lldb_private::Debugger Class Reference

A class to manage flag bits. More...

#include "lldb/Core/Debugger.h"

Inheritance diagram for lldb_private::Debugger:
Inheritance graph
[legend]

Classes

struct  DestroyCallbackInfo
 
class  InterruptionReport
 

Public Types

enum  StopDisassemblyType { eStopDisassemblyTypeNever = 0 , eStopDisassemblyTypeNoDebugInfo , eStopDisassemblyTypeNoSource , eStopDisassemblyTypeAlways }
 
using DebuggerList = std::vector< lldb::DebuggerSP >
 

Public Member Functions

BroadcasterGetBroadcaster ()
 Get the public broadcaster for this debugger.
 
const BroadcasterGetBroadcaster () const
 
 ~Debugger () override
 
void Clear ()
 
bool GetAsyncExecution ()
 
void SetAsyncExecution (bool async)
 
lldb::FileSP GetInputFileSP ()
 
lldb::StreamFileSP GetOutputStreamSP ()
 
lldb::StreamFileSP GetErrorStreamSP ()
 
FileGetInputFile ()
 
FileGetOutputFile ()
 
FileGetErrorFile ()
 
StreamFileGetOutputStream ()
 
StreamFileGetErrorStream ()
 
repro::DataRecorder * GetInputRecorder ()
 
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::StreamSP GetAsyncOutputStream ()
 
lldb::StreamSP 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::StreamFileSP &out, lldb::StreamFileSP &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 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
 
const FormatEntity::EntryGetDisassemblyFormat () const
 
const FormatEntity::EntryGetFrameFormat () const
 
const FormatEntity::EntryGetFrameFormatUnique () const
 
uint64_t GetStopDisassemblyMaxSize () const
 
const FormatEntity::EntryGetThreadFormat () const
 
const FormatEntity::EntryGetThreadStopFormat () 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)
 
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)
 
llvm::StringRef GetShowProgressAnsiPrefix () const
 
llvm::StringRef GetShowProgressAnsiSuffix () 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
 
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 ()
 
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.
 
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 ()
 
- 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 ()
 
virtual lldb::OptionValuePropertiesSP GetValueProperties () const
 
virtual lldb::OptionValueSP GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, Status &error) const
 
virtual Status SetPropertyValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value)
 
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)
 
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 ()
 

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::StreamFileSP m_output_stream_sp
 
lldb::StreamFileSP m_error_stream_sp
 
repro::DataRecorder * m_input_recorder
 Used for shadowing the input file when capturing a reproducer.
 
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::optional< uint64_t > m_current_event_id
 
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
 
- 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
 

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 729 of file Debugger.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
eBroadcastBitEventThreadIsListening 

Definition at line 758 of file Debugger.h.

◆ StopDisassemblyType

Enumerator
eStopDisassemblyTypeNever 
eStopDisassemblyTypeNoDebugInfo 
eStopDisassemblyTypeNoSource 
eStopDisassemblyTypeAlways 

Definition at line 246 of file Debugger.h.

Constructor & Destructor Documentation

◆ ~Debugger()

Debugger::~Debugger ( )
override

Definition at line 943 of file Debugger.cpp.

References Clear().

◆ Debugger() [1/2]

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

◆ Debugger() [2/2]

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

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 1449 of file Debugger.cpp.

References m_destroy_callback_mutex, m_destroy_callback_next_token, and m_destroy_callbacks.

◆ AdoptTopIOHandlerFilesIfInvalid()

void Debugger::AdoptTopIOHandlerFilesIfInvalid ( lldb::FileSP in,
lldb::StreamFileSP out,
lldb::StreamFileSP err 
)

◆ AssertCallback()

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

Definition at line 1425 of file Debugger.cpp.

References ReportError().

Referenced by lldb_private::SystemInitializerFull::Initialize().

◆ CancelForwardEvents()

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

Definition at line 1884 of file Debugger.cpp.

References m_forward_listener_sp.

◆ CancelInterruptRequest()

void Debugger::CancelInterruptRequest ( )

Decrement the "interrupt requested" counter.

Definition at line 1302 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 
)

◆ Clear()

void Debugger::Clear ( )

◆ ClearIOHandlers()

void Debugger::ClearIOHandlers ( )

◆ CreateInstance()

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

Definition at line 734 of file Debugger.cpp.

References g_debugger_list_mutex_ptr, and g_debugger_list_ptr.

Referenced by lldb::SBDebugger::Create().

◆ DebuggersRequestingInterruption()

Debugger::DebuggerList Debugger::DebuggersRequestingInterruption ( )
static

◆ DefaultEventHandler()

lldb::thread_result_t Debugger::DefaultEventHandler ( )
protected

◆ Destroy()

void Debugger::Destroy ( lldb::DebuggerSP debugger_sp)
static

◆ DispatchInputEndOfFile()

void Debugger::DispatchInputEndOfFile ( )

◆ DispatchInputInterrupt()

void Debugger::DispatchInputInterrupt ( )

◆ EnableForwardEvents()

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

Definition at line 1880 of file Debugger.cpp.

References m_forward_listener_sp.

◆ EnableLog()

bool Debugger::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 
)

◆ FindDebuggerWithID()

DebuggerSP Debugger::FindDebuggerWithID ( lldb::user_id_t  id)
static

◆ FindDebuggerWithInstanceName()

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

◆ FindTargetWithProcess()

TargetSP Debugger::FindTargetWithProcess ( Process process)
static

Definition at line 825 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 1754 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 lldb_private::CommandInterpreter::GetProcessOutput(), and HandleProcessEvent().

◆ FormatDisassemblerAddress()

bool Debugger::FormatDisassemblerAddress ( const FormatEntity::Entry format,
const SymbolContext sc,
const SymbolContext prev_sc,
const ExecutionContext exe_ctx,
const Address addr,
Stream s 
)
static

◆ GetAsyncErrorStream()

StreamSP Debugger::GetAsyncErrorStream ( )

◆ GetAsyncExecution()

bool Debugger::GetAsyncExecution ( )

◆ GetAsyncOutputStream()

StreamSP Debugger::GetAsyncOutputStream ( )

◆ GetAutoConfirm()

bool Debugger::GetAutoConfirm ( ) const

Definition at line 273 of file Debugger.cpp.

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

◆ GetAutoIndent()

bool Debugger::GetAutoIndent ( ) const

Definition at line 558 of file Debugger.cpp.

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

◆ GetAutoOneLineSummaries()

bool Debugger::GetAutoOneLineSummaries ( ) const

Definition at line 546 of file Debugger.cpp.

◆ GetAutosuggestionAnsiPrefix()

llvm::StringRef Debugger::GetAutosuggestionAnsiPrefix ( ) const

Definition at line 445 of file Debugger.cpp.

Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().

◆ GetAutosuggestionAnsiSuffix()

llvm::StringRef Debugger::GetAutosuggestionAnsiSuffix ( ) const

Definition at line 451 of file Debugger.cpp.

Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().

◆ 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()

CommandInterpreter & lldb_private::Debugger::GetCommandInterpreter ( )
inline

◆ GetDebuggerAtIndex()

lldb::DebuggerSP Debugger::GetDebuggerAtIndex ( size_t  index)
static

◆ GetDisassemblyFormat()

const FormatEntity::Entry * Debugger::GetDisassemblyFormat ( ) const

◆ GetDisassemblyLineCount()

uint64_t Debugger::GetDisassemblyLineCount ( ) const

Definition at line 540 of file Debugger.cpp.

Referenced by lldb_private::StackFrame::GetStatus().

◆ GetDummyTarget()

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

◆ GetDWIMPrintVerbosity()

lldb::DWIMPrintVerbosity Debugger::GetDWIMPrintVerbosity ( ) const

Definition at line 591 of file Debugger.cpp.

Referenced by lldb_private::CommandObjectDWIMPrint::DoExecute().

◆ GetErrorFile()

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

Definition at line 144 of file Debugger.h.

References m_error_stream_sp.

Referenced by IOHandlerLuaInterpreter::IOHandlerLuaInterpreter().

◆ GetErrorStream()

StreamFile & lldb_private::Debugger::GetErrorStream ( )
inline

◆ GetErrorStreamSP()

lldb::StreamFileSP lldb_private::Debugger::GetErrorStreamSP ( )
inline

◆ GetEscapeNonPrintables()

bool Debugger::GetEscapeNonPrintables ( ) const

Definition at line 552 of file Debugger.cpp.

◆ GetExternalEditor()

llvm::StringRef Debugger::GetExternalEditor ( ) const

◆ GetFrameFormat()

const FormatEntity::Entry * Debugger::GetFrameFormat ( ) const

Definition at line 284 of file Debugger.cpp.

Referenced by lldb_private::StackFrame::DumpUsingSettingsFormat().

◆ GetFrameFormatUnique()

const FormatEntity::Entry * Debugger::GetFrameFormatUnique ( ) const

Definition at line 289 of file Debugger.cpp.

Referenced by lldb_private::StackFrame::DumpUsingSettingsFormat().

◆ GetHighlightSource()

bool Debugger::GetHighlightSource ( ) const

Definition at line 489 of file Debugger.cpp.

◆ GetInputFile()

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

◆ GetInputFileSP()

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

◆ GetInputRecorder()

repro::DataRecorder * Debugger::GetInputRecorder ( )

Definition at line 988 of file Debugger.cpp.

References m_input_recorder.

◆ GetInstanceName()

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

Definition at line 365 of file Debugger.h.

References m_instance_name.

◆ GetIOHandlerCommandPrefix()

const char * Debugger::GetIOHandlerCommandPrefix ( )

◆ GetIOHandlerHelpPrologue()

const char * Debugger::GetIOHandlerHelpPrologue ( )

◆ GetListener()

lldb::ListenerSP lldb_private::Debugger::GetListener ( )
inline

◆ GetNotifyVoid()

bool Debugger::GetNotifyVoid ( ) const

Definition at line 300 of file Debugger.cpp.

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

◆ GetNumDebuggers()

size_t Debugger::GetNumDebuggers ( )
static

◆ GetOutputFile()

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

◆ GetOutputStream()

StreamFile & lldb_private::Debugger::GetOutputStream ( )
inline

◆ GetOutputStreamSP()

lldb::StreamFileSP lldb_private::Debugger::GetOutputStreamSP ( )
inline

◆ GetPlatformList()

PlatformList & lldb_private::Debugger::GetPlatformList ( )
inline

◆ GetPrintDecls()

bool Debugger::GetPrintDecls ( ) const

Definition at line 569 of file Debugger.cpp.

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

◆ GetPrompt()

llvm::StringRef Debugger::GetPrompt ( ) const

◆ GetPromptAnsiPrefix()

llvm::StringRef Debugger::GetPromptAnsiPrefix ( ) const

Definition at line 312 of file Debugger.cpp.

Referenced by lldb_private::IOHandlerEditline::SetPrompt().

◆ GetPromptAnsiSuffix()

llvm::StringRef Debugger::GetPromptAnsiSuffix ( ) const

Definition at line 318 of file Debugger.cpp.

Referenced by lldb_private::IOHandlerEditline::SetPrompt().

◆ GetRegexMatchAnsiPrefix()

llvm::StringRef Debugger::GetRegexMatchAnsiPrefix ( ) const

Definition at line 457 of file Debugger.cpp.

Referenced by LookupSymbolInModule().

◆ GetRegexMatchAnsiSuffix()

llvm::StringRef Debugger::GetRegexMatchAnsiSuffix ( ) const

Definition at line 463 of file Debugger.cpp.

Referenced by LookupSymbolInModule().

◆ GetREPLLanguage()

lldb::LanguageType Debugger::GetREPLLanguage ( ) const

Definition at line 357 of file Debugger.cpp.

Referenced by lldb_private::Target::GetREPL(), and RunREPL().

◆ GetScriptInterpreter()

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

Definition at line 1684 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(), CommandObjectScriptingObjectParsed::DoExecute(), CommandObjectCommandsScriptAdd::DoExecute(), CommandObjectFrameRecognizerAdd::DoExecute(), CommandObjectScriptingRun::DoExecute(), CommandObjectPythonFunction::DoExecute(), CommandObjectScriptingObjectRaw::DoExecute(), CommandObjectScriptingObjectRaw::GetHelp(), CommandObjectScriptingObjectParsed::GetHelp(), CommandObjectPythonFunction::GetHelpLong(), CommandObjectScriptingObjectRaw::GetHelpLong(), CommandObjectScriptingObjectParsed::GetHelpLong(), CommandObjectScriptingObjectRaw::GetRepeatCommand(), CommandObjectScriptingObjectParsed::GetRepeatCommand(), lldb_private::ScriptedThreadPlan::GetScriptInterpreter(), CommandObjectCommandsScriptAdd::IOHandlerInputComplete(), CommandObjectTypeSummaryAdd::IOHandlerInputComplete(), CommandObjectTypeSynthAdd::IOHandlerInputComplete(), lldb_private::CommandInterpreter::IOHandlerInterrupt(), lldb_private::Module::LoadScriptingResourceInTarget(), lldb_private::PlatformDarwin::LocateExecutableScriptingResources(), CommandObjectScriptingObjectParsed::CommandOptions::OptionParsingStarting(), CommandObjectTypeFilterAdd::CommandOptions::OptionParsingStarting(), lldb_private::process_gdb_remote::ProcessGDBRemote::ParsePythonTargetDefinition(), RunScriptFormatKeyword(), CommandObjectScriptingObjectParsed::CommandOptions::SetOptionValue(), and lldb_private::ScriptInterpreterLua::WatchpointCallbackFunction().

◆ GetScriptLanguage()

lldb::ScriptLanguage Debugger::GetScriptLanguage ( ) const

◆ GetSelectedExecutionContext()

ExecutionContext Debugger::GetSelectedExecutionContext ( )

◆ GetSelectedOrDummyTarget()

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

◆ GetSelectedTarget()

lldb::TargetSP lldb_private::Debugger::GetSelectedTarget ( )
inline

◆ GetShowDontUsePoHint()

bool Debugger::GetShowDontUsePoHint ( ) const

Definition at line 469 of file Debugger.cpp.

◆ GetShowProgress()

bool Debugger::GetShowProgress ( ) const

Definition at line 416 of file Debugger.cpp.

Referenced by HandleProgressEvent().

◆ GetShowProgressAnsiPrefix()

llvm::StringRef Debugger::GetShowProgressAnsiPrefix ( ) const

Definition at line 427 of file Debugger.cpp.

Referenced by HandleProgressEvent().

◆ GetShowProgressAnsiSuffix()

llvm::StringRef Debugger::GetShowProgressAnsiSuffix ( ) const

Definition at line 433 of file Debugger.cpp.

Referenced by HandleProgressEvent().

◆ GetSourceFileCache()

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

◆ GetSourceManager()

SourceManager & Debugger::GetSourceManager ( )

Definition at line 1700 of file Debugger.cpp.

References m_source_manager_up.

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

◆ GetStaticBroadcasterClass()

llvm::StringRef Debugger::GetStaticBroadcasterClass ( )
static

Definition at line 839 of file Debugger.cpp.

Referenced by lldb::SBDebugger::GetBroadcasterClass().

◆ GetStopDisassemblyDisplay()

Debugger::StopDisassemblyType Debugger::GetStopDisassemblyDisplay ( ) const

Definition at line 533 of file Debugger.cpp.

Referenced by lldb_private::StackFrame::GetStatus().

◆ GetStopDisassemblyMaxSize()

uint64_t Debugger::GetStopDisassemblyMaxSize ( ) const

Definition at line 294 of file Debugger.cpp.

◆ GetStopShowColumn()

StopShowColumn Debugger::GetStopShowColumn ( ) const

Definition at line 495 of file Debugger.cpp.

Referenced by CommandObjectSourceList::DoExecute().

◆ GetStopShowColumnAnsiPrefix()

llvm::StringRef Debugger::GetStopShowColumnAnsiPrefix ( ) const

Definition at line 502 of file Debugger.cpp.

◆ GetStopShowColumnAnsiSuffix()

llvm::StringRef Debugger::GetStopShowColumnAnsiSuffix ( ) const

Definition at line 508 of file Debugger.cpp.

◆ GetStopShowLineMarkerAnsiPrefix()

llvm::StringRef Debugger::GetStopShowLineMarkerAnsiPrefix ( ) const

Definition at line 514 of file Debugger.cpp.

◆ GetStopShowLineMarkerAnsiSuffix()

llvm::StringRef Debugger::GetStopShowLineMarkerAnsiSuffix ( ) const

Definition at line 520 of file Debugger.cpp.

◆ GetStopSourceLineCount()

uint64_t Debugger::GetStopSourceLineCount ( bool  before) const

Definition at line 526 of file Debugger.cpp.

Referenced by lldb_private::StackFrame::GetStatus().

◆ GetTabSize()

uint64_t Debugger::GetTabSize ( ) const

◆ GetTargetList()

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

◆ GetTerminalWidth()

uint64_t Debugger::GetTerminalWidth ( ) const

◆ GetThreadFormat()

const FormatEntity::Entry * Debugger::GetThreadFormat ( ) const

Definition at line 335 of file Debugger.cpp.

Referenced by lldb_private::Thread::DumpUsingSettingsFormat().

◆ GetThreadPool()

llvm::ThreadPoolInterface & Debugger::GetThreadPool ( )
static

Shared thread pool. Use only with ThreadPoolTaskGroup.

Definition at line 2235 of file Debugger.cpp.

References g_thread_pool.

Referenced by lldb_private::SymbolLocator::DownloadSymbolFileAsync(), and lldb_private::plugin::dwarf::ManualDWARFIndex::Index().

◆ GetThreadStopFormat()

const FormatEntity::Entry * Debugger::GetThreadStopFormat ( ) const

Definition at line 340 of file Debugger.cpp.

Referenced by lldb_private::Thread::DumpUsingSettingsFormat().

◆ GetTopIOHandlerControlSequence()

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

◆ GetUseAutosuggestion()

bool Debugger::GetUseAutosuggestion ( ) const

Definition at line 439 of file Debugger.cpp.

Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().

◆ GetUseColor()

bool Debugger::GetUseColor ( ) const

◆ GetUseExternalEditor()

bool Debugger::GetUseExternalEditor ( ) const

◆ GetUseSourceCache()

bool Debugger::GetUseSourceCache ( ) const

Definition at line 475 of file Debugger.cpp.

Referenced by SetPropertyValue().

◆ HandleBreakpointEvent()

void Debugger::HandleBreakpointEvent ( const lldb::EventSP event_sp)
protected

◆ HandleDestroyCallback()

void Debugger::HandleDestroyCallback ( )
protected

◆ HandleDiagnosticEvent()

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

◆ HandleProcessEvent()

void Debugger::HandleProcessEvent ( const lldb::EventSP event_sp)
protected

◆ HandleProgressEvent()

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

◆ HandleThreadEvent()

void Debugger::HandleThreadEvent ( const lldb::EventSP event_sp)
protected

◆ HasIOHandlerThread()

bool Debugger::HasIOHandlerThread ( ) const
protected

◆ Initialize()

void Debugger::Initialize ( LoadPluginCallbackType  load_plugin_callback)
static

◆ InstanceInitialize()

void Debugger::InstanceInitialize ( )
protected

◆ InterruptRequested() [1/2]

bool Debugger::InterruptRequested ( )

◆ 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 429 of file Debugger.h.

References InterruptRequested(), and ReportInterruption().

Referenced by lldb::SBCommandInterpreter::WasInterrupted().

◆ IOHandlerThread()

lldb::thread_result_t Debugger::IOHandlerThread ( )
protected

Definition at line 2037 of file Debugger.cpp.

References RunIOHandlers(), and StopEventHandlerThread().

Referenced by StartIOHandlerThread().

◆ IsForwardingEvents()

bool Debugger::IsForwardingEvents ( )

Definition at line 1878 of file Debugger.cpp.

References m_forward_listener_sp.

Referenced by HandleProcessEvent().

◆ IsHandlingEvents()

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

Definition at line 377 of file Debugger.h.

References lldb_private::HostThread::IsJoinable(), and m_event_handler_thread.

◆ IsIOHandlerThreadCurrentThread()

bool Debugger::IsIOHandlerThreadCurrentThread ( ) const
protected

◆ IsTopIOHandler()

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

◆ JoinIOHandlerThread()

void Debugger::JoinIOHandlerThread ( )
protected

◆ LoadPlugin()

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

Definition at line 646 of file Debugger.cpp.

References error(), g_load_plugin_callback, and m_loaded_plugins.

Referenced by LoadPluginCallback().

◆ operator=()

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

◆ PopIOHandler()

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

◆ 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

◆ RemoveDestroyCallback()

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

Remove the specified callback. Return true if successful.

Definition at line 1457 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 1185 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 1593 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 1599 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 1485 of file Debugger.cpp.

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

Referenced by lldb_private::Progress::ReportProgress(), and lldb_private::ProgressManager::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 1587 of file Debugger.cpp.

References lldb::eSeverityWarning, and ReportDiagnosticImpl().

Referenced by 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::ReportRetriever::RetrieveReportData(), lldb_private::InstrumentationRuntimeTSan::RetrieveReportData(), lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData(), lldb_private::DynamicLoaderDarwin::UnloadModuleSections(), lldb_private::AppleObjCRuntimeV2::WarnIfNoClassesCached(), and lldb_private::AppleObjCRuntimeV2::WarnIfNoExpandedSharedCache().

◆ 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 1297 of file Debugger.cpp.

References m_interrupt_mutex, and m_interrupt_requested.

◆ RestoreInputTerminalState()

void Debugger::RestoreInputTerminalState ( )

Definition at line 1066 of file Debugger.cpp.

References m_terminal_state, and lldb_private::TerminalState::Restore().

◆ RunIOHandlerAsync()

void Debugger::RunIOHandlerAsync ( const lldb::IOHandlerSP reader_sp,
bool  cancel_top_handler = true 
)

◆ RunIOHandlers()

void Debugger::RunIOHandlers ( )

◆ RunIOHandlerSync()

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

◆ RunREPL()

Status Debugger::RunREPL ( lldb::LanguageType  language,
const char *  repl_options 
)

◆ SaveInputTerminalState()

void Debugger::SaveInputTerminalState ( )

◆ SetAsyncExecution()

void Debugger::SetAsyncExecution ( bool  async)

◆ SetAutoIndent()

bool Debugger::SetAutoIndent ( bool  b)

Definition at line 564 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 1441 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 1055 of file Debugger.cpp.

References m_error_stream_sp.

◆ SetExternalEditor()

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

Definition at line 398 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetInputFile()

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

Definition at line 1042 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

◆ SetLoggingCallback()

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

Definition at line 1432 of file Debugger.cpp.

References m_callback_handler_sp.

◆ SetOutputFile()

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

Definition at line 1050 of file Debugger.cpp.

References m_output_stream_sp.

◆ SetPrintDecls()

bool Debugger::SetPrintDecls ( bool  b)

Definition at line 575 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetPrompt() [1/2]

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

◆ SetPrompt() [2/2]

void Debugger::SetPrompt ( llvm::StringRef  p)

◆ SetPropertyValue()

Status Debugger::SetPropertyValue ( const ExecutionContext exe_ctx,
VarSetOperationType  op,
llvm::StringRef  property_path,
llvm::StringRef  value 
)
overridevirtual

◆ SetREPLLanguage()

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

Definition at line 362 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetScriptLanguage()

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

Definition at line 352 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetShowProgress()

bool Debugger::SetShowProgress ( bool  show_progress)

Definition at line 422 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

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

◆ SetTabSize()

bool Debugger::SetTabSize ( uint64_t  tab_size)

Definition at line 586 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetTerminalWidth()

bool Debugger::SetTerminalWidth ( uint64_t  term_width)

◆ SettingsInitialize()

void Debugger::SettingsInitialize ( )
static

◆ SettingsTerminate()

void Debugger::SettingsTerminate ( )
static

◆ SetUseColor()

bool Debugger::SetUseColor ( bool  use_color)

Definition at line 409 of file Debugger.cpp.

References GetPrompt(), SetPrompt(), and lldb_private::Properties::SetPropertyAtIndex().

Referenced by Debugger().

◆ SetUseExternalEditor()

bool Debugger::SetUseExternalEditor ( bool  use_external_editor_p)

Definition at line 387 of file Debugger.cpp.

References lldb_private::Properties::SetPropertyAtIndex().

◆ SetUseSourceCache()

bool Debugger::SetUseSourceCache ( bool  use_source_cache)

◆ StartEventHandlerThread()

bool Debugger::StartEventHandlerThread ( )

◆ StartIOHandlerThread()

bool Debugger::StartIOHandlerThread ( )
protected

◆ StopEventHandlerThread()

void Debugger::StopEventHandlerThread ( )

◆ StopIOHandlerThread()

void Debugger::StopIOHandlerThread ( )
protected

◆ Terminate()

void Debugger::Terminate ( )
static

Friends And Related Function Documentation

◆ CommandInterpreter

friend class CommandInterpreter
friend

Definition at line 600 of file Debugger.h.

◆ Progress

friend class Progress
friend

Definition at line 602 of file Debugger.h.

◆ ProgressManager

friend class ProgressManager
friend

Definition at line 603 of file Debugger.h.

◆ REPL

friend class REPL
friend

Definition at line 601 of file Debugger.h.

Member Data Documentation

◆ g_load_plugin_callback

LoadPluginCallbackType Debugger::g_load_plugin_callback = nullptr
staticprotected

Definition at line 728 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 734 of file Debugger.h.

Referenced by DefaultEventHandler(), and GetBroadcaster().

◆ m_broadcaster_manager_sp

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

Definition at line 694 of file Debugger.h.

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

◆ m_callback_handler_sp

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

Definition at line 726 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 736 of file Debugger.h.

Referenced by Clear().

◆ m_command_interpreter_up

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

◆ m_current_event_id

std::optional<uint64_t> lldb_private::Debugger::m_current_event_id
protected

Definition at line 723 of file Debugger.h.

Referenced by HandleProgressEvent().

◆ 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 741 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 738 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 737 of file Debugger.h.

Referenced by Debugger(), and GetDummyTarget().

◆ m_error_stream_sp

lldb::StreamFileSP lldb_private::Debugger::m_error_stream_sp
protected

Definition at line 689 of file Debugger.h.

Referenced by GetErrorFile(), GetErrorStream(), GetErrorStreamSP(), PrintAsync(), and SetErrorFile().

◆ m_event_handler_thread

HostThread lldb_private::Debugger::m_event_handler_thread
protected

Definition at line 731 of file Debugger.h.

Referenced by IsHandlingEvents(), StartEventHandlerThread(), and StopEventHandlerThread().

◆ 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 687 of file Debugger.h.

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

◆ m_input_recorder

repro::DataRecorder* lldb_private::Debugger::m_input_recorder
protected

Used for shadowing the input file when capturing a reproducer.

Definition at line 692 of file Debugger.h.

Referenced by GetInputRecorder().

◆ m_instance_name

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

Definition at line 727 of file Debugger.h.

Referenced by GetInstanceName().

◆ m_interrupt_mutex

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

Definition at line 755 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 754 of file Debugger.h.

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

◆ m_io_handler_stack

IOHandlerStack lldb_private::Debugger::m_io_handler_stack
protected

◆ m_io_handler_synchronous_mutex

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

Definition at line 721 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 704 of file Debugger.h.

Referenced by Clear(), and GetListener().

◆ m_loaded_plugins

LoadedPluginsList lldb_private::Debugger::m_loaded_plugins
protected

Definition at line 730 of file Debugger.h.

Referenced by LoadPlugin().

◆ m_output_flush_mutex

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

Definition at line 682 of file Debugger.h.

Referenced by FlushProcessOutput().

◆ m_output_stream_sp

lldb::StreamFileSP lldb_private::Debugger::m_output_stream_sp
protected

◆ m_platform_list

PlatformList lldb_private::Debugger::m_platform_list
protected

Definition at line 703 of file Debugger.h.

Referenced by Debugger(), and GetPlatformList().

◆ m_script_interpreter_mutex

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

Definition at line 716 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 718 of file Debugger.h.

Referenced by GetScriptInterpreter().

◆ m_source_file_cache

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

Definition at line 709 of file Debugger.h.

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

◆ m_source_manager_up

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

Definition at line 705 of file Debugger.h.

Referenced by GetSourceManager().

◆ m_stream_handlers

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

Definition at line 725 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 733 of file Debugger.h.

Referenced by DefaultEventHandler(), and StartEventHandlerThread().

◆ m_target_list

TargetList lldb_private::Debugger::m_target_list
protected

Definition at line 701 of file Debugger.h.

Referenced by Clear(), GetSelectedOrDummyTarget(), GetSelectedTarget(), and GetTargetList().

◆ m_terminal_state

TerminalState lldb_private::Debugger::m_terminal_state
protected

Definition at line 700 of file Debugger.h.

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


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