private void HandleClassPrepare(object sender, ClassPrepareEventArgs e)
        {
            if (e.SuspendPolicy == SuspendPolicy.All)
            {
                Interlocked.Increment(ref _suspended);
            }

            JavaDebugThread thread;

            lock (_threads)
            {
                this._threads.TryGetValue(e.Thread.GetUniqueId(), out thread);
            }

            try
            {
                ReadOnlyCollection <string> sourceFiles = e.Type.GetSourcePaths(e.Type.GetDefaultStratum());
                DebugEngine.BindVirtualizedBreakpoints(this, thread, e.Type, sourceFiles);
            }
            catch (MissingInformationException)
            {
                // Can't bind debug information for classes that don't contain debug information
            }

            // The format of the message created by the .NET debugger is this:
            // 'devenv.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Windows.Forms\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Windows.Forms.dll'
            string     message     = string.Format("'{0}' ({1}): Loaded '{2}'\n", Process.GetName(enum_GETNAME_TYPE.GN_BASENAME), Java.Constants.JavaLanguageName, e.Type.GetName());
            DebugEvent outputEvent = new DebugOutputStringEvent(message);

            SetEventProperties(outputEvent, e, true);
            Callback.Event(DebugEngine, Process, this, thread, outputEvent);

            ManualContinueFromEvent(e);
        }
Example #2
0
 public void ClassPrepare(Types.SuspendPolicy suspendPolicy, RequestId requestId, ThreadId threadId, TypeTag typeTag, ReferenceTypeId typeId, string signature, ClassStatus status)
 {
     ThreadReference thread = VirtualMachine.GetMirrorOf(threadId);
     EventRequest request = VirtualMachine.EventRequestManager.GetEventRequest(EventKind.ClassPrepare, requestId);
     ReferenceType type = VirtualMachine.GetMirrorOf(typeTag, typeId);
     ClassPrepareEventArgs e = new ClassPrepareEventArgs(VirtualMachine, (SuspendPolicy)suspendPolicy, request, thread, signature, type);
     VirtualMachine.EventQueue.OnClassPrepare(e);
 }