In Starlark debugger, emit comprehension variables in new frames rather than in their enclosing function's frame
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
Cloned from https://github.com/bazelbuild/bazel/issues/24919#issuecomment-2593098691:
From @fmeum:
> I checked what PyCharm's debugger is doing in this case. It emits additional `` frame that holds the value of `x` as passed into `g` through `j`. The frame below it has `x` at the value passed into `foo` (and later updated via the `+=`).
A new frame is probably the right way to present this. Unfortunately, while this is easy in cpython (where I believe the intepreter physically pushes new frames for comprehensions), it's not easy in starlark (to save memory, the starlark resolver puts comprehension's variables into the enclosing function's frame).
Contributor guide
Research direction
Start by tracing the Starlark debugger's frame handling alongside the resolver behavior that places comprehension variables in the enclosing function's frame. Compare the result with the described PyCharm behavior; done means comprehension variables appear in their own debugger frames while the enclosing frame retains its original values.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100