Lines Matching full:debugger
1 //===-- Debugger.cpp ------------------------------------------------------===//
9 #include "lldb/Core/Debugger.h"
105 static Debugger::DebuggerList *g_debugger_list_ptr =
111 Debugger::eStopDisassemblyTypeNever,
116 Debugger::eStopDisassemblyTypeNoDebugInfo,
121 Debugger::eStopDisassemblyTypeNoSource,
128 Debugger::eStopDisassemblyTypeAlways,
198 LoadPluginCallbackType Debugger::g_load_plugin_callback = nullptr;
200 Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
273 bool Debugger::GetAutoConfirm() const {
279 const FormatEntity::Entry *Debugger::GetDisassemblyFormat() const {
284 const FormatEntity::Entry *Debugger::GetFrameFormat() const {
289 const FormatEntity::Entry *Debugger::GetFrameFormatUnique() const {
294 uint64_t Debugger::GetStopDisassemblyMaxSize() const {
300 bool Debugger::GetNotifyVoid() const {
306 llvm::StringRef Debugger::GetPrompt() const {
312 llvm::StringRef Debugger::GetPromptAnsiPrefix() const {
318 llvm::StringRef Debugger::GetPromptAnsiSuffix() const {
324 void Debugger::SetPrompt(llvm::StringRef p) {
335 const FormatEntity::Entry *Debugger::GetThreadFormat() const {
340 const FormatEntity::Entry *Debugger::GetThreadStopFormat() const {
345 lldb::ScriptLanguage Debugger::GetScriptLanguage() const {
352 bool Debugger::SetScriptLanguage(lldb::ScriptLanguage script_lang) {
357 lldb::LanguageType Debugger::GetREPLLanguage() const {
362 bool Debugger::SetREPLLanguage(lldb::LanguageType repl_lang) {
367 uint64_t Debugger::GetTerminalWidth() const {
373 bool Debugger::SetTerminalWidth(uint64_t term_width) {
381 bool Debugger::GetUseExternalEditor() const {
387 bool Debugger::SetUseExternalEditor(bool b) {
392 llvm::StringRef Debugger::GetExternalEditor() const {
398 bool Debugger::SetExternalEditor(llvm::StringRef editor) {
403 bool Debugger::GetUseColor() const {
409 bool Debugger::SetUseColor(bool b) {
416 bool Debugger::GetShowProgress() const {
422 bool Debugger::SetShowProgress(bool show_progress) {
427 llvm::StringRef Debugger::GetShowProgressAnsiPrefix() const {
433 llvm::StringRef Debugger::GetShowProgressAnsiSuffix() const {
439 bool Debugger::GetUseAutosuggestion() const {
445 llvm::StringRef Debugger::GetAutosuggestionAnsiPrefix() const {
451 llvm::StringRef Debugger::GetAutosuggestionAnsiSuffix() const {
457 llvm::StringRef Debugger::GetRegexMatchAnsiPrefix() const {
463 llvm::StringRef Debugger::GetRegexMatchAnsiSuffix() const {
469 bool Debugger::GetShowDontUsePoHint() const {
475 bool Debugger::GetUseSourceCache() const {
481 bool Debugger::SetUseSourceCache(bool b) {
489 bool Debugger::GetHighlightSource() const {
495 StopShowColumn Debugger::GetStopShowColumn() const {
502 llvm::StringRef Debugger::GetStopShowColumnAnsiPrefix() const {
508 llvm::StringRef Debugger::GetStopShowColumnAnsiSuffix() const {
514 llvm::StringRef Debugger::GetStopShowLineMarkerAnsiPrefix() const {
520 llvm::StringRef Debugger::GetStopShowLineMarkerAnsiSuffix() const {
526 uint64_t Debugger::GetStopSourceLineCount(bool before) const {
533 Debugger::StopDisassemblyType Debugger::GetStopDisassemblyDisplay() const {
535 return GetPropertyAtIndexAs<Debugger::StopDisassemblyType>(
536 idx, static_cast<Debugger::StopDisassemblyType>(
540 uint64_t Debugger::GetDisassemblyLineCount() const {
546 bool Debugger::GetAutoOneLineSummaries() const {
552 bool Debugger::GetEscapeNonPrintables() const {
558 bool Debugger::GetAutoIndent() const {
564 bool Debugger::SetAutoIndent(bool b) {
569 bool Debugger::GetPrintDecls() const {
575 bool Debugger::SetPrintDecls(bool b) {
580 uint64_t Debugger::GetTabSize() const {
586 bool Debugger::SetTabSize(uint64_t tab_size) {
591 lldb::DWIMPrintVerbosity Debugger::GetDWIMPrintVerbosity() const {
598 #pragma mark Debugger
601 // Debugger::GetSettings() const
607 void Debugger::Initialize(LoadPluginCallbackType load_plugin_callback) {
609 "Debugger::Initialize called more than once!");
616 void Debugger::Terminate() {
618 "Debugger::Terminate called without a matching Debugger::Initialize!");
622 for (const auto &debugger : *g_debugger_list_ptr)
623 debugger->HandleDestroyCallback();
632 // Clear our global list of debugger objects
635 for (const auto &debugger : *g_debugger_list_ptr)
636 debugger->Clear();
642 void Debugger::SettingsInitialize() { Target::SettingsInitialize(); }
644 void Debugger::SettingsTerminate() { Target::SettingsTerminate(); }
646 bool Debugger::LoadPlugin(const FileSpec &spec, Status &error) {
674 Debugger *debugger = (Debugger *)baton;
692 debugger->LoadPlugin(plugin_file_spec, plugin_load_error);
708 void Debugger::InstanceInitialize() {
734 DebuggerSP Debugger::CreateInstance(lldb::LogOutputCallback log_callback,
736 DebuggerSP debugger_sp(new Debugger(log_callback, baton));
745 void Debugger::HandleDestroyCallback() {
765 void Debugger::Destroy(DebuggerSP &debugger_sp) {
796 Debugger::FindDebuggerWithInstanceName(llvm::StringRef instance_name) {
811 TargetSP Debugger::FindTargetWithProcessID(lldb::pid_t pid) {
825 TargetSP Debugger::FindTargetWithProcess(Process *process) {
839 llvm::StringRef Debugger::GetStaticBroadcasterClass() {
840 static constexpr llvm::StringLiteral class_name("lldb.debugger");
844 Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
853 m_listener_sp(Listener::MakeListener("lldb.Debugger")),
860 m_sync_broadcaster(nullptr, "lldb.debugger.sync"),
864 // Initialize the debugger properties as early as possible as other parts of
882 "Settings specify to the debugger's command interpreter.", true,
943 Debugger::~Debugger() { Clear(); }
945 void Debugger::Clear() {
950 // The following functions call Debugger::Clear():
951 // Debugger::~Debugger();
952 // static void Debugger::Destroy(lldb::DebuggerSP &debugger_sp);
953 // static void Debugger::Terminate();
980 bool Debugger::GetAsyncExecution() {
984 void Debugger::SetAsyncExecution(bool async_execution) {
988 repro::DataRecorder *Debugger::GetInputRecorder() { return m_input_recorder; }
999 Status Debugger::SetInputString(const char *data) {
1042 void Debugger::SetInputFile(FileSP file_sp) {
1050 void Debugger::SetOutputFile(FileSP file_sp) {
1055 void Debugger::SetErrorFile(FileSP file_sp) {
1060 void Debugger::SaveInputTerminalState() {
1066 void Debugger::RestoreInputTerminalState() { m_terminal_state.Restore(); }
1068 ExecutionContext Debugger::GetSelectedExecutionContext() {
1074 void Debugger::DispatchInputInterrupt() {
1081 void Debugger::DispatchInputEndOfFile() {
1088 void Debugger::ClearIOHandlers() {
1089 // The bottom input reader should be the main debugger input reader. We do
1099 void Debugger::RunIOHandlers() {
1124 void Debugger::RunIOHandlerSync(const IOHandlerSP &reader_sp) {
1155 bool Debugger::IsTopIOHandler(const lldb::IOHandlerSP &reader_sp) {
1159 bool Debugger::CheckTopIOHandlerTypes(IOHandler::Type top_type,
1164 void Debugger::PrintAsync(const char *s, size_t len, bool is_stdout) {
1173 llvm::StringRef Debugger::GetTopIOHandlerControlSequence(char ch) {
1177 const char *Debugger::GetIOHandlerCommandPrefix() {
1181 const char *Debugger::GetIOHandlerHelpPrologue() {
1185 bool Debugger::RemoveIOHandler(const IOHandlerSP &reader_sp) {
1189 void Debugger::RunIOHandlerAsync(const IOHandlerSP &reader_sp,
1194 void Debugger::AdoptTopIOHandlerFilesIfInvalid(FileSP &in, StreamFileSP &out,
1198 // input reader's in/out/err streams, or fall back to the debugger file
1235 void Debugger::PushIOHandler(const IOHandlerSP &reader_sp,
1262 bool Debugger::PopIOHandler(const IOHandlerSP &pop_reader_sp) {
1289 StreamSP Debugger::GetAsyncOutputStream() {
1293 StreamSP Debugger::GetAsyncErrorStream() {
1297 void Debugger::RequestInterrupt() {
1302 void Debugger::CancelInterruptRequest() {
1308 bool Debugger::InterruptRequested() {
1310 // if there's a debugger interrupt and we aren't on the IOHandler thread,
1320 Debugger::InterruptionReport::InterruptionReport(
1329 void Debugger::ReportInterruption(const InterruptionReport &report) {
1335 Debugger::DebuggerList Debugger::DebuggersRequestingInterruption() {
1347 size_t Debugger::GetNumDebuggers() {
1355 lldb::DebuggerSP Debugger::GetDebuggerAtIndex(size_t index) {
1367 DebuggerSP Debugger::FindDebuggerWithID(lldb::user_id_t id) {
1383 bool Debugger::FormatDisassemblerAddress(const FormatEntity::Entry *format,
1425 void Debugger::AssertCallback(llvm::StringRef message,
1428 Debugger::ReportError(
1432 void Debugger::SetLoggingCallback(lldb::LogOutputCallback log_callback,
1441 void Debugger::SetDestroyCallback(
1449 lldb::callback_token_t Debugger::AddDestroyCallback(
1457 bool Debugger::RemoveDestroyCallback(lldb::callback_token_t token) {
1469 static void PrivateReportProgress(Debugger &debugger, uint64_t progress_id,
1475 if (!debugger.GetBroadcaster().EventTypeHasListeners(progress_broadcast_bit))
1482 debugger.GetBroadcaster().BroadcastEvent(event_sp);
1485 void Debugger::ReportProgress(uint64_t progress_id, std::string title,
1490 // Check if this progress is for a specific debugger.
1492 // It is debugger specific, grab it and deliver the event if the debugger
1502 // The progress event is not debugger specific, iterate over all debuggers
1514 static void PrivateReportDiagnostic(Debugger &debugger, Severity severity,
1530 Broadcaster &broadcaster = debugger.GetBroadcaster();
1533 // diagnostic directly to the debugger's error stream.
1536 StreamSP stream = debugger.GetAsyncErrorStream();
1546 void Debugger::ReportDiagnosticImpl(Severity severity, std::string message,
1562 // Check if this diagnostic is for a specific debugger.
1564 // It is debugger specific, grab it and deliver the event if the debugger
1572 // The diagnostic event is not debugger specific, iterate over all debuggers
1576 for (const auto &debugger : *g_debugger_list_ptr)
1577 PrivateReportDiagnostic(*debugger, severity, message, false);
1587 void Debugger::ReportWarning(std::string message,
1593 void Debugger::ReportError(std::string message,
1599 void Debugger::ReportInfo(std::string message,
1605 void Debugger::ReportSymbolChange(const ModuleSpec &module_spec) {
1633 bool Debugger::EnableLog(llvm::StringRef channel,
1684 Debugger::GetScriptInterpreter(bool can_create,
1700 SourceManager &Debugger::GetSourceManager() {
1707 void Debugger::HandleBreakpointEvent(const EventSP &event_sp) {
1754 void Debugger::FlushProcessOutput(Process &process, bool flush_stdout,
1774 void Debugger::HandleProcessEvent(const EventSP &event_sp) {
1861 void Debugger::HandleThreadEvent(const EventSP &event_sp) {
1877 bool Debugger::IsForwardingEvents() { return (bool)m_forward_listener_sp; }
1879 void Debugger::EnableForwardEvents(const ListenerSP &listener_sp) {
1883 void Debugger::CancelForwardEvents(const ListenerSP &listener_sp) {
1887 lldb::thread_result_t Debugger::DefaultEventHandler() {
1988 bool Debugger::StartEventHandlerThread() {
1994 ConstString full_name("lldb.debugger.event-handler");
2028 void Debugger::StopEventHandlerThread() {
2036 lldb::thread_result_t Debugger::IOHandlerThread() {
2042 void Debugger::HandleProgressEvent(const lldb::EventSP &event_sp) {
2055 << static_cast<void *>(this) << " Debugger(" << GetID()
2127 void Debugger::HandleDiagnosticEvent(const lldb::EventSP &event_sp) {
2136 bool Debugger::HasIOHandlerThread() const {
2140 HostThread Debugger::SetIOHandlerThread(HostThread &new_thread) {
2146 bool Debugger::StartIOHandlerThread() {
2149 "lldb.debugger.io-handler", [this] { return IOHandlerThread(); },
2161 void Debugger::StopIOHandlerThread() {
2168 void Debugger::JoinIOHandlerThread() {
2176 bool Debugger::IsIOHandlerThreadCurrentThread() const {
2182 Target &Debugger::GetSelectedOrDummyTarget(bool prefer_dummy) {
2190 Status Debugger::RunREPL(LanguageType language, const char *repl_options) {
2234 llvm::ThreadPoolInterface &Debugger::GetThreadPool() {
2236 "Debugger::GetThreadPool called before Debugger::Initialize");