VC++ 7.0 Debugger/IDE Bug? std::string display 
Author Message
 VC++ 7.0 Debugger/IDE Bug? std::string display

It appears as if the VC++ 7.0 IDE/De{*filter*} doesn't display strings as
it once did.  The problem shows up when an assignment operation causes
the string to _Grow.  On my platform, this is for character sequences
whose length exceed 15 characters.

std::string strStringShort = "LessThen15";

        - strStringShort will display in the de{*filter*} as "LessThan15"

std::string strStringLong = "123123123123123123123123123123";
        - strStringLong will display junk

The string in other operations (assignment or std output for instance)
behaves properly... it just appears to be a simple de{*filter*} display
problem.

The value displayed is that of

std::string._Bx._Buf

instead of

std::string._Bx._Ptr

HOWEVER...

when _Grow has not taken place, _Buf DOES in fact point to the
location where the literal characters live.  

Thought I'd share...  

James



Tue, 11 Jan 2005 05:51:30 GMT  
 VC++ 7.0 Debugger/IDE Bug? std::string display
This has been discussed in detail in an earlier thread. See

            http://www.*-*-*.com/

Also see if the following VS add-in solves the issue.

            http://www.*-*-*.com/

--
Cheers
Check Abdoul
----------------


Quote:
> It appears as if the VC++ 7.0 IDE/De{*filter*} doesn't display strings as
> it once did.  The problem shows up when an assignment operation causes
> the string to _Grow.  On my platform, this is for character sequences
> whose length exceed 15 characters.

> std::string strStringShort = "LessThen15";

> - strStringShort will display in the de{*filter*} as "LessThan15"

> std::string strStringLong = "123123123123123123123123123123";
> - strStringLong will display junk

> The string in other operations (assignment or std output for instance)
> behaves properly... it just appears to be a simple de{*filter*} display
> problem.

> The value displayed is that of

> std::string._Bx._Buf

> instead of

> std::string._Bx._Ptr

> HOWEVER...

> when _Grow has not taken place, _Buf DOES in fact point to the
> location where the literal characters live.

> Thought I'd share...

> James



Tue, 11 Jan 2005 06:45:11 GMT  
 VC++ 7.0 Debugger/IDE Bug? std::string display
It works for fewer than 16 characters because the STL has an optimization
for small strings: it keeps them in the body of the basic_string object
instead of getting a pointer to dynamically allocated memory block.

K. Lilov
Str Library at http://www.*-*-*.com/


Quote:
> It appears as if the VC++ 7.0 IDE/De{*filter*} doesn't display strings as
> it once did.  The problem shows up when an assignment operation causes
> the string to _Grow.  On my platform, this is for character sequences
> whose length exceed 15 characters.

> std::string strStringShort = "LessThen15";

> - strStringShort will display in the de{*filter*} as "LessThan15"

> std::string strStringLong = "123123123123123123123123123123";
> - strStringLong will display junk

> The string in other operations (assignment or std output for instance)
> behaves properly... it just appears to be a simple de{*filter*} display
> problem.

> The value displayed is that of

> std::string._Bx._Buf

> instead of

> std::string._Bx._Ptr

> HOWEVER...

> when _Grow has not taken place, _Buf DOES in fact point to the
> location where the literal characters live.

> Thought I'd share...

> James



Tue, 11 Jan 2005 21:32:04 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VC++ 7.0 Debugger/IDE Bug? std::string display

2. How to display std::string in debugger

3. bug in vc++ 5.0 using std::string

4. How to use VC 7.0 C++ compiler from VC 6.0 IDE

5. VC++ debugger stops displaying Unicode strings

6. INFO: Display of STL strings in VC++ 5.0 debugger

7. Display of STL strings in VC++ 5.0 debugger

8. INFO: Display of STL strings in VC++ 5.0 debugger

9. How to display the contents of a std::vector automatically in the debugger

10. How to display the contents of a std::vector automatically in the debugger

11. a bug in VC 7.0 (but not in VC 6.0)

12. Bug in IDE/Debugger regarding breakpoints (VC2003)

 

 
Powered by phpBB® Forum Software