- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The definition of the the function is like that:
#ifdef FLAG
#define FUNC function1
#else
#define FUNC function2
#endif
Is there anybody that confirm this? Is there a way to enable the debugger to step in this case?
I compiled with intel 11.1
Thanx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to reproduce a similar behavior on my side (assuming the call is constructed via preprocessor macros).
The problem is the sole "-I" option without any further argument. Please remove it, make sure it's also not used this (wrong) way elsewhere and recompile the whole project. It should work then.
Using "-I" without further arguments should end in a warning or error from the compiler (driver). I'll file a defect ticket to fix it for future versions.
Best regards,
Georg Zitzlsberger
Edit: Opened a defect ticket (DPD200274939) to print an error when "-I" is last option without further argument. I can only reproduce this for our FORTRAN compiler; our C/C++ compilers are printing a correct error message.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
without a reproducer and information about your command line arguments for the compilers/linkers it's hard to tell what's wrong. Also more information about your system (32/64 bit) and OS would be great.
I'll provide a short version of a "C-main" calling FORTRAN subroutines selected via macros, as you described (Linux/64bit):
module.f90:
[fortran]subroutine test1(x,y) integer x, y write (*,*) "test1:" write (*,*) x, y end subroutine test1 subroutine test2(y,x) integer x, y write (*,*) "test2:" write (*,*) x, y end subroutine test2[/fortran]main.c:
[cpp]#ifdef FLAG #define FUNC test1_ #else #define FUNC test2_ #endif int main(int argc, char **argv) { int x = argc; int y = argc / 2; FUNC(&x,&y); }[/cpp]
$ ifort -g -O0 -c module.f90
$ icc -g -O0 -c main.c -DFLAG
$ icc module.o main.o -lifcore -o test
$ ./test
test1:
1 0
Stepping into the call of FUNC works well with IDB (tested with 11.1 & 12.1 compilers):

Maybe you can comment what's different to your setup to find the problem.
Btw.: Remember that both C & FORTRAN compilation units need debug information for this to work (-g). Ideally all optimizations are turned off, too (-O0).
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I still have the problem I cannot step in one of my functions.
I have a main.c (c) ---> func1 into lib1.a (fortran) ---> func2 into lib2.a (fortran)
the function I cannot step into belongs to lib2.a, so I am stuck with the debugger into a function in lib1.a
Both func1 and func2 belong to two different modules.
I compiled the f90 code with
F90FLAGS=-g -O0 -check bounds -warn all -traceback -align all -align rec8byte
and the c code with
CFLAGS=-ggdb -debug full -O0 -Wall -traceback
I am working in linux.
Please, do you have any hint?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
without a reproducer it's hard to tell what's wrong. Can you create a simple example that I can use for verification? I tried already myself with two FORTRAN modules in separate static libraries but it works (unfortunately).
Also, what does "cannot step" mean; how does it look like?
Assuming you're using the IDB GUI (not command line): Is there a blue bullet at the line you do the call? Can you load the source file from lib2.a you want to step into manually (Open Source File dialog)? Does it show blue bullets on the left then? Can you set a breakpoint manually at the callee (@lib2.a) and stop there?
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting Georg Zitzlsberger (Intel)
without a reproducer it's hard to tell what's wrong. Can you create a simple example that I can use for verification? I tried already myself with two FORTRAN modules in separate static libraries but it works (unfortunately).
Also, what does "cannot step" mean; how does it look like?
Assuming you're using the IDB GUI (not command line): Is there a blue bullet at the line you do the call? Can you load the source file from lib2.a you want to step into manually (Open Source File dialog)? Does it show blue bullets on the left then? Can you set a breakpoint manually at the callee (@lib2.a) and stop there?
Best regards,
Georg Zitzlsberger
If I manage to create a simple example I'll post it.
"cannot step" means that when I am in func1 at the line where I call func2, when I press 's' it goes to the next line in func1 instead of opening the source file for func2.
There is not blue bullet at the line I do the call, I cannot load the source file from lib2.a manually. Does it look like I didn't compile with debug option?
I put debug flag only at compile time for object files, not when I created the static library with ar.
---------------------------------------------------------------
Edit:
I wrote a simple program (only in fortran 90) that uses only lib2.a, without using lib1.a, and idb doesn't step anyway into lib2.a.
I compile the library like
ifort -g -O0 -check bounds -warn all -traceback -align all -align rec8byte -o a.o -c a.f90 -I
ifort -g -O0 -check bounds -warn all -traceback -align all -align rec8byte -o b.o -c b.f90 -I
ifort -g -O0 -check bounds -warn all -traceback -align all -align rec8byte -o c.o -c c.f90 -I
ifort -g -O0 -check bounds -warn all -traceback -align all -align rec8byte -o d.o -c d.f90 -I
/u/shared/programs/x86_64/ifort/11.1.064/bin/intel64/xiar rcvf lib2.a a.o b.o c.o d.o
xiar: executing 'ar'
a - a.o
a - b.o
a - c.o
a - d.o
I don't understand what is going wrong, I usually compile libraries like that and the debugger works!
Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to reproduce a similar behavior on my side (assuming the call is constructed via preprocessor macros).
The problem is the sole "-I" option without any further argument. Please remove it, make sure it's also not used this (wrong) way elsewhere and recompile the whole project. It should work then.
Using "-I" without further arguments should end in a warning or error from the compiler (driver). I'll file a defect ticket to fix it for future versions.
Best regards,
Georg Zitzlsberger
Edit: Opened a defect ticket (DPD200274939) to print an error when "-I" is last option without further argument. I can only reproduce this for our FORTRAN compiler; our C/C++ compilers are printing a correct error message.

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