Hi, Regarding (2) this should work "out of the box". When a breakpoint is hit the active context is known, and all debug evaluate expressions should be evaluated in that context. That is in your example "print a" should give "Hello" when stopped on breakpoint #1 and undefined when stopped at breakpoint #2.
When you move up and down the stack and evaluate expressions the context used for evaluation should also be change accordingly. Regards, Søren On Mon, Aug 30, 2010 at 17:21, DAldridge <[email protected]> wrote: > Thank you for the response, Søren. > > 1) I was getting "ReferenceError" displayed in the D8 instance running > as the debugger when trying to set a function:line breakpoint for a > script that had not yet been compiled. I just performed your example > with the two D8 instances, and when doing "b bogusfile:123" in the > debugger and "load("fileWhichExists.js")" in the debuggee, I got the > behavior you expect (i.e. breakpoint set, no ReferenceError). I will > try to create a standalone example which illustrates the > ReferenceError behavior I'm seeing, but it might take me a while given > my schedule. > > 2) So let's say I have two scripts: > > Foo.js: > function foo() { > a = "Hello"; > b = a + ", World"; > } > foo(); > > Bar.js: > function bar() { > c = "dlroW ,"; > d = c + "olleH"; > } > bar(); > > Now in my debugee process, I enable the agent (with wait_for_connect = > true) and set up the debug message callback hander. I create > GlobalTemplate1 and Context1, compiling and running Foo.js, and a > separate GlobalTemplate2 and Context2, compiling and running Bar.js. > > Then I run a D8 debugger, and issue the following: > dbg> b Foo.js:3 > dbg> b Bar.js:3 > dbg> continue > > My intent is to "print a" in D8 to see the value of "a" in Foo.js in > D8 when breakpoint #1 hits, and "print c" to see the value of "c" in > Bar.js when breakpoint #2 hits. > > What can I do in my debugee to ensure that the appropriate context > (either 1/Foo or 2/Bar) is active when the corresponding "print > <whatever>" statement is evaluated? Is there some "breakpoint hit" > message I can react to which contains enough contextual information > for me to determine which context needs to be activated prior to > calling ProcessDebugMessages()? > > 3) The issue 854 you opened should fix D8 when run as a debugee, but > our own application/debugee was already doing that. As with (1) > above, I'll have to investigate further and try to provide a sample. > > Cheers, > David > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
