This patch adds missing formatting for UTF-8 unicode.
Cross-referencing https://reviews.llvm.org/D66447
Differential D112564
[lldb] Add support for UTF-8 unicode formatting ljmf00 on Oct 26 2021, 11:02 AM. Authored by
Details This patch adds missing formatting for UTF-8 unicode. Cross-referencing https://reviews.llvm.org/D66447
Diff Detail Event TimelineComment Actions I can reproduce this with LDC (D LLVM-based compiler), but I don't know a way to do it with clang. Probably I need to manually write a .ll file for this. Can someone guide me on adding tests for this? Comment Actions What exactly do you need the test to do? Is printing a global variable (char8_t_ish foo[] = "my string") sufficient? # RUN: llvm-mc (or llc) -o %t %s # RUN: %lldb %t -o "target variable foo" | FileCheck %s # CHECK: (char8_t_ish[]) foo = "my string" your code here Comment Actions Yeah, it is a bit more complicated than that although, due to https://bugs.llvm.org/show_bug.cgi?id=45856 . I'm going to take a look at those tests and write some. Comment Actions I was writing the tests locally, although I can't reproduce the failure with a simple type. I can get the error when using a custom LLDB formatter, however. See https://github.com/ljmf00/lldb-d/blob/main/lldb/source/Plugins/Language/D/DTypeUtils.cpp#L82 . I should also rename this patch to something less misleading, since it is not the type name the issue, I just got this right due to fallback on invalid encoding on my side. That said, do you know an easier way to test this? Comment Actions @labath I found the missing part, DumpTypeValue depends on lldb::Format and eFormatUnicode8 case should be added there too. I added tests and also changed the patch message. Can you re-review? |