How to get JS bytecode from JSD?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get JS bytecode from JSD?

Sachiko Yoshihama
Hi,

I am trying to track precise execution of script and data flows by
using the JSD interface. I use jsdIDebuggerService.interruptHook to
register a hook function for execution of every bytecode instruction.
However, from what I receive at the hook function, I cannot determine
what instructions are being executed. I can get the line number and
the PC count, and together from the pretty-print of the jsdIScript
object, each line of script being executed can be obtained.

However, this is not always helpful. E.g., when a script has a loop of
a conditional branch, my callback function will not be notified of the
end of the loop or the branch.

Is there any way to obtain the bytecode of each jsdIScript object?
I appreciate your help.

Sachiko

_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: How to get JS bytecode from JSD?

John J Barton
Sachiko Yoshihama wrote:

> Hi,
>
> I am trying to track precise execution of script and data flows by
> using the JSD interface. I use jsdIDebuggerService.interruptHook to
> register a hook function for execution of every bytecode instruction.
> However, from what I receive at the hook function, I cannot determine
> what instructions are being executed. I can get the line number and
> the PC count, and together from the pretty-print of the jsdIScript
> object, each line of script being executed can be obtained.
>
> However, this is not always helpful. E.g., when a script has a loop of
> a conditional branch, my callback function will not be notified of the
> end of the loop or the branch.
>
> Is there any way to obtain the bytecode of each jsdIScript object?

Not that I have seen in Venkman, the UI side of the jsd code, nor in
Firebug.  Maybe by working directly with the js engine in C++ code?

> I appreciate your help.
>
> Sachiko
>
_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger
Reply | Threaded
Open this post in threaded view
|

Re: How to get JS bytecode from JSD?

Sachiko Yoshihama
John,

Many thanks for your quick reseponse. I'll look for other approaches.

Sachiko


On Aug 17, 2:15 pm, "John J. Barton" <[hidden email]>
wrote:

> Sachiko Yoshihama wrote:
> > Hi,
>
> > I am trying to track precise execution of script and data flows by
> > using the JSD interface. I use jsdIDebuggerService.interruptHook to
> > register a hook function for execution of every bytecode instruction.
> > However, from what I receive at the hook function, I cannot determine
> > what instructions are being executed. I can get the line number and
> > the PC count, and together from the pretty-print of the jsdIScript
> > object, each line of script being executed can be obtained.
>
> > However, this is not always helpful. E.g., when a script has a loop of
> > a conditional branch, my callback function will not be notified of the
> > end of the loop or the branch.
>
> > Is there any way to obtain the bytecode of each jsdIScript object?
>
> Not that I have seen in Venkman, the UI side of the jsd code, nor in
> Firebug.  Maybe by working directly with the js engine in C++ code?
>
> > I appreciate your help.
>
> > Sachiko


_______________________________________________
dev-apps-js-debugger mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-js-debugger