- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are using CVF 6.6 in a project that integrates large legacy Fortran applications into a managed code / ASP.NET / SQL2000 / C# environment. This is done is by compiling the Fortran as DLLs and using the PInvoke feature of the Common Language Runtime to call from managed code into the unmanaged Fortran DLLs. This works fine ? the problem is the development environment, especially the debugging environment.
Right now we have two ways to debug.
1. Debug everything in the Visual Studio 7 environment. As a post-build step in building the Fortran DLLs, copy the .dll and .pdb files created by CVF to the indebug folder of the Visual Studio 7 project. It turns out the VS7 understands the .pdb file that CV6 produces, to some extent. All that is needed is to set ?Enable Unmanaged Debugging? to True in the VS7 project, and then you can set breakpoints and step through both the managed and the unmanaged code. The problem is that the debugging environment for the unmanaged code is not very good ? the debugger doesn?t know what to do with subroutine arguments or Fortran arrays, for example. Also all variable names have to be typed in upper case, variable names starting with ?$? are not recognized, and so on.
2. Debug the Fortran code in VS6. Set the ?Executable for debug session? to point to the .EXE file that starts the main managed code program. The problem here is that you only can debug the Fortran part of the application.
I get the impression there is a new Intel compiler release coming up that will run in the Visual Studio 7 development environment. I assume (hope) that it will compile anything that CV6 can compile, producing unmanaged DLLs and EXEs just like CVF 6.6 does.
My question is this. Will the new release provide a full-featured environment for debugging unmanaged code that the Fortran compiler emits, while at the same time allowing one to debug managed code that calls the unmanaged code via PInvoke?
I hope the answer is yes. This seems like a must-have feature of your new product.
Right now we have two ways to debug.
1. Debug everything in the Visual Studio 7 environment. As a post-build step in building the Fortran DLLs, copy the .dll and .pdb files created by CVF to the indebug folder of the Visual Studio 7 project. It turns out the VS7 understands the .pdb file that CV6 produces, to some extent. All that is needed is to set ?Enable Unmanaged Debugging? to True in the VS7 project, and then you can set breakpoints and step through both the managed and the unmanaged code. The problem is that the debugging environment for the unmanaged code is not very good ? the debugger doesn?t know what to do with subroutine arguments or Fortran arrays, for example. Also all variable names have to be typed in upper case, variable names starting with ?$? are not recognized, and so on.
2. Debug the Fortran code in VS6. Set the ?Executable for debug session? to point to the .EXE file that starts the main managed code program. The problem here is that you only can debug the Fortran part of the application.
I get the impression there is a new Intel compiler release coming up that will run in the Visual Studio 7 development environment. I assume (hope) that it will compile anything that CV6 can compile, producing unmanaged DLLs and EXEs just like CVF 6.6 does.
My question is this. Will the new release provide a full-featured environment for debugging unmanaged code that the Fortran compiler emits, while at the same time allowing one to debug managed code that calls the unmanaged code via PInvoke?
I hope the answer is yes. This seems like a must-have feature of your new product.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, today's Intel Fortran 7.1 runs in the VS.NET environment and uses its debugger with enhancements to understand Fortran. This version is not fully CVF-compatible - a version to be released late this year is intended to be.
I have no idea, though, how debugging a mixed managed/unmanaged application is handled in general. My assumption is that it is done a lot like debugging a DLL, which is what you are doing now and it should work ok, with the unmanaged code debugging understanding Fortran.
Steve
I have no idea, though, how debugging a mixed managed/unmanaged application is handled in general. My assumption is that it is done a lot like debugging a DLL, which is what you are doing now and it should work ok, with the unmanaged code debugging understanding Fortran.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply, Steve. Is it possible for you to get a more precise answer for us from the Intel Fortran 7.1 folks? We are trying to make some strategic decisions here; we curently own four licenses to CVF 6.6.
Specifically, when the new release of Intel Fortran that is fully compatible with CVF comes out:
## Will I be able to debug simultaneously in an unmanaged Fortran DLL and the managed code that calls into the DLL vi PInvoke?
## Will the debugger recognize and properly handle Fortran arrays, variables in a subroutine that were passed by reference, and variables whose names begin with a "$"?
Specifically, when the new release of Intel Fortran that is fully compatible with CVF comes out:
## Will I be able to debug simultaneously in an unmanaged Fortran DLL and the managed code that calls into the DLL vi PInvoke?
## Will the debugger recognize and properly handle Fortran arrays, variables in a subroutine that were passed by reference, and variables whose names begin with a "$"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have no experience creating managed code applications and don't have the resources to start investigating that. Why don't you download the free 30-day trial of Intel Fortran 7.1 and try it out for yourself? Your second bullet about arrays, etc., should be handled properly in 7.1. I don't think any of this is going to change in Intel Visual Fortran.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's a great idea -- I'll try it.
With any luck the downloaded code won't affect any of my current Visual Studio environment.
With any luck the downloaded code won't affect any of my current Visual Studio environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It won't affect your VS6 environment as long as you don't tell it to integrate into VS6. Select the options during installation for VS.NET integration only.
Let us know what you find out.
Steve
Let us know what you find out.
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page