<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mixed Language Debugging Problem in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928327#M87115</link>
    <description>&lt;P&gt;I've set up a simple VisualStudio 2010 solution which contains a VB Windows Form project and a IVFComposer XE 2013 library project. &amp;nbsp;The windows form has a single button on it. &amp;nbsp;Here's the code for the form:&lt;/P&gt;
&lt;P&gt;Public Class Form1&lt;/P&gt;
&lt;P&gt;Public Declare Sub IVFTest Lib "IVFTest.dll" Alias "IVFTest" ()&lt;/P&gt;
&lt;P&gt;Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click&lt;/P&gt;
&lt;P&gt;IVFTest()&lt;/P&gt;
&lt;P&gt;End Sub&lt;BR /&gt;End Class&lt;/P&gt;
&lt;P&gt;The Fortran code is also very simple:&lt;/P&gt;
&lt;P&gt;! IVFTest.f90 &lt;BR /&gt;!&lt;BR /&gt;! FUNCTIONS/SUBROUTINES exported from IVFTest.dll:&lt;BR /&gt;! IVFTest - subroutine &lt;BR /&gt;!&lt;BR /&gt;subroutine IVFTest&lt;/P&gt;
&lt;P&gt;! Expose subroutine IVFTest to users of this DLL&lt;BR /&gt; !&lt;BR /&gt; !DEC$ATTRIBUTES ALIAS:'IVFTest'::IVFTest&lt;BR /&gt; !DEC$ ATTRIBUTES DLLEXPORT::IVFTest&lt;/P&gt;
&lt;P&gt;! Variables&lt;BR /&gt; x = 3.&lt;BR /&gt; y = 5.&lt;BR /&gt; x = x + y&lt;/P&gt;
&lt;P&gt;! Body of IVFTest&lt;BR /&gt;print *, 'Hello World'&lt;/P&gt;
&lt;P&gt;end subroutine IVFTest&lt;/P&gt;
&lt;P&gt;I've set a break point in the IVF code on the line "x = 3." &amp;nbsp;When I run the solution in debug mode and click the button the code stops on the line where I've set my breakpoint. &amp;nbsp;So far, so good. &amp;nbsp;Unfortunately as soon as I select F8 (single step) I get Unhandled exception at 0x77da15de (ntdll.dll) in VB_IVFTest.exe: 0xC0000005: Access Violation.&lt;/P&gt;
&lt;P&gt;Now suppose I set a break point on a later line. &amp;nbsp;Run the program again and click the button. First breakpoint is hit. &amp;nbsp;If I now hit F5 (Start Debugging) the program runs to my second breakpoint as expected.&lt;/P&gt;
&lt;P&gt;I'm using Windows 7 on a 64-bit machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea what's happneing? &amp;nbsp;Why can't I single step?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2013 16:00:29 GMT</pubDate>
    <dc:creator>CharlieG</dc:creator>
    <dc:date>2013-06-20T16:00:29Z</dc:date>
    <item>
      <title>Mixed Language Debugging Problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928327#M87115</link>
      <description>&lt;P&gt;I've set up a simple VisualStudio 2010 solution which contains a VB Windows Form project and a IVFComposer XE 2013 library project. &amp;nbsp;The windows form has a single button on it. &amp;nbsp;Here's the code for the form:&lt;/P&gt;
&lt;P&gt;Public Class Form1&lt;/P&gt;
&lt;P&gt;Public Declare Sub IVFTest Lib "IVFTest.dll" Alias "IVFTest" ()&lt;/P&gt;
&lt;P&gt;Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click&lt;/P&gt;
&lt;P&gt;IVFTest()&lt;/P&gt;
&lt;P&gt;End Sub&lt;BR /&gt;End Class&lt;/P&gt;
&lt;P&gt;The Fortran code is also very simple:&lt;/P&gt;
&lt;P&gt;! IVFTest.f90 &lt;BR /&gt;!&lt;BR /&gt;! FUNCTIONS/SUBROUTINES exported from IVFTest.dll:&lt;BR /&gt;! IVFTest - subroutine &lt;BR /&gt;!&lt;BR /&gt;subroutine IVFTest&lt;/P&gt;
&lt;P&gt;! Expose subroutine IVFTest to users of this DLL&lt;BR /&gt; !&lt;BR /&gt; !DEC$ATTRIBUTES ALIAS:'IVFTest'::IVFTest&lt;BR /&gt; !DEC$ ATTRIBUTES DLLEXPORT::IVFTest&lt;/P&gt;
&lt;P&gt;! Variables&lt;BR /&gt; x = 3.&lt;BR /&gt; y = 5.&lt;BR /&gt; x = x + y&lt;/P&gt;
&lt;P&gt;! Body of IVFTest&lt;BR /&gt;print *, 'Hello World'&lt;/P&gt;
&lt;P&gt;end subroutine IVFTest&lt;/P&gt;
&lt;P&gt;I've set a break point in the IVF code on the line "x = 3." &amp;nbsp;When I run the solution in debug mode and click the button the code stops on the line where I've set my breakpoint. &amp;nbsp;So far, so good. &amp;nbsp;Unfortunately as soon as I select F8 (single step) I get Unhandled exception at 0x77da15de (ntdll.dll) in VB_IVFTest.exe: 0xC0000005: Access Violation.&lt;/P&gt;
&lt;P&gt;Now suppose I set a break point on a later line. &amp;nbsp;Run the program again and click the button. First breakpoint is hit. &amp;nbsp;If I now hit F5 (Start Debugging) the program runs to my second breakpoint as expected.&lt;/P&gt;
&lt;P&gt;I'm using Windows 7 on a 64-bit machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea what's happneing? &amp;nbsp;Why can't I single step?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 16:00:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928327#M87115</guid>
      <dc:creator>CharlieG</dc:creator>
      <dc:date>2013-06-20T16:00:29Z</dc:date>
    </item>
    <item>
      <title>I just tried following the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928328#M87116</link>
      <description>&lt;P&gt;I just tried following the steps you list and it works for me. I do have a couple of comments.&lt;/P&gt;
&lt;P&gt;1) Any routine you call from VB needs to be STDCALL. In the example you show, it doesn't matter because the subroutine has no arguments, but if you added arguments you would get stack corruption on return from the Fortran routine.&lt;/P&gt;
&lt;P&gt;2) The PRINT will be discarded as there is no console.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 17:30:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928328#M87116</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-06-20T17:30:37Z</dc:date>
    </item>
    <item>
      <title>Thanks for the comments Steve</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928329#M87117</link>
      <description>&lt;P&gt;Thanks for the comments Steve.&amp;nbsp; As you probably guessed my real problem is with a more complex solution.&amp;nbsp; I just threw this example together to demonstrate the issue.&amp;nbsp; I must have a "confused" Visual Studio 2010.&amp;nbsp; I just tried opening and debugging the application in Visual Studio 2012 and everything's back to working as expected.&amp;nbsp; Thanks for confirming that it should also work in VS 2010.&amp;nbsp; Looks like there's an uninstall/reinstall in my future.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 19:49:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928329#M87117</guid>
      <dc:creator>CharlieG</dc:creator>
      <dc:date>2013-06-20T19:49:37Z</dc:date>
    </item>
    <item>
      <title>Yes, I did guess that this</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928330#M87118</link>
      <description>&lt;P&gt;Yes, I did guess that this was not representative of your real application. Please take my comment about STDCALL - if your real application passed arguments to the Fortran routine, and you omitted STDCALL, this would corrupt the stack and could result in this error.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2013 23:34:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Mixed-Language-Debugging-Problem/m-p/928330#M87118</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-06-20T23:34:34Z</dc:date>
    </item>
  </channel>
</rss>

