/** * Finds the debugger associated with a given language environment. There is at most one * debugger associated with any {@link PolyglotEngine}. Please note that a debugger instance * looked up with a language also has access to all other languages and sources that were loaded * by them. * * @param env the language environment to find debugger for * @return an instance of associated debugger, never <code>null</code> * @since 0.17 */ public static Debugger find(TruffleLanguage.Env env) { return env.lookup(env.getInstruments().get("debugger"), Debugger.class); }
/** * Finds the debugger associated with a given language environment. There is at most one * debugger associated with any {@link org.graalvm.polyglot.Engine}. Please note that a debugger * instance looked up with a language also has access to all other languages and sources that * were loaded by them. * * @param env the language environment to find debugger for * @return an instance of associated debugger, never <code>null</code> * @since 0.17 */ public static Debugger find(TruffleLanguage.Env env) { return env.lookup(env.getInstruments().get("debugger"), Debugger.class); }