crude attempt to write basic debugger functionality on OSX, broken and experimental