[Lldb-commits] [PATCH] D53989: Fix formatting of wchar, char16, and char32

Zachary Turner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 1 11:52:15 PDT 2018


zturner created this revision.
zturner added a reviewer: jingham.

char16, char32, and wchar_t were previously broken.  If you had a simple variable like `wchar_t x = L'1'` and wrote `p x` LLDB would output `(wchar_t) x = 1\0`.  This is because it was using `eFormatChar` with a size of 2.  What we needed was to introduce a special format specifically for `wchar_t`.  The only valid sizes of `wchar_t` on all existing compilers are 2 and 4, so there's no real point trying to handle sizes of 1 and 8.

Along the way, I accidentally stumbled across the reason that references that char16 and char32 types were also formatting incorrectly, so I fixed that as well.


https://reviews.llvm.org/D53989

Files:
  lldb/include/lldb/lldb-enumerations.h
  lldb/lit/SymbolFile/NativePDB/globals-fundamental.cpp
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Core/DumpDataExtractor.cpp
  lldb/source/Core/ValueObject.cpp
  lldb/source/DataFormatters/FormatManager.cpp
  lldb/source/DataFormatters/VectorType.cpp
  lldb/source/Symbol/ClangASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53989.172193.patch
Type: text/x-patch
Size: 6943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181101/d1e18fad/attachment-0001.bin>


More information about the lldb-commits mailing list