I'm using the excellent Eigen matrix/vector template library (http://eigen.tuxfamily.org)
To display the contents of a vector or matrix there is a Python script (plugin for gdb)
which I have put into Settings / Debugger Settings / Startup Commands
And it turns out that this is written to .gdbinit in my home directory as it should
python
import sys
sys.path.insert(0,'/OBJ/Math/Eigen/debug/gdb')
from printers import register_eigen_printers
register_eigen_printers (None)
end
This does work with gdb or ddd on my Linux box, but it does not seem to work with Codelite on the very same box.
Or at least I don't know how to use it. In gdb or ddd just say
Thanks Eran. It works indeed - at least on Linux.
It works when enter p <Matrix Name> on the debugger input line.
But the (standard) display when show 'locals' doesn't use that pretty-printer.
Is there any means to get this, too?
To check it on Windows I first need to get Python and a version of gdb which is configured for Python on my MinGW.
On one machine it's working just fine. Adding startup commands in Settings->Debugger Settings
copies these lines to $HOME/.gdbinit (which is fine). On this machine it works.
On another machine which is very similar (nearly the same GenToo Linux)
Codelite always clears the file $HOME/.gdbinit instead of copying the
lines from Settings->Debugger Settings to it. And on this machine
it doesn't work which is not surprising.
What could be the reason for that?
Thanks,
Helmut.
P.S. both machine have Codelite 4.1.5770
Thank you for realising that it's CL that's doing this; I'd noticed for a long time that .gdbinit was being cleared but I'd assumed it was a gdb bug.
Looking at the code (DbgGdb::DoLocateGdbExecutable) I'm surprised it doesn't happen on both your machines, as it always tries to do this on wxGTK/wxMac. Fixed in trunk, r6002.
and it will work, however, codelite uses GDB Machine Interface
Which I am not sure it works well with pretty printers
Never tried that...
Eran
I also struggled getting the pretty print startup script to be loaded. I finally added the commands from the script to Settings->Debugger Settings->GNU gdb Debugger->Startup commands and that seemed to work.
Much more important is the fact Codelite does not use the Python Pretty Printer for watch variables or the hovers, as mentioned above. The only way to show that it works is to use the debugger console: print varname