Open xiuliren opened 4 years ago
I don't use gdb so I'm not sure, can yo try to print coords.data()
? it should print the underlying 1-D buffer.
I think there are ways to implement pretty printing for GDB ...
Here seems to be some good introduction on how to do it: http://www.kurokatta.org/grumble/2018/05/gdb-pretty
If someone wants to do that that would be awesome!
I made an initial version of converting the xarray, xtensor, and xtensor_fixed containers for use in gdb's python interface. https://github.com/christopherburke/gdb_xt2np It actually goes beyond a pretty printer because it actually copies the array data into a numpy array, thus allowing one to use numpy or matplotlib plotting within gdb's python interpreter to examining the array data. It opens up development for any kind of data visualization one can think up in python to aid in debugging xtensor containers.
Awesome!
is there a way to print out the values in a xtensor?
this is the output I get now. Note that the coords variable is a xtensor rather than a xexpression.