Hi,
I have a few questions about inspector/JS debugging feature. I am trying to get a JS frame after pausing script execution due to breakpoint reach. If I understand good the „pausedScript” event that is send to my InspectorClient class via the sendMessageToFrontend function should has JS frame that I looking for.

{"type":"event","event":"pausedScript","data":{"callFrames":null}}

But the callFrames field is null. The “callFrames” field is filed by an InspectorDebuggerAgent::currentCallFrames() function. Could you tell me what is an InjectedScriptHost class what is the purpose of this class and how I should use this object to get a callFrame? Maybe I have forgotten to dispatch some commands? What commands should be dispatched via an InspectorBackendDispatcher object to get a callFrame after JS execution pause?

For test purpose I have written a code:

InspectorDebuggerAgent::currentCallFrames()
{
JavaScriptCallFrame* frame = ScriptDebugServer::shared().currentCallFrame();
        if (!frame)
        {       
                fprintf(stderr, "source: %d\n", frame->sourceID());
                fprintf(stderr, "line:   %d\n", frame->line());
                fprintf(stderr, "function:   %s\n", 
frame->functionName().ascii().data());
        
                JSC::JSGlobalObject *gobject = frame->dynamicGlobalObject(); 
                JSC::ExecState* exec = gobject->JSGlobalObject::globalExec();
                if (exec)
                        fprintf(stderr, "function parameters: %d \n", 
exec->argumentCount());              
        }

But exec->argumentCount returns invalid parameters count.

Best regards,
Tomasz Morawski
_______________________________________________
webkit-help mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-help

Reply via email to