[PATCH] D30994: Add pretty-printer for llvm::Twine type

Simon Marchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 13:19:44 PDT 2017


simark added inline comments.


================
Comment at: utils/gdb-scripts/prettyprinters.py:217
+      # string.  Convert it to a Python string.
+      if 'LazyString' in type(s).__name__:
+        s = s.value().address.string()
----------------
This is really ugly, but I didn't find any other way to check if the return is of that type.  GDB doesn't seem to register the `LazyString` type:

```
>>> gdb.Value
<type 'gdb.Value'>
>>> gdb.LazyString
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'LazyString'
```

so I can't do `type(s) == gdb.LazyString`...


Repository:
  rL LLVM

https://reviews.llvm.org/D30994





More information about the llvm-commits mailing list