mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 21:20:37 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
389d8dff49
commit
a7e8ae4b08
@ -56,8 +56,8 @@ For later versions of Visual Studio, no setup is required.
|
||||
</Expand>
|
||||
</Type>
|
||||
<Type Name="llvm::SmallString<*>">
|
||||
<DisplayString>{BeginX,s}</DisplayString>
|
||||
<StringView>BeginX,s</StringView>
|
||||
<DisplayString>{(const char*)BeginX,[(char*)EndX - (char*)BeginX] na}</DisplayString>
|
||||
<StringView>(const char*)BeginX,[(char*)EndX - (char*)BeginX]</StringView>
|
||||
<Expand>
|
||||
<Item Name="[size]">(char*)EndX - (char*)BeginX</Item>
|
||||
<Item Name="[capacity]">(char*)CapacityX - (char*)BeginX</Item>
|
||||
|
Loading…
Reference in New Issue
Block a user