Is there any way to change the default behavior of Visual Studio's debugger such that when hovering over a null-terminated, dynamically allocated character array (C++), it will display the full content of the string, rather than the first character only?
I should mention that I am using Visual Studio 2010. If there is a way to achieve this in VS2012 only though, I would be interested to know that as well!
There's a useful link for visual studio, C++ Debugger Tips:
For example you break in the following function
in the MSVC watch window (or debugger), you would first try to just add
s
but it will only display the first character. But with the above information, you could append the following suffixes to the variables in the watch window:or if you know it's unicode, try:
This even works for arbitrary pointers, or say for other data types, e.g. debugging the content of a
QString
:For this, possible watch window (or debugger) statements are:
If appending
,s8
or, respectively,su
does not work, try the other variant.