Here is how the breakpoints work:

A click on the Script panel lands on a HTML element in a sourcebox
matched to a URL. The click is analyzed for the line number and
sourcefile.  Not too much can go wrong since the line number is
directly in the HTML and the sourcefile object is attached to the
sourcebox (view).

The line number and sourcefile are sent from the UI to "fbs" ==
firebug-service, the layer that interfaces to Firefox. The URL and
filename are stored as-is in case the page is reloaded. Then the
sourcefile is analyzed to find the functions mapping to the line
number (confusingly Firefox refers to functions as "scripts"). We can
come up with zero, one, or more than one script at a line. Zero can
mean lots of things: the line was not executable, the debugger was not
active then the source was compiled, the mapping of lines to source is
messed up, or firebug lost track of scripts for some reason. Only the
live scripts at the time of compilation are stored.  Currently the UI
does not give you any hint that zero was the answer.  Zero does not
necessarily mean the breakpoint will not hit.  More than one function
can match, esp in compressed or otherwise odd source.  All will be
breakpointed.

For each function, the line is converted to a program counter (PC)
within the script (..er function). This conversion fails if the
baseline offset for the function is wrong. Firefox has funky offsets
plus we do a lot of conversion to deal with eval(). But generally this
works ok. Then the breakpoint is set on that PC.

Then the UI is updated. It would be nice if the UI could give you some
feedback on the number of functions set, including zero.

When you run, the JS engine halts on a PC in a script (function). That
script is looked up in all of the sourceFiles for the page and PC is
mapped to a line number. Then the UI is moved to that sourceFile and
line number with a signal to highlight the line (via a timed CSS class
setting) and the executable mark added (also via CSS class).

So now you know all of the secrets. Why does it break sometimes for
you and not other times? Well it could be any number of issues as you
can see. If you provide a test case in a bug report we can know for
sure.

jjb

On May 11, 2:18 pm, Matic <[email protected]> wrote:
> Hello.  Can someone tell me why firebug sometimes breaks at a
> breakpoint but at other times doesn't? Is there some secret? I'm
> trying to debug an open-social application within a container.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to