copypaste lots of stuff from perl6-debugger