The best option is to use the gdb python API to create beautiful printers for armadillo classes. It works better than calling a C / C ++ function because it is always available (even when debugging from a kernel file where the program is not running). Moreover, there is no risk that the linker will abandon the function when it is not used in your program (which makes it inaccessible when debugging in gdb).
A beautiful printer code is downloaded (from the source) from the .gdbinit file in your home folder. It will work in gdb, working both in the terminal and from the IDE (provided that the IDE does not avoid downloading the .gdbinit file).
As an example, suppose you have the following two matrices
arma::mat m1{{1.1, 2.2, 3}, { 4, 5, 6}, { 7, 8, 9}, { 10, 11, 12}, { 13, 14, 15}, { 16, 17, 18}}; arma::cx_mat m2{{1.1 - 1.1j, 2.2 - 7.7j, 3}, { 4, 5, 6}, { 7, 8, 9}, { 10, 11, 12}, { 13, 14, 15}, { 16, 17, 18}};
A beautiful printer can show them as


Please note that in a complex m2 matrix, elements are displayed both in a rectangular and in a polar form (the display of the polar form can be turned off). It also works better with the rest of GDB. For example, GDB allows you the maximum number of elements to display in an array. A beautiful printer will respect this if it is implemented to display elements as standard arrays in GDB.
This is how the matrices m1 and m2 displayed in CLion.


This cute printer can be obtained from here . There are several other things, such as some xmethods (reimplementing Python of some C ++ methods) and converting to empty arrays.
Disclaimer : I am the author of these beautiful printers.