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

Can't debug static lib compiled with ICC under VS2008 correctly.

r4dium
Beginner
351 Views

I don't know if this is an ICC issue, however.....

I have an ICC "Display" project in my solution which basically produces a static "Display.lib"

In "Display" I have several classes.

On some methods of this classes setting breakpoints in VS2008 works (gets fired) on

some it doesn't (famous 'The breakpoint will not currently be hit' VS message).

I use my Display.lib from another "Windows32".dll project (compiled with VC not ICC).

So Display.lib gets statically linked to Windows32.dll .

When I go under Debug->Windows->Modules I can see that pdb symbls have been loaded for Windows32.dll.

Classes in Windows32.dll can be debugged fine.

How can I fully debug my static lib from within VS2008?

Regards

R4DIUM

0 Kudos
3 Replies
TimP
Honored Contributor III
351 Views
Quoting - r4dium

On some methods of this classes setting breakpoints in VS2008 works (gets fired) on

some it doesn't (famous 'The breakpoint will not currently be hit' VS message).

I'm guessing you have built this library with normal optimzations, including function in-lining. For ease of debugging, you might disable it, by something like /Qip-

0 Kudos
r4dium
Beginner
351 Views
Quoting - tim18
Quoting - r4dium

On some methods of this classes setting breakpoints in VS2008 works (gets fired) on

some it doesn't (famous 'The breakpoint will not currently be hit' VS message).

I'm guessing you have built this library with normal optimzations, including function in-lining. For ease of debugging, you might disable it, by something like /Qip-

I went in the properties of the static lib project.

Optimizations are disabled,

InlineFunctionExpansion: Default,

Enable Intrinsic Functions: No

Moreover it seems that I can debug all methods of the static lib which get called by the dll directly.

Adding /Qipto compiler comand line didn't make any difference.

I converted the project back to a VC9 project and now I can debug the static .dll .
The only difference in settings is, that the .lib file now gets placed into the same folder as the .dll file.
When compiling with ICC this wasn't the case, instead I told the dll-linker where to find the .lib file.
But this can't be the cause, right?

Is this .lib-debugging a known constraint when using Intel Compiler with VS2008?

These are the steps taken when trying to solve the problem when using the Intel compiler:

A.) Deletion of all Bin and Obj files/directories + a solution clean + restarting IDE + rebuilding
B.) Told where to find source files more specifically via Solution->Properties->Debug Source Files
C.) When debugging, Debug->Windows->Modules shows the dll using the lib with all symbols loaded normally, also the dll-pdb file gets listed here correctly, more specifically I am even able to locate the symbols of the methods where the breakpoints fail.
D.) I am debugging in (surprise!) DEBUG configuration (and not release)
E.) The properties in dll project show "Generate Debug Info: YES" under linker and "Debug Information Format: PD for Edit and Continue" in compiler settings, the latter is also the case for the lib. project.
F.) Optimizations are off

I would be very grateful for any hint which allows me to use the Intel Compiler for this .lib project while maintaining debugging.

Regards

R4DIUM

0 Kudos
levicki
Valued Contributor I
351 Views

Location of the library shouldn't have anything to do with the (in)ability to debug.

On the other hand, certain optimizations can prevent debugging when enabled:

1. /Oy

2. /Qip-

There are perhaps some others I can't remember at the moment so it would be wise to check the command line options reference. If after testing you determine that it is impossible to debug please file a reproducible test case to Intel Premier Support.

0 Kudos
Reply