[all-commits] [llvm/llvm-project] 605fee: [lldb] Trim and show embedded zeros in `charN_t` a...

Nerixyz via All-commits all-commits at lists.llvm.org
Thu May 7 03:15:38 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 605feeda1e50aa0064947e64d66d3351b9f9693e
      https://github.com/llvm/llvm-project/commit/605feeda1e50aa0064947e64d66d3351b9f9693e
  Author: Nerixyz <nerixdev at outlook.de>
  Date:   2026-05-07 (Thu, 07 May 2026)

  Changed paths:
    M lldb/include/lldb/DataFormatters/StringPrinter.h
    M lldb/source/DataFormatters/StringPrinter.cpp
    M lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
    M lldb/source/Plugins/Language/ObjC/NSString.cpp
    M lldb/source/ValueObject/ValueObject.cpp
    M lldb/test/API/lang/cpp/char1632_t/TestChar1632T.py
    M lldb/test/API/lang/cpp/char1632_t/main.cpp
    M lldb/test/API/lang/cpp/char8_t/TestCxxChar8_t.py
    M lldb/test/API/lang/cpp/char8_t/main.cpp
    M lldb/test/API/lang/cpp/wchar_t/TestCxxWCharT.py
    M lldb/test/API/lang/cpp/wchar_t/main.cpp
    M lldb/unittests/DataFormatter/StringPrinterTests.cpp

  Log Message:
  -----------
  [lldb] Trim and show embedded zeros in `charN_t` arrays (#195514)

When formatting `char[N]` (N > 0), the read buffer is limited to the
array size and trailing zeros are trimmed.

`charN_t[N]` was treated like a `charN_t *` and the formatter read until
the first zero byte.
If the array doesn't have any zero bytes in it, this will read too much.
If the array has zero bytes in it, it will show too little.

With this PR, `wchar_t[N]` and `charN_t[N]` are printed like `char[N]`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list