AlexTrotsenko / j2v8-debugger

This project is an add-on for the excellent J2V8 Project. It allows users to debug JS running in V8 using Chrome DevTools. Uses Stetho for communication with Chrome DevTools.
88 stars 24 forks source link

Can not pause while script is running #15

Open zhangjiagege opened 3 years ago

zhangjiagege commented 3 years ago

Hi, When I running a script by ExecutorService.execute,cause this is a single thread executor,so before this script complete,I can not pause executing by V8Inspector.dispatchProtocolMessage("{ \"id\": 1, \"method\": \"Debugger.pause\" }"),actually,I can not do anything using dispatchProtocolMessage,because they're in diffrent thread,also can not use ExecutorService.execute to invoke V8Inspector.dispatchProtocolMessage because the script not complete this time.

AlexTrotsenko commented 3 years ago

@zhangjiagege indeed there are some limitations with current implementation, however they looks rather essential.

Have you tried to run sample app and debug usage of pause/resume method here? Does it works for you? https://github.com/AlexTrotsenko/j2v8-debugger/blob/65b456cf49834ed00f553b5b074803ec578cc0c0/j2v8-debugger/src/main/java/com/alexii/j2v8debugger/Debugger.kt#L176