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.

Co-authored-by: AN Long <[email protected]>
Co-authored-by: AN Long <[email protected]>
@cocolato
Copy link
Contributor Author

cocolato commented Dec 9, 2025

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

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