You can find all the code (both backend and fronted) at https://github.com/zdwalter/learnjs I use V8 debugger this way (see https://github.com/zdwalter/learnjs/blob/master/public/javascripts/debug.js) Right now, I take "exec_state.frame().details_.details_[1]" as global objects. and "exec_state.frame().details_.details_[n>=9]" as local objects. Please correct me if this is wrong. I need to clean up the data dump by V8 debugger.
Also I am planning to improve the visualization: 1) show different variables status side by side instead of only showing one status. 2) realtime editing and execution, update the stack and current execution step result while writing the code. 在 2012-3-13,下午2:23, Yang Guo 写道: > I tried it out a bit more and it really feels convenient. In particular, I > looked at the "memorized fib" example. It's not my intention to critisize, I > just want to name a few things that I noticed: > - It seems that the visualization of the execution stack is missing. - - It > seems a bit misleading that global variables (properties of the global > object) are represented as stack-allocated, which they aren't. - Since the > frames of the execution stack are not visualized, the local variables in a > recursive call (in this case "n") seem to be the same one in every recursion. > It's as if n is being overwritten in a recursion call and magically restored > when the recursion returns. It would be great if the stack view is grouped > into function frames that contain local variables. > > Cheers, > > Yang > > > > > > On Tue, Mar 13, 2012 at 7:11 AM, Yang Guo <[email protected]> wrote: > Wow. This is a great piece of software, and it's great that you are using V8 > to make this work. Please don't hesitate to report bugs if you ever encounter > any, especially related to the V8 debugger. > > Yang > > > > On Tue, Mar 13, 2012 at 4:11 AM, Walter Zheng <[email protected]> wrote: > Thanks Yang's help. I have put the online debugging together. > If you are interested, have a look at http://learnjs.info > > > 在 2012-2-27,下午4:37, Yang Guo 写道: > >> Hi Walter, >> >> if you are trying to step through a script in Chrome, please make yourself >> familiar with Chrome devtools. >> >> if you are trying to do this using d8, you can start one d8 instance with >> the option "--debugger-agent" and another instance with the option >> "--remote-debugger". You can now use the first instance to execute scripts >> and the second one to debug. Enter "help" into the remote debugger for more >> info. >> >> You can of course also use the Eclipse debugger or even the Debugger >> protocol. >> >> I hope this helps. >> >> Yang >> >> On Sun, Feb 26, 2012 at 4:39 PM, Walter Zheng <[email protected]> wrote: >> I am a bit confused about how to make this work with the debugger. >> I want to break at the first line. >> then run the script line by line. >> after each line execution, I like to print the current stack status, >> what is every variable value. >> >> Are there any tools can make this happen? >> >> Or how to build my own? >> >> Thanks, >> Walter >> >> -- >> v8-dev mailing list >> [email protected] >> http://groups.google.com/group/v8-dev >> > > > -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
