#into .gdbinit
shell mkfifo /tmp/colorPipe
define hook-disassemble
echo \n
shell cat /tmp/colorPipe | c++filt | highlight --syntax=asm -s darkness -Oxterm256 &
set logging redirect on
set logging on /tmp/colorPipe
end
define hookpost-disassemble
hookpost-list
end
define hook-list
echo \n
shell cat /tmp/colorPipe | c++filt | highlight --syntax=cpp -s darkness -Oxterm256 &
set logging redirect on
set logging on /tmp/colorPipe
end
define hookpost-list
set logging off
set logging redirect off
shell sleep 0.1s
end
define hook-quit
shell rm /tmp/colorPipe
end
define re
hookpost-disassemble
echo \033[0m
end
document re
Restore colorscheme
end
def term_style(*v):
"""1 is bold, 30--37 are the 8 colours, but specifying bold may also
change the colour. 40--47 are background colours."""
return '\x1B['+';'.join(map(str, v))+'m'
#Use like this:
print term_style(1) + 'This will be bold' + term_style(0) #Reset.
print term_style(1,30) + 'This will be bold and coloured' + term_style(0)
print term_style(1,30,40) + 'Plus coloured background' + term_style(0)