MCPcopy Create free account
hub / github.com/Icinga/icinga2 / BreakpointHandler

Method BreakpointHandler

lib/cli/consolecommand.cpp:119–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void ConsoleCommand::BreakpointHandler(ScriptFrame& frame, ScriptError *ex, const DebugInfo& di)
120{
121 static std::mutex mutex;
122 std::unique_lock<std::mutex> lock(mutex);
123
124 if (!Application::GetScriptDebuggerEnabled())
125 return;
126
127 if (ex && ex->IsHandledByDebugger())
128 return;
129
130 std::cout << "Breakpoint encountered.\n";
131
132 if (ex) {
133 std::cout << "Exception: " << DiagnosticInformation(*ex) << "\n";
134 ex->SetHandledByDebugger(true);
135 } else
136 ShowCodeLocation(std::cout, di);
137
138 std::cout << "You can inspect expressions (such as variables) by entering them at the prompt.\n"
139 << "To leave the debugger and continue the program use \"$continue\".\n"
140 << "For further commands see \"$help\".\n";
141
142#ifdef HAVE_EDITLINE
143 rl_completion_entry_function = ConsoleCommand::ConsoleCompleteHelper;
144 rl_completion_append_character = '\0';
145#endif /* HAVE_EDITLINE */
146
147 ConsoleCommand::RunScriptConsole(frame);
148}
149
150void ConsoleCommand::StaticInitialize()
151{

Callers

nothing calls this directly

Calls 2

IsHandledByDebuggerMethod · 0.80
SetHandledByDebuggerMethod · 0.80

Tested by

no test coverage detected