7474import com .oracle .truffle .api .TruffleLanguage ;
7575import com .oracle .truffle .api .TruffleLanguage .Env ;
7676import com .oracle .truffle .api .TruffleLogger ;
77+ import com .oracle .truffle .api .debug .Debugger ;
7778import com .oracle .truffle .api .frame .VirtualFrame ;
7879import com .oracle .truffle .api .nodes .RootNode ;
7980
@@ -120,6 +121,7 @@ protected boolean proceed() {
120121
121122 @ Override
122123 public final void execute (PythonContext context ) {
124+ Debugger debugger = null ;
123125 do {
124126 Object callable = callable ();
125127 if (callable != null ) {
@@ -131,6 +133,10 @@ public final void execute(PythonContext context) {
131133 // Avoid pointless stack walks in random places
132134 PArguments .setException (args , PException .NO_EXCEPTION );
133135
136+ if (debugger == null ) {
137+ debugger = Debugger .find (context .getEnv ());
138+ }
139+ debugger .disableStepping ();
134140 try {
135141 GenericInvokeNode .getUncached ().execute (context .getAsyncHandler ().callTarget , args );
136142 } catch (RuntimeException e ) {
@@ -140,6 +146,8 @@ public final void execute(PythonContext context) {
140146 // Just print a Python-like stack trace; CPython does the same (see
141147 // 'weakrefobject.c: handle_callback')
142148 ExceptionUtils .printPythonLikeStackTrace (e );
149+ } finally {
150+ debugger .restoreStepping ();
143151 }
144152 }
145153 } while (proceed ());
0 commit comments