Greg Badros has recommend the following be put in $HOME/.gdbinit to ease the use of gdb to work with SCMs.
# -*- sh -*-
# Define a bunch of useful functions for debugging Guile.
# Add more as required.
define dp
set $gp=gdb_print($arg0)
output gdb_output
echo \n
end
document dp
Executes (display $arg0) to stdout.
end
define xcar
set $last=((scm_cell*) $arg0[1])
output $last
echo \n
end
document xprops
The PROPS of $
end
define xtyp3
set $last=(7 & (int)(((scm_cell*) $arg0)->car))
output $last
echo \n
end
document xtyp3
Print the xtyp3 of $
end
define xtyp7
set $last=0x7f & (int)(((scm_cell*) $arg0)->car)