-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot define global variables in .pdbrc #119580
Comments
I may be misunderstanding the paragraph. Perhaps the convenience variable is restricted to the scope of the command and should not be persistent throughout the entire debugging session. Example program from itertools import product
x_axis = range(6)
y_axis = range(6)
for x,y in product(x_axis, y_axis):
... In the same directory
Displays Instead I attempt
Then invoke with
Which does not work either, I'm presuming because there is no breakpoint to associate that command with. What does work is
|
First of all, you listed that you were using Python 3.11, is that the case? Convenience variable is a feature added in Python 3.12 so it won't work with 3.11. |
Ah, let me try 3.12 with your backport |
Defining a convenience variable through With that being said I do find it unclear that convenience variables were added in 3.12 or specific convenience variables ( |
I agree that the added version is not super clear and I can try to improve it. However, about the persistence:
Your program resumes execution between breakpoints so the convenience variables will be cleared. I think this behavior is well-described. |
Yes I misunderstood the behavior of the convenience variables. As such I will close this. |
…le (pythonGH-119583) (cherry picked from commit 3dfa364) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
…le (pythonGH-119583) (cherry picked from commit 3dfa364) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Bug report
Bug description:
#116660 closed gh-90095 to properly handle
commands
issued through-c
or.pdbrc
. Thepdb
documentation also speaks of convenience variables which is a debugging global variable. I was expecting to be able to define a variable starting with$
as defined in the documentation below, and make manipulations to that variable throughcommands
in a.pdbrc
, but doing the following$_capture_list = []
in.pdbrc
issues a syntax errorCPython versions tested on:
3.11
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: