How to create custom view of data in Clion debugger ?

Answered

How to create my own custom view of data in Clion debuger. For example i have own collection like std::vector, i need create a custom view of my custom bmstu::vector

macOS
CLion 2022.2.4 

I googled .natvis aka xml notation view, but not found how to resolve issue

0
3 comments

Hello!

The solution would be to create custom pretty printers for LLDB and specify them in .lldbinit. Here is the instruction for Qt renders as an example - https://www.jetbrains.com/help/clion/qt-tutorial.html#debug-renderers.

0

Anna Falevskaya    The link is not helpful anymore. Can we get a tutorial for custom pretty printers for LLDB?

0

Hi Michel Lesoinne!

Here is the LLDB documentation on variables and pretty-printing: https://lldb.llvm.org/use/variable.html

An example of the QT pretty printers for LLDB - https://github.com/KDE/kdevelop/tree/master/plugins/lldb/formatters.

Hope it helps.

0

Please sign in to leave a comment.