public void HandleThreadStart(JvmEventsService.JvmVirtualMachineRemoteHandle virtualMachine, JvmEventsService.JvmThreadRemoteHandle threadHandle)
            {
                int id = _nextThreadId++;

                //JvmToolsService.jvmtiError result = Program.ToolsService.SetTag(virtualMachine, threadHandle, id);
                //Contract.Assert(result == JvmToolsService.jvmtiError.None);

                //long tag;
                //result = Program.ToolsService.GetTag(out tag, virtualMachine, threadHandle);
                //Contract.Assert(result == JvmToolsService.jvmtiError.None);
                //Contract.Assert(tag == id);

                int hashCode;

                JvmToolsService.jvmtiError result = Program.ToolsService.GetObjectHashCode(out hashCode, virtualMachine, threadHandle);

                JavaDebugThread thread = new JavaDebugThread(Program, virtualMachine, threadHandle, id);

                Program._threads[hashCode] = thread;

                DebugEvent           @event = new DebugThreadCreateEvent(enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS);
                Guid                 guid   = typeof(IDebugThreadCreateEvent2).GUID;
                enum_EVENTATTRIBUTES attrib = @event.GetAttributes();

                Program.Callback.Event(Program.DebugEngine, Program.Process, Program, thread, @event, ref guid, (uint)attrib);
            }
            public void HandleClassPrepare(JvmEventsService.JvmVirtualMachineRemoteHandle virtualMachine, JvmEventsService.JvmThreadRemoteHandle thread, JvmEventsService.JvmClassRemoteHandle @class)
            {
                // try to get debugging information from the class
                string sourceName;

                JvmToolsService.jvmtiError error = Program.ToolsService.GetSourceFileName(out sourceName, virtualMachine, @class);

                JvmToolsService.JvmMethodRemoteHandle[] methods;
                error = Program.ToolsService.GetClassMethods(out methods, virtualMachine, @class);

                foreach (var method in methods)
                {
                    JvmToolsService.JvmLineNumberEntry[] lineNumbers;
                    error = Program.ToolsService.GetLineNumberTable(out lineNumbers, virtualMachine, method);
                }
            }
            public void HandleThreadEnd(JvmEventsService.JvmVirtualMachineRemoteHandle virtualMachine, JvmEventsService.JvmThreadRemoteHandle threadHandle)
            {
                int hashCode;

                JvmToolsService.jvmtiError result = Program.ToolsService.GetObjectHashCode(out hashCode, virtualMachine, threadHandle);
                if (result == 0)
                {
                    JavaDebugThread thread = Program._threads[hashCode];

                    DebugEvent           @event = new DebugThreadDestroyEvent(enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS, 0);
                    Guid                 guid   = typeof(IDebugThreadDestroyEvent2).GUID;
                    enum_EVENTATTRIBUTES attrib = @event.GetAttributes();
                    Program.Callback.Event(Program.DebugEngine, Program.Process, Program, thread, @event, ref guid, (uint)attrib);

                    Program._threads.Remove(hashCode);
                }
            }