Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: Release 1.2
-
Fix Version/s: Release 1.3
-
Component/s: None
-
Labels:None
-
Patch:New
-
Approval:Ok
Description
It appears like the clojure compiler doesn't get the starting scope of let bindings right from the java debug interface perspective.
The compiler sets the starting scope of a local to the let/loop body, rather than to immediately after the local is bound. So when you are stepping through a let statement in a debugger, you can't eval the already defined bindings until you get to the let body.
Because it is a compiler problem, you see the symptoms with any jdi based debugger, (I've confirmed this on both jdb and cdt.)
The fix is pretty straightforward. Just gen.mark() a label after each binding is emitted and use that in the gen.visitLocalVariable() call instead of the loopLabel. I've attached a patch for clojure 1.2 branch. (If there is interest I'll create one for clojure master.)
Attachments
Activity
| Field | Original Value | New Value |
|---|---|---|
| Attachment | letBindings-master.diff [ 10100 ] |
| Fix Version/s | Release.Next [ 10038 ] | |
| Approval | Vetted |
| Attachment | letBindings-master.diff [ 10100 ] |
| Attachment | letBindings1-2.diff [ 10099 ] |
| Attachment | clj-734.diff [ 10105 ] |
| Approval | Vetted | Test |
| Approval | Test | Screened |
| Approval | Screened | Incomplete |
| Waiting On | stu |
| Waiting On | stu | george |
| Attachment | clj-734.diff [ 10105 ] |
| Attachment | clj-734.diff [ 10124 ] |
| Approval | Incomplete | Screened |
| Waiting On | george |
| Approval | Screened | Ok |
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Completed [ 1 ] |
here is the diff against the current clojure master branch.