Skip to content

b/breakpoint command doesn't skip __debuggerskip__ functions #293

@craigds

Description

@craigds

The b/breakpoint statement seems to ignore __debuggerskip__ when given a function to break at.
I expected it to skip the wrapper function, and instead break in the wrapped function (func), but instead it breaks on the wrapper function.

In [7]:
   ...: def decorator(_f):
   ...:     def wrapper():
   ...:         # actually stops here
   ...:         __tracebackhide__ = True
   ...:         __debuggerskip__ = False
   ...:         return _f()
   ...:     return wrapper
   ...:
   ...: @decorator
   ...: def func():
   ...:     # expected to break here
   ...:     pass
   ...:
   ...: def caller():
   ...:     import ipdb
   ...:     ipdb.set_trace()
   ...:     # here, type 'b func' to set a breakpoint
   ...:     # Then 'c' to continue
   ...:     func()
   ...:

In [8]: caller()
> <ipython-input-7-6874cfbb10f3>(19)caller()
     17     # here, type 'b func' to set a breakpoint
     18     # Then 'c' to continue
---> 19     func()

ipdb> b func
Breakpoint 3 at <ipython-input-7-6874cfbb10f3>:2
ipdb> c
> <ipython-input-7-6874cfbb10f3>(4)wrapper()
      3         # actually stops here
----> 4         __tracebackhide__ = True
      5         __debuggerskip__ = False

ipdb>

version info:

  • python '3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]'
  • ipython==8.37.0
  • ipdb==0.13.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions