| 734 | } |
| 735 | |
| 736 | RemoteDebugger::RemoteDebugger(Ref<RemoteDebuggerPeer> p_peer) { |
| 737 | peer = p_peer; |
| 738 | max_chars_per_second = GLOBAL_GET("network/limits/debugger/max_chars_per_second"); |
| 739 | max_errors_per_second = GLOBAL_GET("network/limits/debugger/max_errors_per_second"); |
| 740 | max_warnings_per_second = GLOBAL_GET("network/limits/debugger/max_warnings_per_second"); |
| 741 | |
| 742 | // Performance Profiler |
| 743 | Object *perf = Engine::get_singleton()->get_singleton_object("Performance"); |
| 744 | if (perf) { |
| 745 | performance_profiler.instantiate(perf); |
| 746 | performance_profiler->bind("performance"); |
| 747 | profiler_enable("performance", true); |
| 748 | } |
| 749 | |
| 750 | // Core and profiler captures. |
| 751 | Capture core_cap(this, |
| 752 | [](void *p_user, const String &p_cmd, const Array &p_data, bool &r_captured) { |
| 753 | return static_cast<RemoteDebugger *>(p_user)->_core_capture(p_cmd, p_data, r_captured); |
| 754 | }); |
| 755 | register_message_capture("core", core_cap); |
| 756 | Capture profiler_cap(this, |
| 757 | [](void *p_user, const String &p_cmd, const Array &p_data, bool &r_captured) { |
| 758 | return static_cast<RemoteDebugger *>(p_user)->_profiler_capture(p_cmd, p_data, r_captured); |
| 759 | }); |
| 760 | register_message_capture("profiler", profiler_cap); |
| 761 | |
| 762 | // Error handlers |
| 763 | phl.printfunc = _print_handler; |
| 764 | phl.userdata = this; |
| 765 | add_print_handler(&phl); |
| 766 | |
| 767 | eh.errfunc = _err_handler; |
| 768 | eh.userdata = this; |
| 769 | add_error_handler(&eh); |
| 770 | |
| 771 | messages.insert(Thread::get_main_id(), List<Message>()); |
| 772 | } |
| 773 | |
| 774 | RemoteDebugger::~RemoteDebugger() { |
| 775 | remove_print_handler(&phl); |
nothing calls this directly
no test coverage detected