Add LLDB Pretty Printer
What does this implement/fix?
An LLDB synthetic child provider was implemented, with which the LLDB debugger can show the items in a structured view.
This script supports fixed or dynamic storage dense matrix, and compressed or uncompressed sparse matrix. Both row-major or column-major matrices are supported.
Usage
Import the script to LLDB using the following command
command script import eigenlldb.py
Effects
Before
Previous screenshots during debugging in CLion on Windows:
After
The effects in CLion on Windows:
The effects in command line on Ubuntu 20.04 with LLDB 10:
(lldb) frame variable vector3
(Eigen::Vector3d) vector3 = ([0,0] = 1, [1,0] = 1, [2,0] = 1)
(lldb) frame variable matrix3
(Eigen::Matrix3d) matrix3 = ([0,0] = 1, [1,0] = 1, [2,0] = 1, [0,1] = 1, [1,1] = 1, [2,1] = 1, [0,2] = 1, [1,2] = 1, [2,2] = 1)
(lldb) frame variable sparse_mat
(Eigen::SparseMatrix<double, 0, int>) sparse_mat = ([0,0] = 1, [0,1] = 2, [1,1] = 3)