Monday, March 1, 2021

(Debug) GDB with full colored dashboard

$ pip install pygments

$ wget -P ~ https://git.io/.gdbinit

If gdb version prior to 7.7 and python prior to 2.7 execute this

$ mkdir -p ~/.gdbinit.d/
$ wget 'https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/python/lib/gdb/FrameDecorator.py' -O ~/.gdbinit.d/FrameDecorator.py
$ sed -i '1s/^/python gdb.COMPLETE_EXPRESSION = gdb.COMPLETE_SYMBOL\n/' .gdbinit
$ sed -i "s/gdb_breakpoint.temporary/None/g" .gdbinit

$ cat >>~/.gdbinit <<EOF
python

import imp
gdb.FrameDecorator = imp.new_module('FrameDecorator')
gdb.FrameDecorator.FrameDecorator = FrameDecorator
end
EOF

You can also send module to be shown on different terminals

start gdb 

$ gdb my_program

in another terminal

$ tty
> /dev/pts/3

in gdb to move Registers to this other terminal 

> dashboard breakpoints -output /dev/pts/3
> dashboard variables -output /dev/pts/3
> dashboard -layout variables stack source breakpoints

to Get help 

>>> help dashboard

References:

https://github.com/cyrus-and/gdb-dashboard
https://github.com/cyrus-and/gdb-dashboard/wiki/Support-older-GDB-versions

No comments:

Blog Archive