Microsoft KB Archive/46010: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "<" to "<")
 
Line 90: Line 90:
   void main(void)
   void main(void)
   {
   {
       for (i = 0; i &lt; 20; i++)
       for (i = 0; i < 20; i++)
       {
       {
         j = 0;
         j = 0;
         for (k = 0; k &lt; 20; k++)
         for (k = 0; k < 20; k++)
             if (j == 0)
             if (j == 0)
               break;
               break;

Latest revision as of 09:26, 21 July 2020

Article ID: 46010

Article Last Modified on 10/23/2003



APPLIES TO

  • Microsoft CodeView 4.1
  • Microsoft CodeView 3.0
  • Microsoft CodeView 3.0
  • Microsoft CodeView 3.0
  • Microsoft CodeView 4.0
  • Microsoft CodeView 4.01
  • Microsoft CodeView 4.01
  • Microsoft CodeView 4.1
  • Microsoft CodeView 3.0
  • Microsoft CodeView 3.05
  • Microsoft CodeView 3.06
  • Microsoft CodeView 3.07
  • Microsoft CodeView 4.0
  • Microsoft CodeView 4.01
  • Microsoft CodeView 4.1



This article was previously published under Q46010

SYMPTOMS

CodeView does not recognize a breakpoint set in an application. If you run the program, execution does not stop on the breakpoint. If you single-step through the code, CodeView steps past the specified line. This problem also occurs in the QuickC and Visual C++ integrated debuggers.

CAUSE

This behavior occurs because CodeView is line-based and the C compiler is token-based.

RESOLUTION

This restriction is inherent in the CodeView design. To work around this behavior, select mixed source code and assembly language mode and place the breakpoint on the correct line of assembly language code.

MORE INFORMATION

The following sample code can be used to demonstrate this problem.

Sample Code

     /*
    * Compile options needed: /Zi /Od
    */ 

   int i, j, k, l;

   void main(void)
   {
      for (i = 0; i < 20; i++)
      {
         j = 0;
         for (k = 0; k < 20; k++)
            if (j == 0)
               break;

         j = 1; /*** set breakpoint here ***/ 
      }

      l = 0;
   }
                

Keywords: kbbug kb16bitonly kbdebug kbprb KB46010