Microsoft KB Archive/177937

= FIX: Debugger Cannot Watch Function Returning struct or union =

Article ID: 177937

Article Last Modified on 12/2/2003

-

APPLIES TO

 The Integrated Debugger, when used with:  Microsoft Visual C++ 5.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 5.0 Professional Edition

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q177937

<div class="symptoms_section">

SYMPTOMS
Adding a function call in the Developer Studio debugger Watch window may result in the following message if the function returns a struct or union with a field width greater than 4 bytes:

Error: cannot display value

<div class="resolution_section">

RESOLUTION
There is no workaround for this problem.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This problem was corrected in Microsoft Visual C++ .NET.

<div class="moreinformation_section">

MORE INFORMATION
The following procedure reproduces this problem: <ol>  Create a new console application project and add the following file to the project: /* File: TEST.CPP */

struct _XX {          char   m1; char  m2; char  m3; char  m4; } XX;

struct _XX fun {          return XX; }

int main {          fun; return 0; }                       </li> Build the project.</li> Click Build|Start Debug|Step Into on the Developer Studio menu.</li> Goto the Watch window by selecting View|Debug Windows|Watch.</li> Add the following watch expression in the "Name" column: fun</li></ol>

Results: You will see the message "Error: cannot display value" in the "Value" column.

Keywords: kbbug kbfix kbnoupdate kbide kbdebug KB177937

-

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

© Microsoft Corporation. All rights reserved.