On Fri, Sep 30, 2016 at 11:34 AM, Zac Hansen <[email protected]> wrote:
> I'm calling:
>
>             debug_context->run("let bp = 
> Debug.setBreakPointByScriptIdAndPosition("some stuff");
>
>
> and getting a callback to my registered callback, but I have no idea what to 
> do with what I'm getting in my callback.
>
> An example of the data I get back is:
>
> GetEventData
> {script_: {context_: {data_: undefined, handle_: 0, type_: "context"}, 
> handle_: 1, script_: {}, type_: "script"}, type_: 5}
>
> GetExecutionState
> {break_id: 7, selected_frame: 0}
>
>
> But I don't understand what it wants from me.
>
> Also, how do I find out what the parameters to the Debug javascript object 
> even are?
>
> I'm looking at this: https://github.com/v8/v8/blob/master/src/debug/debug.js
>
> and, for example, if I want to call
>
> Debug.setBreakPointByScriptIdAndPosition = function(script_id, position,
>
> condition, enabled,
>
> opt_position_alignment)
>
> What is a "position"?
>
> Are there examples of how to use this somewhere?
>
> Thank you.
>
> --Zac

'position' is the offset from the start of the script.  V8 rounds it
down to the nearest statement unless you also pass
Debug.BreakPositionAlignment.BreakPosition.

The execution state is what lets you inspect the program inside your
debug listener.  Grep for 'ExecutionState' in src/debug/debug.js.

As an example, execState.frame(0).localName(0) returns the name of the
first local variable of the function containing the breakpoint.  Grep
for 'FrameMirror' in src/debug/mirrors.js to see what other properties
and methods are available.

-- 
-- 
v8-users mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to