BUG: Line Number Information Incorrect with /DEBUGTYPE:both (122266)



The information in this article applies to:

  • The Linker (LINK.EXE), when used with:
    • Microsoft Visual C++, 32-bit Professional Edition 2.0

This article was previously published under Q122266

SYMPTOMS

Microsoft Format (CV) and COFF debugging formats can be used at the same time. To get both formats, use the /DEBUGTYPE:both linker switch or in the development environment, go to the Project menu, select Settings, choose the Link tab, choose the Debug category, and select Both Formats.

When both Microsoft Format (CV) and COFF debugging formats are used in the same application, incorrect line number information will be generated for functions that are not in the main .CPP file. Usually these are inline functions, included in header (.H) or inline (.INL) files by using #include.

Incorrect line number debugging information will show up when stepping through the program in the integrated debugger. As you step through the functions included in other files, the debugger will continue to show the current file.

RESOLUTION

You can work around this problem by including either Microsoft Format (CV) or COFF debugging formats, but not both, in the same executable. The integrated debugger uses Microsoft Format (CV), so it is the preferred format.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The following sample code demonstrates the problem. If you build the file with /link /DEBUGTYPE:both, and then press the F8 key while inside, the integrated debugger will not step into the Test1() or Test2() functions. Instead, it skips around within TEST.CPP.

Sample Code

/* Compile options needed: /Zi
      Be sure to link with /DEBUGTYPE:both
*/ 

/****** test.cpp ******/ 

#include "test.inl"

void main(void)
{
Test1(Test2(2));
}

/****** test.inl ******/ 

int Test1(int i)
{
    return i*i;
}

int Test2(int j)
{
    return j*j+j;
}
				

Modification Type:MajorLast Reviewed:10/17/2003
Keywords:KB122266