Skip to content

Conversation

@cocolato
Copy link
Contributor

@cocolato cocolato commented Dec 9, 2025

Support break filename:function syntax

refer: #142468

Description

This PR extends pdb's break command to support the filename:function syntax.

Previously, when a colon was present in the argument, pdb assumed the format was filename:lineno. If the part after the colon wasn't an integer, it would raise a "Bad lineno" error.

This change modifies do_break to catch the ValueError when parsing the line number. If parsing fails, it attempts to resolve the argument as a function name within the specified file using find_function.

cocolato and others added 2 commits December 9, 2025 23:45
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
@cocolato
Copy link
Contributor Author

cocolato commented Dec 9, 2025

If needed, I'll add more test cases later.

@cocolato cocolato changed the title gh-142468: pdb: Support break filename:function syntax gh-142468: pdb: Support break/clear filename:function syntax Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants