[Vm-beginners] Re: Kill current process from gdb?

David T. Lewis lewis at mail.msen.com
Wed Jan 18 00:45:13 UTC 2012


On Tue, Jan 17, 2012 at 01:50:52PM -0600, Chris Muller wrote:
> Not sure if this would meet your needs, but I know something we did
> was to be able to send Linux interrupt signals to the vm, which would
> at the image level result in a process waiting on a Semaphore specific
> that interrupt to be signaled.

Here is how to do it:

	[[OSProcess accessor forwardSigUsr1 wait.
	Project current addDeferredUIMessage: [self notify: 'Got a SIGUSR1!!!!']]
	ensure: [OSProcess accessor restoreSigUsr1]] fork

Then send a SIGUSR1 to your VM process. A notifier will be raised,
after which the signal handler will be restored to its original value.

The signal handler methods set an OS signal handler in the VM and
answer a semaphore that will be signaled in the image when an OS signal
is received by the VM (SIGUSR1 in this example). The signal restore
methods return the signal handlers to whatever they had originally
been set to.

Dave

> 
> On Wed, Jan 11, 2012 at 7:17 AM, Sean P. DeNigris <sean at clipperadams.com> wrote:
> > Thanks, Bert.
> >
> > --
> > View this message in context: http://forum.world.st/Kill-current-process-from-gdb-tp4283712p4285356.html
> > Sent from the Smalltalk VM - Beginners mailing list archive at Nabble.com.
> > _______________________________________________
> > VM-beginners mailing list
> > VM-beginners at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
> _______________________________________________
> VM-beginners mailing list
> VM-beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners


More information about the VM-beginners mailing list