On Fri, 19 Sep 2003, Nicholas Clark wrote:

> It would be really useful to be able to attach the perl6 debugger to a
> running parrot VM, and start debugging, without having the speed hit
> up to that point of debugging. gdb and similar rely on kernel help to
> do their attaching to regular running processes. I've no idea how to do
> such a thing without help to the parrot VM (such that people could chose
> to have parrot VMs running in production in an attachable state).
> 
> Can anyone see a sane way to do it?

Sure. *If* you've started parrot with remote debugging enabled (Whether 
this sh ould be the default is an open question) we could set it up so 
that parrot, when starting, opens up a socket it can listen on, and 
installs a signal handler on some signal or other (USR1, or USR2 or 
something). The signal handler is set up to inject a "kick into remote 
debugger" exception. When that exception happens, parrot exits the current 
runloop and restarts with the remote debugging runloop attached to the 
socket as its control terminal.

So, the sequence is:

1) Connect to the control socket
2) Peg parrot with SIGUSR[12]
3) Profit! 

No, wait, #3 isn't right... :)

                                                Dan

Reply via email to