Using lineprocessor.cc as an example, I feel like I am quite close to 
getting this to work.  I can attach to the debugger on the correct port 
using WebStorm.  At the moment I am simply setting breakpoints in the .js 
file directly and not worrying about the typescript file yet.

The problem is that I get a fatal exception right before my main method 
(which is not static) returns.  It is a failed assertion on the first line 
of api.h's Free method: ASSERT(blocks_.length() == 0);  It tells me that 
the length here is 1.

I know that this has something to do with cleaning up the locker (Free is 
called as a result of the Locker's destructor), but I don't understand the 
nature of the exception beyond that.  Many of the methods called by main 
are static, which may or may not be relevant.  Before adding the debugging 
pieces, my program did not have any issues with contexts, handle scopes, 
threads, etc.  What kind of problem have I introduced here with the locker 
or debugging-related context?  Any guidance would be appreciated.

>From the main method:

v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate);

v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();

global->Set(v8::String::New("print"), v8::FunctionTemplate::New(Print));

v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global);
v8::Context::Scope context_scope(context);
debug_message_context.Reset(isolate, context);

v8::Locker locker(isolate);
v8::Debug::SetDebugMessageDispatchHandler(DispatchDebugMessages, true);
v8::Debug::EnableAgent("Awesome debugger", 5858, true);

...
Handle<String> source = ReadFile(*file);
ExecuteString(isolate, source, String::New(*file), true, true);

and from DispatchDebugMessages:

v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate);
v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolate, 
debug_message_context);
v8::Context::Scope scope(context);

v8::Debug::ProcessDebugMessages();

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" 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.

Reply via email to