[cfe-dev] Easier debugging with Visual Studio Visualizers

Nikola Smiljanic popizdeh at gmail.com
Tue Jul 26 10:44:59 PDT 2011

On Tue, Jul 26, 2011 at 7:19 PM, David Blaikie <dblaikie at gmail.com> wrote:

> > Added visualizer for StringRef (assumes null terminated string which I
> know
> > isn't the case always, but I don't think there's a way around this)
> That's curious - though I just verified that even VS2010's
> std::basic_string visualizer has the same limitation. Pity.
> int main()
> {
>    const char xs[] = "foo\0bar";
>    std::string x(xs, xs + sizeof(xs));
> }
> (mouseover at 'x' shows only "foo" in the preview, though the details
> show a size of 8 & both null characters in there)

This is because tooltip (preview section) is evaluated using format
specifiers <http://msdn.microsoft.com/en-us/library/75w45ekt(v=VS.100).aspx>and
they only support null-terminated strings (there is more about this
inside autoexp.dat). Details are evaluated using #array and correct size, so
there is at least a way to get to all the characters.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110726/47634a3e/attachment.html>

More information about the cfe-dev mailing list