Re: Debug Interface for the mozjs, how to start/stop/pause/continue the js engine

lemmel <[email protected]> Sat, 11 Apr 2020 18:39:23 +0200
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <5091526.0uypVLmQy6@sakura>
Hi !

I did a lot of work, and I'm now able to:
- run arbitrary JS code through a call to JS::Evaluate (and I know now that=
 the JSContext - obtained via JS_NewContext - must stick to only one thread=
) any number of time I want
- retrieve an error generated from the code (in this order: JS_IsExceptionP=
ending, JS_GetPendingException, js::ErrorReport, JS_ClearPendingException)
- "pause" the engine execution (registered my callback with JS_AddInterrupt=
Callback and triggered the pause via JS_RequestInterruptCallback)
- stop all graciously

But I don't know how to set a debugger (the object Debugger is not defined):
- can't achieve to load jsdebugger.jsm (JS::Evaluate of Components.utils.im=
port("resource://gre/modules/jsdebugger.jsm"); does nothing as there is no =
Component object)
- even copy/path of the content of jsdebugger.jsm failed (JS::Evaluate of  =
   >  const init =3D Cc["@mozilla.org/jsdebugger;1"].createInstance(Ci.IJSD=
ebugger);  < failed on Cc that is unknown)


Could someone give me a hint ?

Thanks for your attention.

PS: I took the liberty to describe what I did for other people that might b=
e looking for information

Le mardi 7 avril 2020, 21:12:16 CEST lemmel a =E9crit :
> Thanks, I think that I have now some ideas about how to proceed; probably=
 this week-end.
> =

> =

> PS: When I send a message to the list I receive a message (spam ?!) from =
"Support TheFork <[email protected]> (TheFork, a TripAdvisor Company)"; I =
joined the mail as attachment, and give below the content:
> =