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

Trouble with general debugging

lkeene
Beginner
391 Views
Hello,

I'm developing my app with VS2008/Intel C++ 11.1/Windows 7. When the app is compiled with the Intel C++ compiler it seems to run just fine...but recently I tried to step through line by line with the debugger in Visual Studio and found that the debugger was jumping around the code like crazy, seemingly at random, even though ultimately the results are correct.

I've switched to debug build and gone into the "Project Properties -> Configuration Properties -> C/C++ -> Optimization" and turned off all the optimizations I see listed. I am still unable to step through with the debugger however...it just behaves in a crazy random fashion. I have switched to the Microsoft compiler and stepped through without any trouble. Does anyone have any ideas as to what I'm doing incorrectly here? Thanks in advance.

-Lionel
0 Kudos
6 Replies
TimP
Honored Contributor III
391 Views
This effect might be expected if you have any optimizations turned on, even though you have debug symbols included. It's basically the same in MSVC, except that there aren't as many levels of optimization available.
The full debug configuration should default to /Od as well as /Zi; that should allow you to see all the variables at each step, and step through in a sane order. You probably have to rebuild all to make it take effect when you remove optimizations or switch between debug and release.
0 Kudos
lkeene
Beginner
391 Views
Quoting - tim18
This effect might be expected if you have any optimizations turned on, even though you have debug symbols included. It's basically the same in MSVC, except that there aren't as many levels of optimization available.
The full debug configuration should default to /Od as well as /Zi; that should allow you to see all the variables at each step, and step through in a sane order. You probably have to rebuild all to make it take effect when you remove optimizations or switch between debug and release.

Hi Tim. I've added "/Od /Zi" into the compiler command line window but it hasn't changed the weird behavior.

I've switched to "Debug" mode, rebuilt the project...nothing seems to work. Any other ideas?

-Lionel
0 Kudos
lkeene
Beginner
391 Views
Quoting - tim18
This effect might be expected if you have any optimizations turned on, even though you have debug symbols included. It's basically the same in MSVC, except that there aren't as many levels of optimization available.
The full debug configuration should default to /Od as well as /Zi; that should allow you to see all the variables at each step, and step through in a sane order. You probably have to rebuild all to make it take effect when you remove optimizations or switch between debug and release.

Is there a quick and easy (and foolproof) way to force the compiler to compile in full debug mode? Maybe I'm not setting my options properly. Thanks.

-L
0 Kudos
sqrt
Beginner
391 Views
EDIT: removed because my reply was unrelated
0 Kudos
Dale_S_Intel
Employee
391 Views
Quoting - lkeene

Is there a quick and easy (and foolproof) way to force the compiler to compile in full debug mode? Maybe I'm not setting my options properly. Thanks.

-L

Well, building "Debug" and double checking the opt level and debug opt (-Od and /Zi) should do it. You might want to check the build log to make sure that it is really building the way you expect, and as Tim pointed out you should try to rebuild everything.

Dale

0 Kudos
lkeene
Beginner
391 Views

Well, building "Debug" and double checking the opt level and debug opt (-Od and /Zi) should do it. You might want to check the build log to make sure that it is really building the way you expect, and as Tim pointed out you should try to rebuild everything.

Dale


Hi Dale,

I'm invoking "Rebuild Solution"...I suppose this is what you mean by rebuilding everything. I've double-checked my settings and they are as you have them, with the exception that I'm specifying "/Od" and not "-Od" as you have written. Here is a copy of my "Properties -> C/C++ -> Command Line" specification (some entries are redundant in a futile attempt to get the correct behavior out of the debugger):

/c /Od /I "D:RSIIDL63external" /I "C:Program Files (x86)IntelCompiler11.1�38IPPia32Include" /I "C:Program Files (x86)IntelCompiler11.1�38include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "COSICORRDLL_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /EHsc /RTC1 /MDd /GS /arch:SSE3 /fp:fast /Fo"Debug/" /W3 /nologo /ZI /Qfp-speculationfast /Qopenmp /Od /Zi


How do I check the build log? Where is it located? As usual, thanks in advance everyone.

-L
0 Kudos
Reply