Appreciate your help so far.

Sample user JS code[0] looks like this now:

{code}
function OnUpdate(doc, meta) {
  log("doc meta id: ", meta.key);

  if (meta.type === "json" && doc.ssn) {
  ..
  ..  
   }
}

Debug = debug.Debug;
log(Debug.showBreakPoints(OnUpdate));

Function OnDelete() {}
// more functions
{code}

===


* Fired command:

{"command": "setbreakpoint", "type": "request", "arguments": {"type": 
"function", "target": "OnUpdate"}, "seq": 862}

* show.BreakPoints(“OnUpdate”) dumps the function definition:

"(doc, meta) {\n  log(\"doc meta id: \", meta.key);\n\n  if (meta.type === 
\"json\" ) {\n    log(\"doc.ssn field: \", doc.ssn);\n\n    updated_doc = 
CalculateCreditScore(doc)\n    credit_bucket[meta.key] = updated_doc;\n\n    
var value = credit_bucket[meta.key];\n\n    //delete 
credit_bucket[meta.key];\n\n    var d = new Date();\n    var n = 
ISODateString(d);\n    log(\"ISO 8601: \", n);\n\n    
registerCallback(\"CallbackFunc1\", meta.key, n);\n    order_queue[meta.key];\n 
 }\n}"

I guess it confirms that breakpoint has been set using C++ apis

===

One new problem that I see now, when I’ve :

{code}
Debug = debug.Debug;
log(Debug.showBreakPoints(OnUpdate));
{code}

as part of user JS code, I see a crash from V8 when “Call” to “OnUpdate”[1] is 
made . All I get from V8 about that crash was:

fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x4dc05f1]

Could I get a bit more verbose error message, which I could make sense of? :)

BTW Ben, do you hang around on any IRC room? Understand you’re much busy, but I 
suppose I can fix things much sooner on my end using your help via IRC 
communication than email :) Else I could continue using this thread.

[0] https://github.com/abhi-bit/eventing/blob/master/go_eventing/handle_event.js
[1] 
https://github.com/abhi-bit/eventing/blob/master/worker/binding/worker.cc#L990

> On 04-Aug-2016, at 1:10 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:
> 
> On Thu, Aug 4, 2016 at 6:50 AM, Abhishek Singh
> <singhabhishek....@gmail.com> wrote:
>> 
>>> On 03-Aug-2016, at 8:13 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:
>>> 
>>> Quick sanity check: what does Debug.showBreakPoints() print for that
>>> function after setting the breakpoint?
>> 
>> Just to confirm, is below the right way to leverage JS Debug API in a user 
>> supplied JS code? (I tried setting up breakpoint against OnUpdate earlier)
>> 
>> function OnUpdate(doc, meta) {
>>        log(meta.key);
>> 
>>        // Flags: —expose-debug-as debug
>>        Debug = debug.Debug;
>>        log(debug.showBreakPoints(OnUpdate))
>> 
>>       if (meta.type === “json”) {
>>                log(doc);
>>        }
>> }
>> 
>> Above JS code doesn’t compile, error message:
>> 
>> Exception message: undefined:5
>>  Debug = debug.Debug;
>>          ^
>> ReferenceError: debug is not defined
>>    at OnUpdate (<anonymous>:5:11)
> 
> You need to pass —expose-debug-as debug on the command line or through
> v8::V8::SetFlagsFromString().
> 
> -- 
> -- 
> 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