V8 JSON Debugging Protocol, Breakpoints not being set

74 views
Skip to first unread message

WIlliam Taylor

unread,
Oct 16, 2016, 6:32:51 PM10/16/16
to v8-users

Hi,

Apologies if this is a trivial thing. I've been embedding V8 inside my own C++ application and have been working to get the JSON debugging protocol working.

I have a background thread which listens to debugging JSON commands from Visual Studio Code and I forward them to V8 and I send them via v8::Debug::SendCommand. I also then send back JSON responses from V8 by listening for it then sending it to VSCode. Of course I also call v8::Debug::ProcessDebugMessages from time to time to make sure messages are being dealt with. 

Everything works apart from setting breakpoints. VSCode says they are registered however when I call Debug.showAllBreakpoints(FunctionName) via JavaScript no breakpoint has been bound to the JavaScript function even though the JSON V8 sends back to VSCode says it has. There are also no exceptions and no error messages.

I imagine I'm missing something big, anyone got an ideas?.

Thanks in advance, hope I didn't drag on too much :)

V8 version: 5.1.281.84
OS: Windows 10

I was also using this tutorial for a starting point. Specifically the remote debugging section.






Abhishek Singh

unread,
Oct 16, 2016, 11:02:29 PM10/16/16
to v8-u...@googlegroups.com
Maybe this standalone example for V8 JS Debugger might help - https://gist.github.com/abhi-bit/20b8569bc5d655659b51d425564eb49d . I didn’t try it on windows before, but should work there as well.

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WIlliam Taylor

unread,
Oct 17, 2016, 5:00:30 PM10/17/16
to v8-users


Hi Thanks for that,

I already have something like that in my C++ application, basically I print incoming json from VSCode and also outgoing json from V8.

When I connect using a remote debugger I get the following message. This is the only command to fail. I filter out commands where success == true.



Any ideas?

Thanks

Yang Guo

unread,
Oct 20, 2016, 2:38:25 AM10/20/16
to v8-users
I would urge you to use the DevTools protocol instead, used for example in test/inspector/inspector-test.cc

The old JSON debug API is deprecated and going to be removed soon.

Cheers,

Yang

WIlliam Taylor

unread,
Oct 25, 2016, 11:26:39 AM10/25/16
to v8-users

I will certainly like to do that at a later date, but if I could just get the old debugging working first as its the simplest that would be good for my app.

Any ideas on what I could be missing?

Thanks


On Sunday, 16 October 2016 23:32:51 UTC+1, WIlliam Taylor wrote:
Reply all
Reply to author
Forward
0 new messages