Thanks for the input Ben.
But I guess I'm not lucky.
I've start over a new project from the "hello world" sample.
I can connect to my app with D8 but my app crash after eveyr D8 command.
Here's my code:
void DispatchDebugMessage() {
Debug::ProcessDebugMessages();
}
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR
lpCmdLine, int nCmdShow) {
HandleScope handle_scope;
Persistent<Context> context = Context::New();
Context::Scope context_scope(context);
Isolate* iso = Isolate::GetCurrent();
iso->Enter();
Debug::EnableAgent("testDebuggee", 5858, true);
Debug::SetDebugMessageDispatchHandler(DispatchDebugMessage, true);
iso->Exit();
Handle<String> source = String::New("'Hello' + ', World!'");
Handle<Script> script = Script::Compile(source);
Handle<Value> result = script->Run();
context.Dispose();
String::Value res(result);
TRACE(_T("%s\n"), *res);
return 0;
}
Any idea would be much appreciated!
Thank you very much!
Regards,
Flo
Le lundi 15 avril 2013 13:01:41 UTC+2, Ben Noordhuis a écrit :
>
> On Mon, Apr 15, 2013 at 12:18 PM, Florent S.
> <[email protected]<javascript:>>
> wrote:
> > Hi there!
> >
> > I wanted to add debugger support to my app and use d8.
> > I wonder if there is a step by step "add debugger support" tutorial.
> > So far i wasn't lucky.
> >
> > I've added this to my code :
> >
> > void MyApp::DispatchDebugMessage() {
> > Debug::ProcessDebugMessages();
> > }
> >
> > v8::Debug::EnableAgent("MyApp", _debugPort, true);
> > v8::Debug::SetDebugMessageDispatchHandler(MyApp::DispatchDebugMessage,
> > true);
> >
> > When I start my app, it wait for a debugger connection, but it crashed
> at
> > the first DebugMessage it received.
> >
> > Do I need a Context::Scope in DispatchDebugMessage?
> > If so what contect should I use?
> > Do I need an Isolate? Locker? Unlocker?
> >
> > Best regards,
> > Flo
>
> Your code is quite similar to what we use in node.js (specifically,
> src/node.cc) but we have it wrapped in (what amounts to) this:
>
> Debug::DebugBreak(isolate);
> if (debugger_running == false) {
> isolate->Enter();
> // EnableAgent code goes here.
> isolate->Exit();
> debugger_running = true;
> }
>
--
--
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.