EngineDebugger¶
继承: Object
公开内部调试器。
描述¶
EngineDebugger处理编辑器和正在运行的应用之间的通信。它在正在运行的应用中处于活动状态。可以通过它发送/接收消息。它还管理分析器。
方法¶
void |
|
void |
debug(can_continue: bool = true, is_error_breakpoint: bool = false) |
get_depth() const |
|
get_lines_left() const |
|
has_capture(name: StringName) |
|
has_profiler(name: StringName) |
|
void |
insert_breakpoint(line: int, source: StringName) |
is_breakpoint(line: int, source: StringName) const |
|
is_profiling(name: StringName) |
|
is_skipping_breakpoints() const |
|
void |
|
void |
profiler_add_frame_data(name: StringName, data: Array) |
void |
profiler_enable(name: StringName, enable: bool, arguments: Array = []) |
void |
register_message_capture(name: StringName, callable: Callable) |
void |
register_profiler(name: StringName, profiler: EngineProfiler) |
void |
remove_breakpoint(line: int, source: StringName) |
void |
script_debug(language: ScriptLanguage, can_continue: bool = true, is_error_breakpoint: bool = false) |
void |
send_message(message: String, data: Array) |
void |
|
void |
set_lines_left(lines: int) |
void |
|
void |
unregister_profiler(name: StringName) |
方法说明¶
void clear_breakpoints() 🔗
清除所有断点。
void debug(can_continue: bool = true, is_error_breakpoint: bool = false) 🔗
在脚本执行中启动调试中断,可选择根据can_continue指定程序是否可以继续,以及中断是否由断点引起。
实验性: 未来版本中可能会修改或移除该方法。
返回当前调试深度。
实验性: 未来版本中可能会修改或移除该方法。
返回剩余的行数。
bool has_capture(name: StringName) 🔗
如果存在具有给定名称的捕获,则返回true,否则返回false。
bool has_profiler(name: StringName) 🔗
如果存在具有给定名称的分析器,则返回true,否则返回false。
void insert_breakpoint(line: int, source: StringName) 🔗
使用给定的source和line插入新的断点。
如果调试器处于活动状态,则返回true,否则返回false。
bool is_breakpoint(line: int, source: StringName) const 🔗
如果给定的source和line代表现有断点,则返回true。
bool is_profiling(name: StringName) 🔗
如果具有给定名称的分析器存在并处于活动状态,则返回true,否则返回false。
bool is_skipping_breakpoints() const 🔗
如果调试器跳过断点,则返回true,否则false。
void line_poll() 🔗
强制调试器事件的处理循环。此方法的目的只是在脚本可能太忙时不时处理事件,以便可以捕获无限循环等错误。
void profiler_add_frame_data(name: StringName, data: Array) 🔗
使用给定的name和data调用分析器的add可调用对象。
void profiler_enable(name: StringName, enable: bool, arguments: Array = []) 🔗
使用给定的name和arguments调用分析器的toggle可调用。根据enable参数启用/禁用相同的分析器。
void register_message_capture(name: StringName, callable: Callable) 🔗
使用给定的name注册消息捕获。如果name为“my_message”,则将使用给定的可调用对象调用以“my_message:”开头的消息。
可调用对象必须接受消息字符串和数据数组作为参数。如果消息被识别,可调用对象应返回true。
注意:可调用对象将接收前缀被剥离的消息,这与EditorDebuggerPlugin._capture()不同。有关示例,请参阅EditorDebuggerPlugin描述。
void register_profiler(name: StringName, profiler: EngineProfiler) 🔗
使用给定的name注册分析器。有关详细信息,请参阅EngineProfiler。
void remove_breakpoint(line: int, source: StringName) 🔗
删除具有给定source和line的断点。
void script_debug(language: ScriptLanguage, can_continue: bool = true, is_error_breakpoint: bool = false) 🔗
在脚本执行中启动调试中断,可选择根据can_continue指定程序是否可以继续,以及中断是否由断点引起。
void send_message(message: String, data: Array) 🔗
发送带有给定message和data数组的消息。
实验性: 未来版本中可能会修改或移除该方法。
设置当前调试深度。
void set_lines_left(lines: int) 🔗
实验性: 未来版本中可能会修改或移除该方法。
设置剩余的当前调试行。
void unregister_message_capture(name: StringName) 🔗
使用给定的name注销消息捕获。
void unregister_profiler(name: StringName) 🔗
取消注册具有给定name的分析器。