@@ -307,14 +307,15 @@ class Pdb(bdb.Bdb, cmd.Cmd):
307307 # Limit the maximum depth of chained exceptions, we should be handling cycles,
308308 # but in case there are recursions, we stop at 999.
309309 MAX_CHAINED_EXCEPTION_DEPTH = 999
310+ DEFAULT_BACKEND = 'settrace'
310311
311312 _file_mtime_table = {}
312313
313314 _last_pdb_instance = None
314315
315316 def __init__ (self , completekey = 'tab' , stdin = None , stdout = None , skip = None ,
316- nosigint = False , readrc = True , mode = None ):
317- bdb .Bdb .__init__ (self , skip = skip , backend = 'monitoring' )
317+ nosigint = False , readrc = True , mode = None , backend = None ):
318+ bdb .Bdb .__init__ (self , skip = skip , backend = backend if backend else self . DEFAULT_BACKEND )
318319 cmd .Cmd .__init__ (self , completekey , stdin , stdout )
319320 sys .audit ("pdb.Pdb" )
320321 if stdout :
@@ -2376,7 +2377,7 @@ def set_trace(*, header=None, commands=None):
23762377 if Pdb ._last_pdb_instance is not None :
23772378 pdb = Pdb ._last_pdb_instance
23782379 else :
2379- pdb = Pdb (mode = 'inline' )
2380+ pdb = Pdb (mode = 'inline' , backend = 'monitoring' )
23802381 if header is not None :
23812382 pdb .message (header )
23822383 pdb .set_trace (sys ._getframe ().f_back , commands = commands )
@@ -2507,7 +2508,7 @@ def main():
25072508 # modified by the script being debugged. It's a bad idea when it was
25082509 # changed by the user from the command line. There is a "restart" command
25092510 # which allows explicit specification of command line arguments.
2510- pdb = Pdb (mode = 'cli' )
2511+ pdb = Pdb (mode = 'cli' , backend = 'monitoring' )
25112512 pdb .rcLines .extend (opts .commands )
25122513 while True :
25132514 try :
0 commit comments