Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [atf-dev] Breakpoint matching in the ATF debugger

Hello, John,

Thanks for the quick response!

John J. Barton wrote:
Right, except when it's not ;-). The Mozilla engine labels eval buffers with the file name of the function that calls eval(). These line numbers overlap the original file. So for breakpoints in eval() buffers you can't use this approach.

What I did in Firebug 1.2 was create a covering object for each compilation unit. (eg file, eval-buffer, event-buffer). Each unit has a unique id, a URL-like string. For files, the ID is the jsdIScript.fileName; for eval buffers its the jsdIScript.fileName plus "/" plus the MD5 hash of the source in the buffer. Just after a unit is compiled, I look thru the list of breakpoints for any that apply to this unit. If yes, I set the breakpoint on the jsdIScript.
Ah, thanks. That ought to save me quite a lot of time. :-) I am going to try to do the same thing, and maybe store the unique ID as a marker property (or something) when the breakpoint is actually placed. Then all I have to do is recompute and match when it's hit. I ended up finding that there is already some logic in place to do the matching for URLs and workspace resources (found it in method JSSourceLocator#matches), but your advice will be invaluable when the time to do it for eval actually comes, and made some things clearer in my head.
If you want to look at the Firebug source, you can probably make sense of it by working back from the mozilla APIs calls shared with your project. If you do, for sure use
http://fbug.googlecode.com/svn/branches/firebug1.2
as this code makes much more sense than the 1.1 version. At least I hope ;-)
I'm on it. :-)
So, I was wondering. Is it safe to assume that this transformation is
regular, I mean, that it's always performed in the same way for all
servers we may want to debug on? If so, then the problem is easy to
solve, and my current implementation will work fine. If not, then is
there a standard way to know which kinds of path manipulations has the
deployment process performed?
I created my own solution for this in fireclipse; any solution will be http-server dependent, but eclipse could and should offer a standard mapping for all eclipse-embedded or configured servers. You may need to ask on one of the Wxx eclipse forums.
OK, thanks again!

Best regards,

Giuliano



Back to the top