- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everybody,
I've got a little problem and you might be able to help. Here we go.
I've got a VS2005 solution with fortran and c projects in libraries, dll's and executable code.
I haven't written the code but I have to debug it. And that's the problem.
Everytime I want to debug a fortrancode with an include which has a call to a c-function I'm not able to debug the code, because I'm told that there is no code and I'm redirected to the disassembly.
An easy thing would be to just replace the include-lines with the actual lines of the include.
Example:
Any help will be appreciated, even if you just say screw the include just insert the code into your fortrancode.
I've got a little problem and you might be able to help. Here we go.
I've got a VS2005 solution with fortran and c projects in libraries, dll's and executable code.
I haven't written the code but I have to debug it. And that's the problem.
Everytime I want to debug a fortrancode with an include which has a call to a c-function I'm not able to debug the code, because I'm told that there is no code and I'm redirected to the disassembly.
An easy thing would be to just replace the include-lines with the actual lines of the include.
Example:
Fortran-code (myfcode.f):Inserted everthing is fine and I can debug without problems. The questions remains, is it possible to include calls to C-functions and still be able to debug?
...
dimension i(15)
include "myfortran.i"
...
end
myfortran.i:
if(mycfunction().ne.0)then
call mycmethod()
endif
inserted:
Fortran-code (mynewfcode.f):
...
dimension i(15)
if(mycfunction().ne.0)then
call mycmethod()
endif
...
end
Any help will be appreciated, even if you just say screw the include just insert the code into your fortrancode.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the exact behavior you see? Can you see the Fortran source lines in the include file before the C routine is called? Is it the C routine itself for which no source information is available? Typically you'd have a C static library project in the solution and it would have to be built with debugging enabled so that you could see the source.
I tried an experiment and did see some very strange behavior when trying to debug code that had executable statements in an include file, which made it difficult to debug. I will report that to development. I would suggest that you construct a complete test case and submit it to Intel Premier Support so that we can look at what is happening in your situation.
I tried an experiment and did see some very strange behavior when trying to debug code that had executable statements in an include file, which made it difficult to debug. I will report that to development. I would suggest that you construct a complete test case and submit it to Intel Premier Support so that we can look at what is happening in your situation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot see the Fortran source lines before the C routine is called, but I can debug the C routine. So it seems the sourceinformation for the include is not available. Plus, I cannot debug the Fortran subroutine at all, when there are includes with calls to C routines.
The exact behavoir is a message with some text like 'no source code at the current location' and than I get to the disassembly.
Without the C functioncalls in the includes I have no problem debugging the Fortran code.
Also, when I take the code from the include file and paste it directly into the Fortran code instead of including the file, I can debug the subroutine.
So it seems that the includes aren't correctly linked or something. In the properties I've set 'Preprocess Source Files' to Yes but it hasn't changed a thing. Still no comfortable debugging.
The exact behavoir is a message with some text like 'no source code at the current location' and than I get to the disassembly.
Without the C functioncalls in the includes I have no problem debugging the Fortran code.
Also, when I take the code from the include file and paste it directly into the Fortran code instead of including the file, I can debug the subroutine.
So it seems that the includes aren't correctly linked or something. In the properties I've set 'Preprocess Source Files' to Yes but it hasn't changed a thing. Still no comfortable debugging.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stefan,
Try using Fortran Preprocessor techniques. Requires compiling with the preprocessor option enabled:
Pre-processor include file (MyMacros.inc)
! MyMacros.inc
#define Method_A if(mycfunction_A().ne.0) call mycmethod_A()
#define Method_B if(mycfunction_B().ne.0) call mycmethod_B()
...
Fortran-code (myfcode.f):
! myfcode.f
#include "MyMacros.inc"
! (macros are global to entire source file)
! (not private to program, subroutine, function)
program myfcode
...
dimension i(15)
...
Method_A
Method_B
...
end
inserted:
Fortran-code (mynewfcode.f):
...
dimension i(15)
if(mycfunction_A().ne.0) call mycmethod_A()
if(mycfunction_B().ne.0) call mycmethod_B()
...
end
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jim,
thanks for the reply. Everything works the way it should. Perfect debugging!!! Hooray!!!
thanks for the reply. Everything works the way it should. Perfect debugging!!! Hooray!!!
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