<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sun May 19 22:52:46 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-734/CLJ-734.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-734] starting scope of let bindings seems incorrect from jdi perspective</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-734</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;It appears like the clojure compiler doesn&apos;t get the starting scope of let bindings right from the java debug interface perspective.&lt;/p&gt;

&lt;p&gt;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&apos;t eval the already defined bindings until you get to the let body. &lt;/p&gt;

&lt;p&gt;Because it is a compiler problem, you see the symptoms with any jdi based debugger, (I&apos;ve confirmed this on both jdb and cdt.)&lt;/p&gt;

&lt;p&gt;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&apos;ve attached a patch for clojure 1.2 branch.  (If there is interest I&apos;ll create one for clojure master.)&lt;/p&gt;</description>
                <environment></environment>
            <key id="14347">CLJ-734</key>
            <summary>starting scope of let bindings seems incorrect from jdi perspective</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="george">George Jahad</reporter>
                        <labels>
                    </labels>
                <created>Sun, 30 Jan 2011 16:45:05 -0600</created>
                <updated>Fri, 11 Mar 2011 10:21:22 -0600</updated>
                    <resolved>Fri, 11 Mar 2011 10:21:22 -0600</resolved>
                            <version>Release 1.2</version>
                                <fixVersion>Release 1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="26204" author="george" created="Sun, 30 Jan 2011 19:15:20 -0600"  >&lt;p&gt;here is the diff against the current clojure master branch.&lt;/p&gt;</comment>
                    <comment id="26207" author="george" created="Sun, 30 Jan 2011 22:25:23 -0600"  >&lt;p&gt;re-added patch in proper format&lt;/p&gt;</comment>
                    <comment id="26208" author="george" created="Mon, 31 Jan 2011 12:41:07 -0600"  >&lt;p&gt;To test: start clojure with a jdi port, (like 8050 below)&lt;br/&gt;
java  -agentlib:jdwp=transport=dt_socket,address=8050,server=y,suspend=n  -cp  /Users/georgejahad/incoming/clojure-1.3.0-alpha4/clojure.jar clojure.main&lt;/p&gt;

&lt;p&gt;Then start jdb and attach to that port like so:&lt;br/&gt;
jdb -attach 8050&lt;/p&gt;

&lt;p&gt;Set a breakpoint on pmap from jdb:&lt;br/&gt;
stop in clojure.core$pmap.invoke&lt;/p&gt;

&lt;p&gt;Invoke pmap from the clojure repl:&lt;/p&gt;

&lt;p&gt;(pmap inc (range 6))&lt;/p&gt;


&lt;p&gt;From jdb, step over the first line of pmap, (that binds the local n):&lt;br/&gt;
next&lt;/p&gt;

&lt;p&gt;From jdb, try to print the just bound local:&lt;br/&gt;
print n&lt;/p&gt;


&lt;p&gt;Without the patch, you&apos;ll see:&lt;br/&gt;
com.sun.tools.example.debug.expr.ParseException: Name unknown: n&lt;br/&gt;
n = null&lt;/p&gt;

&lt;p&gt;With it, you should see n equal to the correct value:&lt;br/&gt;
n = 4&lt;/p&gt;</comment>
                    <comment id="26226" author="stu" created="Tue, 22 Feb 2011 17:29:26 -0600"  >&lt;p&gt;Rich: does this need to be rewritten so that BindingInit is a value, or is the mutation of startScope ok?&lt;/p&gt;

&lt;p&gt;Patch works against master.&lt;/p&gt;</comment>
                    <comment id="26240" author="richhickey" created="Fri, 25 Feb 2011 09:40:35 -0600"  >&lt;p&gt;Yes, it is weird to mutate bindinginit with emit-related info. Better to keep a map of bindinginit-&amp;gt;label inside doEmit, please.&lt;/p&gt;</comment>
                    <comment id="26246" author="george" created="Sat, 26 Feb 2011 12:39:00 -0600"  >&lt;p&gt;fixed to use HashMap of labels&lt;/p&gt;</comment>
                    <comment id="26274" author="stu" created="Fri, 4 Mar 2011 21:21:52 -0600"  >&lt;p&gt;Feb 26 patch is good&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10124" name="clj-734.diff" size="1967" author="george" created="Sat, 26 Feb 2011 12:39:00 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10007">Ok</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10010">New</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>
</channel>
</rss>