Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after continue, Pdb stops at a line without a breakpoint #58994

Closed
xdegaye mannequin opened this issue May 12, 2012 · 3 comments
Closed

after continue, Pdb stops at a line without a breakpoint #58994

xdegaye mannequin opened this issue May 12, 2012 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@xdegaye
Copy link
Mannequin

xdegaye mannequin commented May 12, 2012

BPO 14789
Nosy @birkenfeld, @xdegaye
Files
  • pdb_default.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2012-05-12.13:54:11.999>
    labels = ['type-bug', 'library']
    title = 'after continue, Pdb stops at a line without a breakpoint'
    updated_at = <Date 2012-05-25.11:54:29.370>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2012-05-25.11:54:29.370>
    actor = 'xdegaye'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2012-05-12.13:54:11.999>
    creator = 'xdegaye'
    dependencies = []
    files = ['25549']
    hgrepos = []
    issue_num = 14789
    keywords = ['patch']
    message_count = 2.0
    messages = ['160470', '161571']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'xdegaye']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14789'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented May 12, 2012

    In the following test run with python on the current head of the
    default branch, Pdb stops at line 3 where there is no breakpoint after
    two breakpoints have been set on the same function (setting two bps on
    the same location is useful, for example one bp to print a value without
    stopping and the other one with an ignore count).

    === main.py =================================

    def bar():
        x = 1
        x = 2
    
    bar()

    =================================================

    $ python -m pdb main.py 
    > /path_to/main.py(1)<module>()
    -> def bar():
    (Pdb) import sys; print(sys.version)
    3.3.0a3+ (default:4e9680570be8, May 11 2012, 12:09:15) 
    [GCC 4.3.2]
    (Pdb) break bar
    Breakpoint 1 at /path_to/main.py:1
    (Pdb) break bar
    Breakpoint 2 at /path_to/main.py:1
    (Pdb) continue
    > /path_to/main.py(2)bar()
    -> x = 1
    (Pdb) continue
    > /path_to/main.py(3)bar()
    -> x = 2
    (Pdb) quit

    =================================================

    The attached patch fixes the problem. This patch also fixes the
    following problems that are caused by the same bug:

    * when more than one breakpoint is set on the same line, only the
      command of the first effective breakpoint is run, and only the
      hit count and the ignore count of the first effective breakpoint
      are updated
    

    The patch includes a test case for all those problems.

    @xdegaye xdegaye mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels May 12, 2012
    @xdegaye
    Copy link
    Mannequin Author

    xdegaye mannequin commented May 25, 2012

    Parsing the modules source seems a better way to fix this problem, see bpo-14913.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @gaogaotiantian
    Copy link
    Member

    Now that the breakpoint is parsed better, this issue does not appear anymore. Close.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant