@@ -76,7 +76,7 @@ def __init__(self, opts=None):
7676 self .mainpyfile = None
7777 self .thread = None
7878 self .eval_string = None
79- self .settings = {}
79+ self .settings = self . DEFAULT_INIT_OPTS [ "settings" ]. copy ()
8080
8181 def get_option (key : str ) -> Any :
8282 return option_set (opts , key , self .DEFAULT_INIT_OPTS )
@@ -143,10 +143,16 @@ def completer(text: str, state):
143143 pass
144144 return
145145
146- # The following functions have to be defined before
147- # DEFAULT_INIT_OPTS which includes references to these.
148-
149- # FIXME DRY run, run_exec, run_eval.
146+ def complete (self , last_token : str , state : int ):
147+ """
148+ In place expansion of top-level debugger command
149+ for `last_token`` that we are in ``state``.
150+ """
151+ if hasattr (self .core .processor , "completer" ):
152+ string_seen = get_line_buffer () or last_token
153+ results = self .core .processor .completer (string_seen , state )
154+ return results [state ]
155+ return
150156
151157 def run (self , cmd , start_opts = None , globals_ = None , locals_ = None ):
152158 """Run debugger on string `cmd' using builtin function eval
@@ -332,6 +338,9 @@ def restart_argv(self):
332338 """Return an array that would be execv-ed to restart the program"""
333339 return self .orig_sys_argv or self .program_sys_argv
334340
341+ # The following functions have to be defined before
342+ # DEFAULT_INIT_OPTS which includes references to these.
343+
335344 # Note: has to come after functions listed in ignore_filter.
336345 DEFAULT_INIT_OPTS = {
337346 # What routines will we not trace into?
@@ -364,17 +373,6 @@ def restart_argv(self):
364373 "from_ipython" : False ,
365374 }
366375
367- def complete (self , last_token : str , state : int ):
368- """
369- In place expansion of top-level debugger command
370- for `last_token`` that we are in ``state``.
371- """
372- if hasattr (self .core .processor , "completer" ):
373- string_seen = get_line_buffer () or last_token
374- results = self .core .processor .completer (string_seen , state )
375- return results [state ]
376- return
377-
378376 pass
379377
380378
@@ -388,9 +386,8 @@ def foo():
388386 pass
389387 return 3
390388
391- import debugger
392-
393- d = debugger .Trepan ()
389+ d = Trepan ()
390+ print (d .settings )
394391 d .settings ["trace" ] = True
395392 d .settings ["printset" ] = tracer .ALL_EVENTS
396393 d .core .step_ignore = - 1
0 commit comments