Kill current process from gdb?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Kill current process from gdb?

Sean P. DeNigris
Administrator
What (if anything) can I do from a debug VM (via gdb?) to kill the currently executing Smalltalk process?

Thanks.
Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Kill current process from gdb?

Bert Freudenberg
On 10.01.2012, at 23:44, Sean P. DeNigris wrote:

> What (if anything) can I do from a debug VM (via gdb?) to kill the currently
> executing Smalltalk process?


There is no direct support for this.

One idea would be to cause an error exception, which if unhandled should suspend the process.

The easiest way I can think of would be to step until a primitive is called (or place a breakpoint in some primitive you know gets executed), and then fail it ("call primitiveFail()"), then continue.

- Bert -


_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Kill current process from gdb?

Sean P. DeNigris
Administrator
Thanks, Bert.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Kill current process from gdb?

Chris Muller-3
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.

On Wed, Jan 11, 2012 at 7:17 AM, Sean P. DeNigris <[hidden email]> 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
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Kill current process from gdb?

David T. Lewis
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 <[hidden email]> 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
> > [hidden email]
> > http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
> _______________________________________________
> VM-beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners
Reply | Threaded
Open this post in threaded view
|

Re: Kill current process from gdb?

Sean P. DeNigris
Administrator
David T. Lewis wrote
Here is how to do it:
I was thinking about a case where I could not do anything on the image side (startup problems), which is why I was counting on gdb
Cheers,
Sean