. .

st4u

ST 4U 87: Debug Any Process in VA Smalltalk

May 25, 2011 8:20:32.119

Today's Smalltalk 4 You shows you how easy it is to grab an arbitrary VA Smalltalk process and load it into the debugger. This can be useful a few different ways - exploring the system, or killing a runaway process that you didn't keep a variable reference to. If you prefer a written walkthrough to video, then skip down to it. If you have trouble viewing it here in the browser, you can also navigate directly to YouTube. To watch now, click on the image below:

Debug Any ST Process

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:


Today we'll look at debugging arbitrary processes in VA Smalltalk, which is easy using the debugger. To show that off, we'll create a Smalltalk process in the workspace, and then grab it with the debugger. Here's the code to kick off a simple process:

Fork a Process

And here's a look at the Transcript, which shows that the process is, in fact, running:

Running Process

Going back to the launcher menu, select Tools, go all the way to the bottom, and open the debugger:

Open the Debugger

You haven't opened the debugger on a specific process, so it's empty. That's something we'll fix in a moment. Under the Processes menu, select the first option, Debug Other:

Debug Other Process

What you'll see now is a small window with a list of processes in it. These are Smalltalk processes, controlled by the VA Smalltalk environment:

Process List

You can select any of them and start debugging them in the debugger, including main system processes. This is a great way to see how things work in any Smalltalk environment, but here we've selected the process we forked off above. One of the other things you can do with this feature is select a process so that you can terminate it - useful if you've forked one off, and haven't maintained any direct access to it. Here's the process in question in the debugger:

Debugging

Now that you've grabbed the process in the debugger, it's easy to kill it. Simply go back to the Processes menu, and select Terminate:

Terminate

In this example, we held a reference to the process in the workspace, so we can inspect it (as seen below). If you didn't, simply repeat this process, and you'll see that the list of processes is one smaller:

Inspect the Variable

Looking below, you can see in the inspector that the process is dead. That solves the problem of grabbing an arbitrary process we don't want or need any longer and killing it:

Inspecting the Process

Need more help? There's a screencast for other topics like this which you may want to watch. Questions? Try the "Chat with James" Google gadget over in the sidebar.

Technorati Tags: , ,

Enclosures:
[st4u87-iPhone.m4v ( Size: 4290551 )]

posted by James Robertson

 Share Tweet This