Show More
@@ -199,19 +199,37 b' class Pdb(OldPdb):' | |||
|
199 | 199 | for a standalone version that uses prompt_toolkit, see |
|
200 | 200 | `IPython.terminal.debugger.TerminalPdb` and |
|
201 | 201 | `IPython.terminal.debugger.set_trace()` |
|
202 | ||
|
203 | ||
|
204 | This debugger can hide and skip frames that are tagged according to some predicates. | |
|
205 | See the `skip_predicates` commands. | |
|
206 | ||
|
202 | 207 | """ |
|
203 | 208 | |
|
209 | default_predicates = {"tbhide": True, "readonly": False, "ipython_internal": True} | |
|
210 | ||
|
204 | 211 | def __init__(self, color_scheme=None, completekey=None, |
|
205 | 212 | stdin=None, stdout=None, context=5, **kwargs): |
|
206 | 213 | """Create a new IPython debugger. |
|
207 | 214 | |
|
208 | :param color_scheme: Deprecated, do not use. | |
|
209 | :param completekey: Passed to pdb.Pdb. | |
|
210 | :param stdin: Passed to pdb.Pdb. | |
|
211 | :param stdout: Passed to pdb.Pdb. | |
|
212 | :param context: Number of lines of source code context to show when | |
|
215 | Parameters | |
|
216 | ---------- | |
|
217 | color_scheme : default None | |
|
218 | Deprecated, do not use. | |
|
219 | completekey : default None | |
|
220 | Passed to pdb.Pdb. | |
|
221 | stdin : default None | |
|
222 | Passed to pdb.Pdb. | |
|
223 | stdout : default None | |
|
224 | Passed to pdb.Pdb. | |
|
225 | context : int | |
|
226 | Number of lines of source code context to show when | |
|
213 | 227 | displaying stacktrace information. |
|
214 | :param kwargs: Passed to pdb.Pdb. | |
|
228 | **kwargs | |
|
229 | Passed to pdb.Pdb. | |
|
230 | ||
|
231 | Notes | |
|
232 | ----- | |
|
215 | 233 |
|
|
216 | 234 |
|
|
217 | 235 | """ |
@@ -283,7 +301,7 b' class Pdb(OldPdb):' | |||
|
283 | 301 | self.skip_hidden = True |
|
284 | 302 | |
|
285 | 303 | # list of predicates we use to skip frames |
|
286 | self._predicates = {"tbhide": True, "readonly": False, "ipython_internal": True} | |
|
304 | self._predicates = self.default_predicates | |
|
287 | 305 | |
|
288 | 306 | def set_colors(self, scheme): |
|
289 | 307 | """Shorthand access to the color table scheme selector method.""" |
@@ -563,6 +581,10 b' class Pdb(OldPdb):' | |||
|
563 | 581 | |
|
564 | 582 | Call without arguments to see the current values. |
|
565 | 583 | |
|
584 | To permanently change the value of an option add the corresponding | |
|
585 | command to your ``~/.pdbrc`` file. If you are programmatically using the | |
|
586 | Pdb instance you can also change the ``default_predicates`` class | |
|
587 | attribute. | |
|
566 | 588 | """ |
|
567 | 589 | if not args.strip(): |
|
568 | 590 | print("current predicates:") |
@@ -64,6 +64,22 b' Note that the ``readonly`` predicate may increase disk access as we check for' | |||
|
64 | 64 | file access permission for all frames on many command invocation, but is usually |
|
65 | 65 | cached by operating systems. Let us know if you encounter any issues. |
|
66 | 66 | |
|
67 | As the IPython debugger does not use the traitlets infrastructure for | |
|
68 | configuration, by editing your ``.pdbrc`` files and appending commands you would | |
|
69 | like to be executed just before entering the interactive prompt. For example: | |
|
70 | ||
|
71 | ||
|
72 | .. code:: | |
|
73 | ||
|
74 | # file : ~/.pdbrc | |
|
75 | skip_predicates readonly True | |
|
76 | skip_predicates tbhide False | |
|
77 | ||
|
78 | Will hide read only frames by default and show frames marked with | |
|
79 | ``__tracebackhide__``. | |
|
80 | ||
|
81 | ||
|
82 | ||
|
67 | 83 | |
|
68 | 84 | Thanks |
|
69 | 85 | ------ |
@@ -236,14 +252,14 b' was exceptionally no release last month.' | |||
|
236 | 252 | - Docs docs formatting that make the install commands work on zsh |
|
237 | 253 | :ghpull:`12587` |
|
238 | 254 | - Always display the last frame in tracebacks even if hidden with |
|
239 |
``__traceback |
|
|
255 | ``__tracebackhide__`` :ghpull:`12601` | |
|
240 | 256 | - Avoid an issue where a callback can be registered multiple times. |
|
241 | 257 | :ghpull:`12625` |
|
242 | 258 | - Avoid an issue in debugger mode where frames changes could be lost. |
|
243 | 259 | :ghpull:`12627` |
|
244 | 260 | |
|
245 | 261 | - Never hide the frames that invoke a debugger, even if marked as hidden by |
|
246 |
``__traceback |
|
|
262 | ``__tracebackhide__`` :ghpull:`12631` | |
|
247 | 263 | - Fix calling the debugger in a recursive manner :ghpull:`12659` |
|
248 | 264 | |
|
249 | 265 | |
@@ -394,7 +410,7 b' Change of API and exposed objects automatically detected using `frappuccino' | |||
|
394 | 410 | <https://pypi.org/project/frappuccino/>`_ (still in beta): |
|
395 | 411 | |
|
396 | 412 | |
|
397 |
The following items are new and mostly related to understanding ``__tracebackb |
|
|
413 | The following items are new and mostly related to understanding ``__tracebackbide__``:: | |
|
398 | 414 | |
|
399 | 415 | + IPython.core.debugger.Pdb.do_down(self, arg) |
|
400 | 416 | + IPython.core.debugger.Pdb.do_skip_hidden(self, arg) |
General Comments 0
You need to be logged in to leave comments.
Login now