<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This looks like a bug – the issue here is that there’s
a section of code right after the method prologue which is not associated with
any source information (see below to see the raw details). Luckily we
have a command line switch which will get rid of the extra info and make
stepping work for you again, and that’s –X:NoTraceback (the extra
instructions are marking line number info so we can extract it back out at
runtime). The ultimate result of that switch is that exec’d code will
be missing Python line number information.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>In v2.0 we have gotten much more serious about getting the
debugging experience 100% right. We’re starting to bring on test
suites to ensure that all of our debugging information is emitted correctly,
that we step through the various control flow blocks in a reasonable way, etc…
In v1.x we do an alright job but we haven’t dedicated the test resources
to ensure it’s a great experience. Because of that I’m
inclined to not open a bug on this and just say the experience will be much
better in v2.0. Let me know if you think that’s the wrong call </span><span
style='font-size:11.0pt;font-family:Wingdings;color:#1F497D'>J</span><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000000
push ebp <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000001
mov ebp,esp <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000003
push edi <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000004
push esi <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000005
push ebx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000006
sub esp,2Ch <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000009
xor eax,eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000000b
mov dword ptr [ebp-24h],eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000000e
mov dword ptr [ebp-28h],eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000011
mov dword ptr [ebp-38h],eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000014
xor eax,eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000016 mov dword
ptr [ebp-18h],eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000019
mov dword ptr [ebp-30h],ecx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000001c
mov dword ptr [ebp-34h],edx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000001f
cmp dword ptr ds:[036132FCh],0 <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000026
je 0000002D <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000028
call 76A35C56 <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000002d
xor edx,edx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000002f
mov dword ptr [ebp-2Ch],edx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000032
xor edx,edx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000034
mov dword ptr [ebp-38h],edx <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000037
mov dword ptr [ebp-28h],0 <!—F11
steps in here<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000003e
mov dword ptr [ebp-2Ch],2 <!—next
F11 ends up here<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:#A31515'>--- C:\Product\Released\IronPython-1.1\debugger.py
-----------------------------<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'>def add(a,b):<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New"'> return a+b<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000045
nop
<!—one
more and we’re in the function<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000046
mov edx,dword ptr [ebp-34h] <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000049
mov ecx,dword ptr [ebp-30h] <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>0000004c
call dword ptr ds:[001C9150h] <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'>00000052
mov esi,eax <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:8.0pt;
font-family:"Courier New";color:gray'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> users-bounces@lists.ironpython.com
[mailto:users-bounces@lists.ironpython.com] <b>On Behalf Of </b>Julien Couvreur<br>
<b>Sent:</b> Wednesday, May 23, 2007 1:04 PM<br>
<b>To:</b> users@lists.ironpython.com<br>
<b>Subject:</b> [IronPython] Problem stepping into functions in debugger with
F11<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Hi,<br>
<br>
I'm running a simple program below. I'm trying to "step into" the
"add" function. But Visual Studio 2005 and the Microsoft CLR Debugger
(from the .Net 2.0 SDK) both complain that:<o:p></o:p></p>
<pre>"There is no source code available for the current location."<o:p></o:p></pre><pre><o:p> </o:p></pre>
<p class=MsoNormal style='margin-bottom:12.0pt'>They then offer me to view the
disassembly. <br>
Any ideas how to fix this?<br>
<br>
<br>
Note that I do have "Enable Just My Code" turned on (which is the
default). <br>
<br>
Thanks,<br>
Julien Couvreur<span style='font-size:7.5pt'><br>
</span><span style='font-size:10.0pt'><a href="http://blog.monstuff.com">http://blog.monstuff.com</a></span><br>
<br>
<br>
<br>
Repro steps:<br>
1) save the code below to debugger.ipy<br>
2) Run ipy.exe debugger.ipy<br>
3) You should get a prompt to start debugging the code with your favorite
debugger, accept it<br>
4) The code should be stopped at the breakpoint, you can step forward with F10
and then F11<br>
5) Trying to step into the call to the "add" method fails as
described above<br>
<br>
def add(a,b):<br>
return a+b<br>
<br>
import System.Diagnostics<br>
System.Diagnostics.Debugger.Break()<br>
<br>
print add(4, 4) <br>
<br>
<o:p></o:p></p>
</div>
</body>
</html>