| 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 | { |
nothing calls this directly
no test coverage detected