Add some debugging code to sdb to help track down #9783.