> On 03-Aug-2016, at 3:48 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:
> 
> On Wed, Aug 3, 2016 at 11:40 AM, Abhishek Singh
> <singhabhishek....@gmail.com> wrote:
>> Hi Ben,
>> 
>> Apologies for not providing the background. I’m trying to leverage C++ API 
>> to drive V8 JSON debugger for embedded V8 use case, not sure if leveraging 
>> JS API to drive debugger would be of utility in this situation. Here is high 
>> level workflow pipeline for this use case:
>> 
>> * There is a Golang server that listens on some sockets and receives 
>> json/base64 encoded docs
>> * Golang guy pipelines the docs to CGO to embedded C++ V8 
>> implementation(primarily extending some functionalities that JS provides by 
>> default).
>> * Golang server gets http calls encapsulating different JSON based V8 
>> debugger request commands and(CGO <-> V8 communication happens) accordingly 
>> execution of user supplied code to be executed by embedded v8 needs to 
>> pause/continue etc
>> 
>> =========
>> 
>> Based on this use case, I very likely need to leverage 
>> v8::Debug::SetMessageHandler and v8::Debug::SendCommand apis to handle user 
>> requests to enforce breakpoints/continue/evaluate etc. So I was hoping if 
>> anyone could share sample standalone code on top of C++ V8 debugger api(if 
>> they have it lying somewhere around).
> 
> In that case perhaps you can look at test/cctest/test-debug.cc for 
> inspiration?
> 

Yeah, I referred to it for initial implementation - at least I’m getting 
response codes to requests properly. I’ll tell you current problem I’ve:

* I’m asked V8 to setup breakpoint(line#2 column#0) on using JSON protocol and 
I got success message as response -

{"seq":1,"request_seq":579,"type":"response","command":"setbreakpoint","success":true,"body":{"type":"scriptId","breakpoint":1,"script_id":37,"line":2,"column":0,"actual_locations":[{"line":3,"column":2,"script_id":37}]},"refs":[],"running":true}
 

Function against which this BP has seen setup looks something like this:

1 function OnUpdate(doc, meta) {
2       log(meta.key);
3      if (meta.type === “json”) {
4               log(doc);
5       }
6 }


* Given that set breakpoint call returned success, I was expecting OnUpdate() 
function to pause execution at the breakpoint when function is called 
next(until I fire continue call). But what I observe “OnUpdate” continues 
business as usual i.e. as if no BP has been set. 

Not sure what exactly I’m missing here. I suppose I might need to AssignContext 
like it’s done in node[0] and probably fetch the Context under which debug 
commands were setup inside MessageHandler[1]


[0]https://github.com/nodejs/node/blob/master/src/debug-agent.cc#L122-L123
[1]https://github.com/nodejs/node/blob/master/src/debug-agent.cc#L315-L318


> -- 
> -- 
> v8-users mailing list
> v8-users@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to