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

Function dbg_eval_with_value

lib/cli/consolecommand.cpp:85–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85extern "C" void dbg_eval_with_value(const Value& value, const char *text)
86{
87 std::unique_ptr<Expression> expr;
88
89 try {
90 ScriptFrame frame(true);
91 frame.Locals = new Dictionary({
92 { "arg", value }
93 });
94 expr = ConfigCompiler::CompileText("<dbg>", text);
95 Value result = Serialize(expr->Evaluate(frame), 0);
96 dbg_inspect_value(result);
97 } catch (const std::exception& ex) {
98 std::cout << "Error: " << DiagnosticInformation(ex) << "\n";
99 }
100}
101
102extern "C" void dbg_eval_with_object(Object *object, const char *text)
103{

Callers

nothing calls this directly

Calls 2

dbg_inspect_valueFunction · 0.85
EvaluateMethod · 0.80

Tested by

no test coverage detected