-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the bug
Cygdb CLI commands (e.g. cygdb /path/to/debug/info, cygdb --) do not process the BUILD_DIR argument
(aka "path_to_debug_info") as expected.
A number of user guides (Cython's, Pandas', @WillAyd's) expect that when a user types cygdb, Cygdb will import debug information from the current directory, which is currently broken. This is one example, see the table below for more. I believe this should be fixed in master asap, in order to keep Cygdb friendly to new users.
I assume that intended behaviour is described in the User Guide - Debugging (~15 years old), and that the only desired change
since 3.0.x is the addition of --build-dir /path/to/debug/info, which used to be positional (now deprecated).
Here is a summary of intended vs actual (current) behaviour for various CLI calls.
| command | 3.0.x intended |
3.0.x actual |
master intended |
master actual |
|---|---|---|---|---|
cygdb |
import curdir | ✔ import curdir | import curdir | ❌ no import1 |
cygdb . |
import curdir | ✔ import curdir | import curdir | ❌ no import1 |
cygdb /path/ |
import /path/ | ❌ import curdir2 | import /path/ | ❌ no import1 |
cygdb -- |
no import | ❌ import curdir2 | no import | ⚠ no import3 |
cygdb --build-dir . |
N/A | ✔ error | import curdir | ✔ import curdir |
cygdb --build-dir /path/ |
N/A | ✔ error | import /path/ | ✔ import /path/ |
Code to reproduce the behaviour:
# example codeExpected behaviour
No response
OS
No response
Python version
3.10.16+
Cython version
master
Additional context
I propose the following.
- A "quick fix" PR for the master branch will be supplied in short time.
- If needed, I can produce another "quick fix" for related issues in
3.0.xbranch.
However, the broken behaviour seems to have been around for a while, so some users may actually rely on it. - Discuss changes in
cygdbcommand arguments to completely move away from positional arguments to keywords.
In particular,cygdb --could be deprecated by introducing--no-importkey,
as was initially proposed in Upgrade cygdb from optparse to argparse #5499 (but not included in the final version).
Footnotes
-
These bugs were introduced in Upgrade cygdb from optparse to argparse #5499. ↩ ↩2 ↩3
-
These bugs were introduced in 60dff16 when moving from
sys.argvtooptparse.
Unlikesys.argv,optparseandargparsedo not regard--as an argument incygdb --. ↩ ↩2 -
The correct behaviour is achieved by accident, the code is not doing what one might expect. ↩