@@ -270,13 +270,14 @@ class Debugger:
270
270
'richInspectVariables' , 'modules'
271
271
]
272
272
273
- def __init__ (self , log , debugpy_stream , event_callback , shell_socket , session ):
273
+ def __init__ (self , log , debugpy_stream , event_callback , shell_socket , session , just_my_code = True ):
274
274
self .log = log
275
275
self .debugpy_client = DebugpyClient (log , debugpy_stream , self ._handle_event )
276
276
self .shell_socket = shell_socket
277
277
self .session = session
278
278
self .is_started = False
279
279
self .event_callback = event_callback
280
+ self .just_my_code = just_my_code
280
281
self .stopped_queue = Queue ()
281
282
282
283
self .started_debug_handlers = {}
@@ -515,11 +516,12 @@ async def attach(self, message):
515
516
'port' : port
516
517
}
517
518
message ['arguments' ]['logToFile' ] = True
518
- # Reverts that option for now since it leads to spurious break of the code
519
- # in ipykernel source and resuming the execution leads to several errors
520
- # in the kernel .
519
+ # Experimental option to break in non-user code.
520
+ # The ipykernel source is in the call stack, so the user
521
+ # has to manipulate the step-over and step-into in a wize way .
521
522
# Set debugOptions for breakpoints in python standard library source.
522
- # message['arguments']['debugOptions'] = [ 'DebugStdLib' ]
523
+ if not self .just_my_code :
524
+ message ['arguments' ]['debugOptions' ] = [ 'DebugStdLib' ]
523
525
return await self ._forward_message (message )
524
526
525
527
async def configurationDone (self , message ):
0 commit comments