More backporting of debug subpackage support.
Merge pull request #1236 from ktf/backport-debug

More backporting of debug subpackage support.