Debugger Client API: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 107: Line 107:
   });
   });
}</pre>  
}</pre>  
== Handling pause events<br> ==
== Handling pause events<br> ==


When the debugger enters a paused state, it's a good opportunity for the application to request a list of stack frames and source scripts:  
When the debugger enters a paused state, it's a good opportunity for the application to request a list of stack frames and source scripts:  
Line 116: Line 116:
   // Get the scripts loaded in the server's source script cache.
   // Get the scripts loaded in the server's source script cache.
   client.activeThread.fillScripts();
   client.activeThread.fillScripts();
}</pre>
}</pre>  
== Handling new frames<br> ==
== Handling new frames<br> ==
 
foo
 
boo


 
When a framesadded event is fired, the application can examine the list of frames in the server:<br>
 
<br>  
<pre>function onFrames()
<pre>function onFrames()
{
{
Line 134: Line 128:
     inspectFrame(frame);
     inspectFrame(frame);
   }
   }
}
}</pre>
== Handling new scripts<br> ==


/**
When a scriptsadded event is fired, the application can examine the list of available source scripts in the server:<br>
* Handler for scriptsadded events.
<pre>function onScripts()
*/
function onScripts()
{
{
   // Get the list of scripts in the server.
   // Get the list of scripts in the server.
Line 146: Line 139:
     dump("script: " + script.toSource() + "\n");
     dump("script: " + script.toSource() + "\n");
   }
   }
}
</pre>
boo


  // Resume execution, since this is the last thing going on in the paused
<br>
  // state and there is no UI in this program. Wait a bit so that object
  // inspection has a chance to finish.
  setTimeout(function() {
    threadClient.resume();
  }, 1000);
}


/**
<br>
<pre>/**
  * Helper function to inspect the provided frame.
  * Helper function to inspect the provided frame.
  */
  */
Confirmed users
231

edits

Navigation menu