@@ -127,85 +127,84 @@ def run_exec(statement, debug_opts=None, start_opts=None, globals_=None, locals_
127127
128128def debug (dbg_opts = None , start_opts = None , post_mortem = True , step_ignore = 1 , level = 0 ):
129129 """
130- Enter the debugger.
131-
132- Parameters
133- ----------
134-
135- level : how many stack frames go back. Usually it will be
136- the default 0. But sometimes though there may be calls in setup to the debugger
137- that you may want to skip.
138-
139- step_ignore : how many line events to ignore after the
140- debug() call. 0 means don't even wait for the debug() call to finish.
141-
142- param dbg_opts : is an optional "options" dictionary that gets fed
143- trepan.Debugger(); `start_opts' are the optional "options"
144- dictionary that gets fed to trepan.Debugger.core.start().
145-
146- Use like this:
147-
148- .. code-block:: python
149-
150- ... # Possibly some Python code
151- import trepan.api # Needed only once
152- ... # Possibly some more Python code
153- trepan.api.debug() # You can wrap inside conditional logic too
154- pass # Stop will be here.
155- # Below is code you want to use the debugger to do things.
156- .... # more Python code
157- # If you get to a place in the program where you aren't going
158- # want to debug any more, but want to remove debugger trace overhead:
159- trepan.api.stop()
160-
161- Parameter "level" specifies how many stack frames go back. Usually it will be
162- the default 0. But sometimes though there may be calls in setup to the debugger
163- that you may want to skip.
164-
165- Parameter "step_ignore" specifies how many line events to ignore after the
166- debug() call. 0 means don't even wait for the debug() call to finish.
167-
168- In situations where you want an immediate stop in the "debug" call
169- rather than the statement following it ("pass" above), add parameter
170- step_ignore=0 to debug() like this::
171-
172- import trepan.api # Needed only once
173- # ... as before
174- trepan.api.debug(step_ignore=0)
175- # ... as before
176-
177- Module variable _debugger_obj_ from module trepan.debugger is used as
178- the debugger instance variable; it can be subsequently used to change
179- settings or alter behavior. It should be of type Debugger (found in
180- module trepan). If not, it will get changed to that type::
181-
182- $ python
183- >>> from trepan.debugger import debugger_obj
184- >>> type(debugger_obj)
185- <type 'NoneType'>
186- >>> import trepan.api
187- >>> trepan.api.debug()
188- ...
189- (Trepan) c
190- >>> from trepan.debugger import debugger_obj
191- >>> debugger_obj
192- <trepan.debugger.Debugger instance at 0x7fbcacd514d0>
193- >>>
194-
195- If however you want your own separate debugger instance, you can
196- create it from the debugger _class Debugger()_ from module
197- trepan.debugger::
198-
199- $ python
200- >>> from trepan.debugger import Debugger
201- >>> dbgr = Debugger() # Add options as desired
202- >>> dbgr
203- <trepan.debugger.Debugger instance at 0x2e25320>
204-
205- `dbg_opts' is an optional "options" dictionary that gets fed
206- trepan.Debugger(); `start_opts' are the optional "options"
207- dictionary that gets fed to trepan.Debugger.core.start().
208- """
130+ Enter the debugger.
131+
132+ Parameters
133+ ----------
134+
135+ level : how many stack frames go back. Usually it will be
136+ the default 0. But sometimes though there may be calls in setup to the debugger
137+ that you may want to skip.
138+
139+ step_ignore : how many line events to ignore after the
140+ debug() call. 0 means don't even wait for the debug() call to finish.
141+
142+ param dbg_opts : is an optional "options" dictionary that gets fed
143+ trepan.Debugger(); `start_opts' are the optional "options"
144+ dictionary that gets fed to trepan.Debugger.core.start().
145+
146+ Use like this:
147+
148+ .. code-block:: python
149+
150+ ... # Possibly some Python code
151+ import trepan.api # Needed only once
152+ ... # Possibly some more Python code
153+ trepan.api.debug() # You can wrap inside conditional logic too
154+ pass # Stop will be here.
155+ # Below is code you want to use the debugger to do things.
156+ .... # more Python code
157+ # If you get to a place in the program where you aren't going
158+ # want to debug any more, but want to remove debugger trace overhead:
159+ trepan.api.stop()
160+
161+ Parameter "level" specifies how many stack frames go back. Usually it will be
162+ the default 0. But sometimes though there may be calls in setup to the debugger
163+ that you may want to skip.
164+
165+ Parameter "step_ignore" specifies how many line events to ignore after the
166+ debug() call. 0 means don't even wait for the debug() call to finish.
167+
168+ In situations where you want an immediate stop in the "debug" call
169+ rather than the statement following it ("pass" above), add parameter
170+ step_ignore=0 to debug() like this::
171+
172+ import trepan.api # Needed only once
173+ # ... as before
174+ trepan.api.debug(step_ignore=0)
175+ # ... as before
176+
177+ Module variable _debugger_obj_ from module trepan.debugger is used as
178+ the debugger instance variable; it can be subsequently used to change
179+ settings or alter behavior. It should be of type Debugger (found in
180+ module trepan). If not, it will get changed to that type::
181+
182+ $ python
183+ >>> from trepan.debugger import debugger_obj
184+ >>> type(debugger_obj)
185+ <type 'NoneType'>
186+ >>> import trepan.api
187+ >>> trepan.api.debug()
188+ ...
189+ (Trepan) c
190+ >>> from trepan.debugger import debugger_obj
191+ >>> debugger_obj
192+ <trepan.debugger.Debugger instance at 0x7fbcacd514d0>
193+ >>>
194+
195+ If however you want your own separate debugger instance, you can
196+ create it from the debugger _class Debugger()_ from module
197+ trepan.debugger::
198+
199+ $ python
200+ >>> from trepan.debugger import Debugger
201+ >>> dbgr = Debugger() # Add options as desired
202+ >>> dbgr
203+ <trepan.debugger.Debugger instance at 0x2e25320>
204+
205+ `dbg_opts' is an optional "options" dictionary that gets fed
206+ trepan.Debugger(); `start_opts' are the optional "options"
207+ dictionary that gets fed to trepan.Debugger.core.start()."""
209208 if not isinstance (Mdebugger .debugger_obj , Mdebugger .Trepan ):
210209 Mdebugger .debugger_obj = Mdebugger .Trepan (dbg_opts )
211210 Mdebugger .debugger_obj .core .add_ignore (debug , stop )
0 commit comments