Closed Carreau closed 11 months ago
I quickly went through ipython/ipython#12359. I do not understand the goal. Would you mind to expand ?
Here is an example.
In [1]: from IPython.terminal.debugger import set_trace
...:
...: def g():
...: import ipdb
...: set_trace()
...: raise ValueError
...:
...: def f(n):
...:
...: __tracebackhide__ = True
...: if n < 0:
...: g()
...: else:
...: f(n-1)
...:
...: def a():
...: f(5)
...: a()
> <ipython-input-1-2b5dbc49c3e4>(6)g()
4 import ipdb
5 set_trace()
----> 6 raise ValueError
7
8 def f(n):
ipdb> w
[... skipping 12 hidden frame(s)]
<ipython-input-1-2b5dbc49c3e4>(18)<module>()
14 f(n-1)
15
16 def a():
17 f(5)
---> 18 a()
<ipython-input-1-2b5dbc49c3e4>(17)a()
14 f(n-1)
15
16 def a():
---> 17 f(5)
18 a()
[... skipping 7 hidden frame(s)]
> <ipython-input-1-2b5dbc49c3e4>(6)g()
4 import ipdb
5 set_trace()
----> 6 raise ValueError
7
8 def f(n):
See the [skipping N hidden frames.]
.
I had understood that the mean was to hide frames. What is not obvious to me is why you would want to hide them ?
I am having an issue and the hidden frames are preventing me from debugging my code. How can I disable this behavior and go back to showing all frames by default?
ipdb> help
Documented commands (type help <topic>):
========================================
EOF commands enable ll pp s until
... ... ... ... ... skip_hidden ...
... ... ... ... ... skip_predicates ...
Miscellaneous help topics:
==========================
exec pdb
Undocumented commands:
======================
interact
ipdb> skip_hidden false
And you should be good to go.
You can tweak individual skip rules, or add your own:
ipdb> skip_predicates
current predicates:
tbhide : True
readonly : False
ipython_internal : True
debuggerskip : True
ipdb> skip_predicates tbhide false
ipdb> skip_predicates
current predicates:
tbhide : False
readonly : False
ipython_internal : True
debuggerskip : True
I think we can close this one as this was just a FYI
in https://github.com/ipython/ipython/pull/12359 I'll change IPtyhon default behavior to skip hidden frames with a toggle. Not sure if you want to expose this in some way with ipdb