支持断点


【Support of breakpoints】

Chrome DevTools 协议 Debugger 允许 inspector.Session 附加到一个程序,并设置断点以逐步执行代码。

【The Chrome DevTools Protocol Debugger domain allows an inspector.Session to attach to a program and set breakpoints to step through the codes.】

然而,应该避免在通过 session.connect() 连接的同线程 inspector.Session 中设置断点,因为被附加并暂停的程序正是调试器本身。相反,可以尝试通过 session.connectToMainThread() 连接到主线程,并在工作线程中设置断点,或者通过 WebSocket 连接到 调试器 程序。

【However, setting breakpoints with a same-thread inspector.Session, which is connected by session.connect(), should be avoided as the program being attached and paused is exactly the debugger itself. Instead, try connect to the main thread by session.connectToMainThread() and set breakpoints in a worker thread, or connect with a Debugger program over WebSocket connection.】