[Lldb-commits] [PATCH] D70517: [lldb][DataFormatters] Support pretty printing std::string when built with -funsigned-char.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 21 00:46:16 PST 2019

labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Adding a basic_string<unsigned char> formatter seems reasonable, though I have to say that I was very surprised that adding -funsinged-char should cause the type name of the variable to come out different. I tried building the example program with -funsigned-char and without, and literally the only difference was the value of the DW_AT_encoding attribute on the "char" type -- everything else (including the names of all types) remained the same.

Overall, I am not sure that support for non-native char signedness is really sound in lldb. I wouldn't be surprised if we run into other problems with these kinds of binaries. The first thing that comes to mind is expression evaluation not being able to find the correct function (because it's searching for the wrong char), or it selecting the wrong overload.  Unfortunately, making it "sound" could be tricky because of the impedance mismatch between what DWARF provides vs. what clang expects.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list