Microsoft KB Archive/77653

= PRB: Bitfield Breakpoint Halts Execution on Neighboring Fields =

Article ID: 77653

Article Last Modified on 12/12/2003

-

APPLIES TO

 The Integrated Debugger, when used with:  Microsoft Visual C++ 6.1

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 5.0 Learning Edition</li></ul>

 Microsoft CodeView for MS-DOS</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q77653

<div class="symptoms_section">

SYMPTOMS
When a break expression specifies a bit field, the debugger does not halt execution at that breakpoint.

<div class="cause_section">

CAUSE
The byte is the smallest addressable unit in the debugger; it does not support specifying an individual bitfield in a breakpoint. The larger unit that contains the bitfield determines when execution halts.

<div class="moreinformation_section">

MORE INFORMATION
Consider the sample code below. In Win16 (Windows), x0 through x7 are stored in the same memory unit (unsigned int), but x8 is stored in the next; in Win32 (Windows NT), x0 through x8 are all stored in the same memory unit. If you set a breakpoint to halt execution when x0 changes, execution in Win16 halts on each of the first three statements in main because each one modifies the same unit; execution in Win32 halts on all four statements of main for the same reason.

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(void) {     NodeVar.x0++; NodeVar.x1++; NodeVar.x3++; NodeVar.x8++; }

Keywords: kbbug kbide kbdebug kbprb KB77653

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.