Skip to content

Pdb does not stop at a breakpoint #58956

Closed

Description

@xdegaye
mannequin
BPO 14751
Nosy @xdegaye
Files
  • pdb_default.patch
  • pdb_default_2.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-08.13:00:17.907>
    labels = ['type-bug', 'library']
    title = 'Pdb does not stop at a breakpoint'
    updated_at = <Date 2012-05-13.15:48:49.831>
    user = 'https://github.com/xdegaye'

    bugs.python.org fields:

    activity = <Date 2012-05-13.15:48:49.831>
    actor = 'xdegaye'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2012-05-08.13:00:17.907>
    creator = 'xdegaye'
    dependencies = []
    files = ['25494', '25561']
    hgrepos = []
    issue_num = 14751
    keywords = ['patch']
    message_count = 2.0
    messages = ['160202', '160518']
    nosy_count = 1.0
    nosy_names = ['xdegaye']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14751'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    Linked PRs

    Activity

    1. xdegaye commented on May 8, 2012

      xdegayemannequin
      MannequinAuthor

      When a breakpoint is set in one of the frames of the frame stack, Pdb
      may not stop at that breakpoint when the frame does not have a trace
      function. This problem is closely related to bpo-13183 and issue
      14728. The following scenario demonstrates this problem.

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

      import bar
      
      def foo():
          bar.bar()
          x = 1
      
      foo()
      ====   bar.py  ==================================
      def bar():
          pass

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

      $ python3 -m pdb main.py 
      > /path_to/main.py(1)<module>()
      -> import bar
      (Pdb) import sys; print(sys.version)
      3.2.2 (default, Dec 27 2011, 17:35:55) 
      [GCC 4.3.2]
      (Pdb) break bar.bar
      Breakpoint 1 at /path_to/bar.py:1
      (Pdb) continue
      > /path_to/bar.py(2)bar()
      -> pass
      (Pdb) break main.py:5
      Breakpoint 2 at /path_to/main.py:5
      (Pdb) continue
      The program finished and will be restarted
      > /path_to/main.py(1)<module>()
      -> import bar
      (Pdb) quit

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

      The attached patch fixes this problem. A test case is included in the
      patch. The patch is made against the proposed fix of bpo-14728 (i.e.
      assumes this patch is applied), the reason being that self._curframe
      must be correctly set. Actually this issue and bpo-14728 should
      probably be merged.

      Note that the trace function does not need anymore to be set in all
      the frames of the frame stack in set_trace(), so setting the trace
      function has been removed from the while loop.

    2. added
      stdlib
      type-bug
      on May 8, 2012
    3. xdegaye commented on May 13, 2012

      xdegayemannequin
      MannequinAuthor

      Uploaded pdb_default_2.patch that corrects the initial patch: the
      trace function must be set in all frames whose co_filename is the
      breakpoint file name and not just the first frame of this set.

    4. transferred this issue fromon Apr 10, 2022
    5. added a commit that references this issue on Oct 15, 2024
    6. added 2 commits that reference this issue on Oct 15, 2024
    7. gaogaotiantian commented on Oct 15, 2024

      @gaogaotiantian
      Member

      Fixed in #124454

    8. added a commit that references this issue on Oct 15, 2024
    9. added a commit that references this issue on Jan 12, 2025
    10. added a commit that references this issue on Jan 17, 2025
    11. added a commit that references this issue on Jan 17, 2025
    12. added 3 commits that reference this issue on Jan 17, 2025
    13. added a commit that references this issue on Jan 21, 2025
    14. added a commit that references this issue on Jan 25, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Labels

    stdlibtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions