Improve natvis for llvm::SmallString so that it correctly displays only the valid...
authorAntonio Maiorano <amaiorano@gmail.com>
Wed, 21 Dec 2016 01:05:29 +0000 (01:05 +0000)
committerAntonio Maiorano <amaiorano@gmail.com>
Wed, 21 Dec 2016 01:05:29 +0000 (01:05 +0000)
commitd9af48a93174591ed7a7318757bf57ccb1761943
tree00b7d8f147f0d578f874667184362fbf1376f98a
parent46abc76f47425df1f2c28e421d18bded7a402a06
Improve natvis for llvm::SmallString so that it correctly displays only the valid portion of the string

The usual method, and the one employed before my change, of displaying strings in natvis is to make use of the "<variable>,s" format specifier; however, this method only works for null-terminated strings. My fix here is to use the "<pointer>,[size]" format specifier to display a bounded array, and then cast it to "const char*", which in the MSVC debugger has the desired effect of rendering the character array as a string.

Differential Revision: https://reviews.llvm.org/D27972

llvm-svn: 290224
llvm/utils/LLVMVisualizers/llvm.natvis