void UpdateThread (Thread thread)
{
RemoteTreeNode node = (RemoteTreeNode)threadToTreeNode[thread];
if (node == null) {
node = RootNode.AppendNode();
threadToTreeNode.Add(thread, node);
}
bool current = interpreter.HasCurrentThread && interpreter.CurrentThread.ID == thread.ID;
string location;
if (thread.IsStopped) {
try {
location = thread.GetBacktrace().Frames[0].SourceAddress.Name;
} catch {
location = "";
}
} else {
location = "";
}
node.SetValue(ColumnSelected, current ? Pixmaps.Arrow : Pixmaps.Empty);
node.SetValue(ColumnID, thread.ID);
node.SetValue(ColumnPID, thread.PID);
node.SetValue(ColumnTID, String.Format("{0:x}", thread.TID));
node.SetValue(ColumnName, thread.Name);
node.SetValue(ColumnState, thread.State.ToString());
node.SetValue(ColumnLocation, location);
}