I posted an example somewhere?? Whooohoo! :)

You can access the variables via the scope object. You can use the debugger
ContextData object to store a reference to the scope object so that it can
be used in the various onDebug methods. Here's a few copy/paste code
sinppets using scope.get and scope.getIds to scan the variables in the
scope. If it helps I can send you a full method that recursively scans the
entire set of variables presents in a given scope (it's a quazi memory count
function), just send me an email if you want the full 40ish lines of code as
an example.

//        Object[] jsObjects = ((DebuggableObject)scope).getAllIds();
//Debug operation
        Object[] jsObjects = scope.getIds();      //Normal operation - only
counts variables in the instance scope

        for (Object variable : jsObjects) {
            Object valueObj = scope.get(variable.toString(), scope);

            } else if ((valueObj instanceof Scriptable) &&
!variable.equals("prototype")) {
                    memCount += checkMemoryRecursive(((Scriptable)
valueObj), 0, duplicateSherrif, ++indent);  //Recurse into the
ScriptableObject


ContextData is just a generic object you can use as you see fit. It's used
to keep references to things that you will need once you get into the
onDebug methods.

Dave


-----Original Message-----
From:
dev-tech-js-engine-rhino-bounces+davidparks21=yahoo....@lists.mozilla.org
[mailto:dev-tech-js-engine-rhino-bounces+davidparks21=yahoo....@lists.mozill
a.org] On Behalf Of Jaimon
Sent: Monday, November 09, 2009 8:52 PM
To: [email protected]
Subject: how get debug information from the debug frame

hi,

i have followed the very good example of David Parks regarding to how
to implement and embed the rhino debugger.
i have few questions regarding it:

1) once i am the public void onDebuggerStatement(Context cx)  function
is being called and i have the context.
    how can i retrieve the debug information from the context? how can
i get all the variables list and their values?
2) what is the use of the contextData that the setDebugger is getting
as a parameter? all the examples that i have     seen didn't really
use it.

thanks a lot
me
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino



_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to