core: add low level debug routine