[Lldb-commits] [PATCH] D76650: Data formatters: fix detection of C strings

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 24 02:07:54 PDT 2020


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

LGTM, thanks for tracking this down! I only have a minor comment about the test character.



================
Comment at: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/TestCstringUnicode.py:18
+        self.expect("expr s", substrs=['"é"'])
+        self.expect("expr (const char*)s", substrs=['"é"'])
----------------
`expect_expr` is the modern way to check this:
```
lang=python
        self.expect_expr("s", result_summary='"🔥"')
        self.expect_expr("(const char*)s", result_summary='"🔥"')
```


================
Comment at: lldb/test/API/functionalities/data-formatter/cstring-utf8-summary/main.cpp:2
+int main() {
+  const char *s = "é";
+  return 0; // break here
----------------
Could you make this a string like `u8"🔥"`? "é" is also a valid character in a lot of extended-ASCII character sets (e.g., Latin-1) and we probably should take some unicode-exclusive character and make sure it's utf-8.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76650/new/

https://reviews.llvm.org/D76650





More information about the lldb-commits mailing list