Printing numpy array contents in gdb

Is there any way to pretty print the contents of numpy arrays whist debugging a numba function using gdb?

I’m attempting to debug a numba function using gdb_init and gdb_breakpoint. My function operates over numpy arrays. As I step through my code, I would like to p(rint) arrays using the gdb console and receive meaningful output.

The output I see now looks like this

(gdb) p current_pair
$1 = {meminfo = 0x5572f1225c40 “\001”, parent = 0x0, nitems = 1, itemsize = 24, data = 0x5572f1225c80, shape = {1}, strides = {24}}

Hi @kelseyforg,

This is supported if your gdb installation has Python support and the NumPy package is available to that Python. This section of the docs explains how:

Hope this helps?