> > A way to approach this is to set breakpoints on all lines and keep > > resuming the JS. So when the breakpoints are reached, the JSD > > setbreakpointHook can tell the frame info. However, it is quite slow > > and unpractical. I don't know about any better way.
> I will also want to know the time the line is executed. There is now time-stamp coming from JSD2 so, you'll need to use (new Date()).getTime() You can also take a look at the built in profiler... https://developer.mozilla.org/en-US/docs/Performance/Profiling_with_the_Built-in_Profiler Honza On Mar 20, 9:44 pm, MMTY <[email protected]> wrote: > And on the reslut(#9 -> #1 -> #2 -> #3 -> #4), I will also want to know the > time the line is executed. > > Thanks! > > > > > > > > On Wed, Mar 20, 2013 at 1:43 PM, MMTY <[email protected]> wrote: > > Hi Honza > > > Thank you for your reply. > > > Look at this example: > > > #1 function callMe(){ > > #2 if(true){ > > #3 var a = 1; > > #4 var b = 2; > > #5 }else{ > > #6 var c = 10; > > #7 } > > #8 } > > #9 callMe(); > > > I want to develop a extension for firebug to add some debugging > > functionality that can give the execution trace in order, so the result > > will look like this: > > #9 -> #1 -> #2 -> #3 -> #4 > > > I looked through the firebug code and the JSD component. > > The getLineOffsets() only check if the line is valid for execution. > > A way to approach this is to set breakpoints on all lines and keep > > resuming the JS. So when the breakpoints are reached, the JSD > > setbreakpointHook can tell the frame info. However, it is quite slow > > and unpractical. > > > Any thoughts? Thank you! > > > On Wed, Mar 20, 2013 at 12:44 AM, Jan Honza Odvarko > > <[email protected]>wrote: > > >> On Mar 19, 7:34 pm, MMTY <[email protected]> wrote: > >> > Thank you. Is it possible to get the line execution trace in > >> > order? > >> What do you mean by order? > > >> > getLineOffsets() is just used to tell whether the line is executed > >> > or not. > >> Note that it should say whether the line is "executable" (not > >> executed) > > >> Honza > > >> > Thanks > > >> > On Fri, Mar 15, 2013 at 8:05 AM, Jan Honza Odvarko <[email protected] > >> >wrote: > > >> > > Firebug is currently using JSD (jsdIDebuggerService) to figure out, > >> > > which line > >> > > is executable. However, the plan is to switch to JSD2 (work in > >> > > progress) > >> > >https://wiki.mozilla.org/Debugger > > >> > > You should also base your extension on JSD2 > > >> > > Look for getLineOffsets(line) and getOffsetLine(offset) in the > >> > > Debugger document. > >> > > I didn't test it, but I think that if getLineOffset returns null, the > >> > > line is not executable. > > >> > > Honza > > >> > > On Mar 15, 9:17 am, SK <[email protected]> wrote: > >> > > > I want to know how to access JavaScript execution trace at runtime. > >> I saw > >> > > > Firebug can do something like this: > > >> > > > [image: enter image description here] > > >> > > > Refer to the image above, all the line numbers executed are > >> highlighted > >> > > in > >> > > > green. They are achieved at runtime. I guess there must be some way > >> to > >> > > > access those info from the JavaScript engine used by the browser. > > >> > > > Say now I want to build a firebug plugin to access those info and > >> examine > >> > > > all the variables in each executed line at the runtime, how should > >> I do? > > >> > > > Thank you! > > >> > > -- > >> > > -- > >> > > 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 > >> > >https://groups.google.com/forum/#!forum/firebug > > >> > > --- > >> > > You received this message because you are subscribed to a topic in the > >> > > Google Groups "Firebug" group. > >> > > To unsubscribe from this topic, visit > > >>https://groups.google.com/d/topic/firebug/MQJCrYSwT9k/unsubscribe?hl=en. > >> > > To unsubscribe from this group and all its topics, send an email to > >> > > [email protected]. > >> > > For more options, visithttps://groups.google.com/groups/opt_out. > > >> -- > >> -- > >> 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 > >>https://groups.google.com/forum/#!forum/firebug > > >> --- > >> You received this message because you are subscribed to a topic in the > >> Google Groups "Firebug" group. > >> To unsubscribe from this topic, visit > >>https://groups.google.com/d/topic/firebug/MQJCrYSwT9k/unsubscribe?hl=en. > >> To unsubscribe from this group and all its topics, send an email to > >> [email protected]. > >> For more options, visithttps://groups.google.com/groups/opt_out. -- -- 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 https://groups.google.com/forum/#!forum/firebug --- You received this message because you are subscribed to the Google Groups "Firebug" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
