Search code examples
c++cdebuggingigraphpretty-print

GDB pretty printers for igraph_vector_t and igraph_matrix_t


I'm using the C interface of igraph, and sometimes, while debugging I would like to see the content of some igraph_vector_t variables as well as igraph_matrix_t.

Is there some GDB pretty printer available like those available for STL containers ( std::vector<T> usually?)


Solution

  • No, there isn't, but you can try calling igraph_vector_print() from within gdb if that is possible. Alternatively, you can access the stor_begin member of igraph_vector_t -- this is a pointer to the memory area that hosts the contents of the vector. stor_end points to the end of that area, and end points right after the last element of the vector - so, the "useful" part of the vector is between stor_begin and end.