QCW9110005: Breakpoints on Bitfields in QC/Win and CodeView

ID Number: Q77653

1.00

WINDOWS

buglist1.00

Summary:

PROBLEM ID: QCW9110005

SYMPTOMS

In Microsoft QuickC for Windows (QC/Win) version 1.0, if the break

expression is a bitfield, a break will occur whenever any changes

are made to the unit that contains the bitfield.

Specifically, after choosing "Break: If Expr Has Changed" from the

Breakpoints selection of the Debug menu in QC/Win, or after

choosing "Break When Expression Has Changed" from the Set

Breakpoint selection of the Watch menu of CodeView, the problem

will occur.

CAUSE

The QC/Win 1.0 debugger and CodeView 3.0, 3.11, and 3.14 do not

address on a bit level. The smallest unit that can be addressed is

the byte. Therefore, an individual bitfield cannot be monitored.

When a breakpoint is set on a bitfield, the entire unit that the

bitfield resides in is checked when determining if a break should

occur.

STATUS

Microsoft has confirmed this to be a problem in QC/Win version 1.0

and CodeView versions 3.0, 3.11, and 3.14 (buglist3.00,

buglist3.11, and buglist3.14). We are researching this problem and

will post new information here as it becomes available.

More Information:

In the following example, x0 - x7 are bitfields within the same unit,

but x8 is in a different unit. After setting a breakpoint to break

when x0 is changed, the program will break after the first three

statements because they all modify the unit that x0 is a part of. The

last statement doesn't cause a break to occur because x8 is in a

different unit than x0.

Sample Code

-----------

/* Compile options needed: /Zi /Od

*/

typedef struct

{

unsigned int x0:2;

unsigned int x1:2;

unsigned int x2:2;

unsigned int x3:2;

unsigned int x4:2;

unsigned int x5:2;

unsigned int x6:2;

unsigned int x7:2;

unsigned int x8:2;

}node;

node NodeVar;

void main( )

{

NodeVar.x0++;

NodeVar.x1++;

NodeVar.x3++;

NodeVar.x8++;

}

Additional reference words: 1.00 3.00