Custom display for variables when inline debugging

Answered

Hi, I love the inline variables view in the debugger, and was wondering if it is possible to define a way to refine how structs / templated types are displayed. I have a lot of variables that are just tagged structs around an underlying literal type, and the inline variable view is not very helpful. In the actual variables view, I have the similar issue that I need to expand everything to see the actual value.

I have tried defining a std::string cast operator, and a ostream operator, but didn't have any success. Even just a standard display for structs like gdb does it would be tremendously helpful.

Is this something that is possible?

1
2 comments

Adding gdb pretty printer to .gdbinit/lldb data formatter to .lldbinit should help. Please find out more here: http://lldb.llvm.org/varformats.html, https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing.html.

0

I was able to do it with a .lldbinit. Example lines:

 

    type format add --format dec int32_t

    # https://lldb.llvm.org/varformats.html
    type summary add --summary-string "addr=${var.address} depth=${var.depth}" Position

0

Please sign in to leave a comment.