Re: Setting breakpoints

James Ross <[email protected]>
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Dassburger wrote:
> I tried to solve this by storing breakpoint lines and setting a hook at
> the start of toplevel script execution. In the hook handler
> JSD_SetExecutionHook is called for each breakpoint. But again, there
> are problems, as toplevel code, and code inside functions belong to
> different JSDScripts and I have no idea how to figure out which line
> belongs to which script.

You're close - the right way is to set it when the script that contains 
the line is loaded using script.baseLineNumber and script.lineExtent.

The debugger notifies you of each script as it is loaded (top-level 
always comes first), and you just need to set the breakpoint in each 
that overlaps the line (you can check if the line is executable within 
that script, but I don't think you have to).

-- 
James Ross <[email protected]>
ChatZilla Developer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.