支持断点
¥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.