MCPcopy Create free account
hub / github.com/covscript/covscript / add_func

Method add_func

sources/debugger.cpp:173–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 std::size_t add_func(cs::var function)
174 {
175 if (function.type() == typeid(cs::object_method))
176 function = function.const_val<cs::object_method>().callable;
177 else if (function.type() != typeid(cs::callable))
178 throw cs::runtime_error("Debugger just can break at specific line or function.");
179 const cs::callable::function_type &target = function.const_val<cs::callable>().get_raw_data();
180 if (target.target_type() != typeid(cs::function_ptr))
181 throw cs::runtime_error("Debugger can not break at CNI function.");
182 target.target<cs::function_ptr>()->fptr->set_debugger_state(true);
183 m_breakpoints.emplace_front(++m_id, function);
184 return m_id;
185 }
186
187 std::size_t add_pending(const std::string &func)
188 {

Callers

nothing calls this directly

Calls 3

runtime_errorClass · 0.85
typeMethod · 0.80
set_debugger_stateMethod · 0.80

Tested by

no test coverage detected