Commits

Antonio Cuni committed e78e04a

add online help for hidden frames

Comments (0)

Files changed (2)

         n = self.hidden_frames
         if n:
             plural = n>1 and 's' or ''
-            print "%d frame%s hidden" % (n, plural)
+            print "   %d frame%s hidden (try 'help hidden_frames')" % (n, plural)
 
     def exec_if_unfocused(self):
         import os
         self.history.append(line)
         return pdb.Pdb.default(self, line)
 
+    def help_hidden_frames(self):
+        print """\
+Some frames might be marked as "hidden" by e.g. using the pdb.hideframe
+function decorator.  By default, hidden frames are not shown in the stack
+trace, and cannot be reached using ``up`` and ``down``.  You can use
+``hf_unhide`` to tell pdb to ignore the hidden status (i.e., to treat hidden
+frames as normal ones), and ``hf_hide`` to hide them again.
+"""
+
     def do_hf_unhide(self, arg):
         """
         {hf_show}
     check(fn, """
 > .*fn()
 -> g()
-1 frame hidden
+   1 frame hidden .*
 # down           # cannot go down because the frame is hidden
 ... Newest frame
 # hf_unhide
     check(fn, """
 > .*fn()
 -> g()
-1 frame hidden
+   1 frame hidden .*
 # hf_unhide
 # down           # now the frame is no longer hidden
 > .*g()
     check(fn, """
 > .*fn()
 -> obj.x = 0
-1 frame hidden
+   1 frame hidden .*
 # hasattr(obj, 'x')
 False
 # n
     check(fn, """
 > .*fn()
 -> obj.x = 42
-1 frame hidden
+   1 frame hidden .*
 # obj.x
 0
 # n
     check(fn, """
 > .*fn()
 -> a.bar = 42
-1 frame hidden
+   1 frame hidden .*
 # c
 """)
 
     check(fn, """
 > .*fn()
 -> obj.x = 0
-1 frame hidden
+   1 frame hidden .*
 # obj.y
 42
 # hasattr(obj, 'x')