Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Local variables not visible in for loops VS debugger when using 11.1.055

lumelskyj__dmytro
1,175 Views

Few days ago i found that in VS2008 i can't see variable in (in for,foreach loops) watch or locals debugging widows and when Im trying to look on variables in local window VS crash. I know that i have old version, i try the same project open in newest intell c++ compiler and problem is the same. I try change debugging options Zi,ZI etc... it is not working.

Please give advice what can i do with this problem!!!, it's so annoying print all variables and vectors to txt file...:(

0 Kudos
11 Replies
Georg_Z_Intel
Employee
1,175 Views
Hello,

if no variables or source file/line information can be displayed/used by the debugger you compiled without debug information.
You mentioned you turned it on for the compiler with options "/ZI" or "/Zi". Did you also turn it on for the linker (/DEBUG)?

When VS is crashing, is there a dialog box? Maybe you can also provide a screenshot of it here. Anyways, try to enable debug information in both compiler & linker first.

If this does not help I'd at least need to know which Intel Composer version you're using and whether it's 32 or 64 bit. Also test a simple C++ "hello world" program first to exclude general problems.

Best regards,

Georg Zitzlsberger
0 Kudos
SergeyKostrov
Valued Contributor II
1,175 Views
Few days ago i found that in VS2008 i can't see variable in (in for,foreach loops) watch or locals debugging widows...

Please give advice what can i do with this problem!!!...

It looks like a problem with Visual Studio 2008. Please check Windows Update because Microsoft
has releasedthree updatesfor Visual Studios 2005, 2008 and 2010 some time ago.
0 Kudos
TimP
Honored Contributor III
1,175 Views
Local variables which can be register optimized may not show up in debugger. The default /Od optimization in debug selection should eliminate such optimization. If you add any higher version of -O to your debug options (as you may wish to do in order to cover release versions), you will optimize away visibility of some local variables.
0 Kudos
horst_schroeder
Beginner
1,175 Views

I have the same problem with more recent versions of compiler and Visual Studio. Variables in loops are not visible. (But I can set breakpoints inside the loops.)

I'm using Parallel Studio XE 2015 Composer C++ and FORTRAN Update 2 with Visual Studio Professional 2013 on Windows 7 64bit platform.

The project has been tranferred from Visual Studio 2008.

Compiler options /Zi and /Od are set, I have added /DEBUG to the linker command line.

I can see all variables when I replace Intel C++ by Visual C++ without any further changes to the settings.

I would prefer to use Intel C++. What can I do?

0 Kudos
Massimo_P_G_
Beginner
1,175 Views

I have exactly the same problem - same versions of software - as reported by horst.shroeder@koelsch-shroeder.de .

We are resorting to building the debug version with Visual C++ rather than the intel compiler, but the situation is far from ideal.  Notice that by using the exact same flags (except for the openmp ones), and switching the compiler to VC++ we are able to see all variables in our debug sessions.

Has anybody found a solution to the problem ?

Thank you - max

0 Kudos
AndrewC
New Contributor III
1,175 Views

I am seeing the same issues ( with full DEBUG on) when using Intel Composer XE 2015 Update 6and both Visual Studio 2013 and Visual Studio 2015. Variables that are not declared in the top level scope of a function are not visible to the debugger . Is there any update on this issue ??? workarounds.

 

 

 

 

0 Kudos
AndrewC
New Contributor III
1,175 Views

I  would point out that this can be an intermittent issue. It does not appear with simple test programs. As previous posters have noted recompiling the same code base with Visual C++ will make the issue go away.

0 Kudos
TimP
Honored Contributor III
1,175 Views

I'm a little surprised that -debug:inline-debug-info has to be set in additional command line options as it isn't available as a specific property. I'm finding that some Qip effects occur in 16.0.3 even though the option appears to be set off in project properties, nor does -Ob0 help.

 

 

 

 

0 Kudos
Kittur_G_Intel
Employee
1,175 Views

BTW, I've escalated this to the engineering team (CQ: DPD200410540) and will keep you updated as soon as I've any update accordingly. Appreciate your patience through this.

Kittur

0 Kudos
Dylan_M_
Beginner
1,175 Views

Confirming behavior reported by vasci_ and others. Using VS2015 (14.0.25123.00 update 2) and Intel Parallel Studio XE 2016 Update 3 C++ (16.0.120.14). It is intermittent (not all functions/methods are affected). I can also confirm the two workarounds reported above:

  1. move the variables to the top-level scope of the method
  2. switch the project to a visual studio project (usually requires some minor changes to flags).

Very interested in a solution. Kittur: is there any timeline for an update?

0 Kudos
Jason_S_6
Beginner
1,175 Views

I've come across a similar issue too, with ICC 2016 update 3, and MSVS 2015 update 3.

Test case:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

	int row = 0 ;
	int col = 0; 
	int nothing = 122 ;
	
	printf("%d\n", nothing) ;
	

	return 0 ;
}

Works fine with MSVS v140.

UnInitializedVS.png

Not so with ICC 16:

UnInitializedICC.png

Fixed using ICC by initializing the variable:

InitializedICC.png

Command line for ICC: /GS /TC /debug:expr-source-pos /W3 /Zc:wchar_t /ZI /Od /Fd"x64\Debug\vc140.pdb" /D "_MBCS" /Zc:forScope /RTC1 /MDd /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Qprof-dir "x64\Debug\" /Qstd=c99 /Fp"x64\Debug\Test.pch"

Command line for VS:  /GS /TC /W3 /Zc:wchar_t /ZI /Gm /Od /sdl /Fd"x64\Debug\vc140.pdb" /Zc:inline /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\Test.pch"

Even with a clean install of Windows 8.1 x64 on a VM, installing on MSVS and ICC I still have these issues.

0 Kudos
Reply