Initial import of debug related files.
Merge pull request #1235 from ktf/backport-debug

Initial import of debug related files.