Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
18e6e9c
Allow using sys.monitoring for bdb
gaogaotiantian Sep 25, 2024
b29aff5
Add basic line ignore
gaogaotiantian Sep 25, 2024
23601f3
Use setttrace as default backend for bdb
gaogaotiantian Sep 25, 2024
c9a92f6
📜🤖 Added by blurb_it.
blurb-it[bot] Sep 25, 2024
8955d78
Use settrace by default for pdb.Pdb, but use monitoring for all
gaogaotiantian Sep 26, 2024
6afc2e7
Only trigger events on thread calling start_trace
gaogaotiantian Oct 16, 2024
b595682
Use local events when possible
gaogaotiantian Oct 16, 2024
addf465
Merge branch 'main' into pdb-use-monitoring
gaogaotiantian Jan 19, 2025
70d5138
Fix ignore and condition of breakpoints
gaogaotiantian Feb 8, 2025
7c83425
Merge branch 'main' into pdb-use-monitoring
gaogaotiantian Feb 8, 2025
fe9971c
Address comments about backend
gaogaotiantian Feb 18, 2025
69a5030
Merge branch 'main' into pdb-use-monitoring
gaogaotiantian Feb 18, 2025
05cc3b0
We need BaseException to handle SystemExit case
gaogaotiantian Feb 18, 2025
e6bc287
Move default_backend to module level and provide utils
gaogaotiantian Feb 19, 2025
f0c1306
Do not need to pass trace_dispatch explicitly
gaogaotiantian Feb 19, 2025
a9b53ed
Add docs
gaogaotiantian Feb 19, 2025
9790085
Add version added
gaogaotiantian Feb 19, 2025
ea811f2
Add new functions to __all__
gaogaotiantian Feb 19, 2025
ad2179e
Merge branch 'main' into pdb-use-monitoring
gaogaotiantian Mar 7, 2025
e4ccd8a
Restart events after user line
gaogaotiantian Mar 7, 2025
d2c1f2e
Merge branch 'main' into pdb-use-monitoring
gaogaotiantian Mar 17, 2025
e9252ec
Remove blank line
gaogaotiantian Mar 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restart events after user line
  • Loading branch information
gaogaotiantian committed Mar 7, 2025
commit e4ccd8a6bc324fda246cc5c99a447bf8f449a20f
1 change: 1 addition & 0 deletions Lib/bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def dispatch_line(self, frame):
"""
if self.stop_here(frame) or self.break_here(frame):
self.user_line(frame)
self.restart_events()
if self.quitting: raise BdbQuit
elif not self.get_break(frame.f_code.co_filename, frame.f_lineno):
self.disable_current_event()
Expand Down
42 changes: 42 additions & 0 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,48 @@ def test_pdb_breakpoint_with_filename():
(Pdb) continue
"""

def test_pdb_breakpoint_on_disabled_line():
"""New breakpoint on once disabled line should work

>>> reset_Breakpoint()
>>> def test_function():
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... for i in range(3):
... j = i * 2
... print(j)

>>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
... 'break 5',
... 'c',
... 'clear 1',
... 'break 4',
... 'c',
... 'clear 2',
... 'c'
... ]):
... test_function()
> <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>(2)test_function()
-> import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
(Pdb) break 5
Breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>:5
(Pdb) c
> <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>(5)test_function()
-> print(j)
(Pdb) clear 1
Deleted breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>:5
(Pdb) break 4
Breakpoint 2 at <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>:4
(Pdb) c
0
> <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>(4)test_function()
-> j = i * 2
(Pdb) clear 2
Deleted breakpoint 2 at <doctest test.test_pdb.test_pdb_breakpoint_on_disabled_line[1]>:4
(Pdb) c
2
4
"""

def test_pdb_breakpoints_preserved_across_interactive_sessions():
"""Breakpoints are remembered between interactive sessions

Expand Down