On Nov 4, 2005, at 1:26 PM, Ron M wrote:

>
> Is there a way of displaying the stack trace of a running ruby  
> program without killing it?
>
> Java virtual machines(*) will show the stack trace(s) of a running  
> program
> if you send them a QUIT signal (or on windows <ctrl><break>)  
> without stopping
> the program.   On Linux, the "pstack" program gives you the same  
> capabilities
> for C programs.

trap('QUIT') { puts caller.join("\n") }

Probably better to trap a signal other than QUIT, like USR1

-- 
Eric Hodel - drbrain / segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04