public DebugPropertyCreateEvent(enum_EVENTATTRIBUTES attributes, IDebugProperty2 property)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(property != null, "property");

            _property = property;
        }
            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);
            }
Exemplo n.º 3
0
        public DebugOutputStringEvent(enum_EVENTATTRIBUTES attributes, string message)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(message != null, "message");

            _message = message;
        }
Exemplo n.º 4
0
        public DebugReturnValueEvent(enum_EVENTATTRIBUTES attributes, IDebugProperty2 returnValue)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(returnValue != null, "returnValue");

            _returnValue = returnValue;
        }
        public DebugReturnValueEvent(enum_EVENTATTRIBUTES attributes, IDebugProperty2 returnValue)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(returnValue != null, "returnValue");

            _returnValue = returnValue;
        }
            public void HandleClassLoad(JvmEventsService.JvmVirtualMachineRemoteHandle virtualMachine, JvmEventsService.JvmThreadRemoteHandle threadHandle, JvmEventsService.JvmClassRemoteHandle @class)
            {
                // 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 programName = Program.GetName();
                string debuggerName;
                Guid   debuggerGuid;

                ErrorHandler.ThrowOnFailure(Program.GetEngineInfo(out debuggerName, out debuggerGuid));

                string signature;
                string generic;
                var    result = Program.ToolsService.GetClassSignature(out signature, out generic, virtualMachine, @class);

                JavaDebugThread thread = null;

                if (threadHandle.Handle != 0)
                {
                    int hashCode;
                    result = Program.ToolsService.GetObjectHashCode(out hashCode, virtualMachine, threadHandle);
                    Program._threads.TryGetValue(hashCode, out thread);
                }

                string               message = string.Format("'{0}' ({1}): Loaded class '{2}'" + Environment.NewLine, programName, debuggerName, signature);
                DebugEvent           @event  = new DebugOutputStringEvent(enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS, message);
                Guid                 guid    = typeof(IDebugOutputStringEvent2).GUID;
                enum_EVENTATTRIBUTES attrib  = @event.GetAttributes();

                Program.Callback.Event(Program.DebugEngine, Program.Process, Program, thread, @event, ref guid, (uint)attrib);
            }
Exemplo n.º 7
0
        public DebugPropertyCreateEvent(enum_EVENTATTRIBUTES attributes, IDebugProperty2 property)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(property != null, "property");

            _property = property;
        }
Exemplo n.º 8
0
        public DebugBeforeSymbolSearchEvent(enum_EVENTATTRIBUTES attributes, string moduleName)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(moduleName != null, "moduleName");
            Contract.Requires <ArgumentException>(!string.IsNullOrEmpty(moduleName));

            _moduleName = moduleName;
        }
        public DebugBreakpointUnboundEvent(enum_EVENTATTRIBUTES attributes, IDebugBoundBreakpoint2 breakpoint, enum_BP_UNBOUND_REASON reason)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(breakpoint != null, "breakpoint");

            _breakpoint = breakpoint;
            _reason     = reason;
        }
            public void HandleVMStart(JvmEventsService.JvmVirtualMachineRemoteHandle virtualMachine)
            {
                DebugEvent           @event = new DebugLoadCompleteEvent(enum_EVENTATTRIBUTES.EVENT_SYNC_STOP);
                Guid                 guid   = typeof(IDebugLoadCompleteEvent2).GUID;
                enum_EVENTATTRIBUTES attrib = @event.GetAttributes();

                Program.Callback.Event(Program.DebugEngine, Program.Process, Program, null, @event, ref guid, (uint)attrib);
            }
        public DebugBreakpointUnboundEvent(enum_EVENTATTRIBUTES attributes, IDebugBoundBreakpoint2 breakpoint, enum_BP_UNBOUND_REASON reason)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(breakpoint != null, "breakpoint");

            _breakpoint = breakpoint;
            _reason = reason;
        }
        public DebugBeforeSymbolSearchEvent(enum_EVENTATTRIBUTES attributes, string moduleName)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(moduleName != null, "moduleName");
            Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(moduleName));

            _moduleName = moduleName;
        }
        public DebugExpressionEvaluationCompleteEvent(enum_EVENTATTRIBUTES attributes, IDebugExpression2 expression, IDebugProperty2 property)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(expression != null, "expression");
            Contract.Requires<ArgumentNullException>(property != null, "property");

            _expression = expression;
            _property = property;
        }
        public DebugModuleLoadEvent(enum_EVENTATTRIBUTES attributes, IDebugModule2 module, string debugMessage, bool isLoading)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(module != null, "module");

            _module       = module;
            _debugMessage = debugMessage;
            _isLoading    = isLoading;
        }
        public DebugBreakpointBoundEvent(enum_EVENTATTRIBUTES attributes, IDebugPendingBreakpoint2 pendingBreakpoint, IEnumDebugBoundBreakpoints2 boundBreakpoints)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(pendingBreakpoint != null, "pendingBreakpoint");
            Contract.Requires <ArgumentNullException>(boundBreakpoints != null, "boundBreakpoints");

            _pendingBreakpoint = pendingBreakpoint;
            _boundBreakpoints  = boundBreakpoints;
        }
        public DebugExpressionEvaluationCompleteEvent(enum_EVENTATTRIBUTES attributes, IDebugExpression2 expression, IDebugProperty2 property)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(expression != null, "expression");
            Contract.Requires <ArgumentNullException>(property != null, "property");

            _expression = expression;
            _property   = property;
        }
        public DebugBreakpointBoundEvent(enum_EVENTATTRIBUTES attributes, IDebugPendingBreakpoint2 pendingBreakpoint, IEnumDebugBoundBreakpoints2 boundBreakpoints)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(pendingBreakpoint != null, "pendingBreakpoint");
            Contract.Requires<ArgumentNullException>(boundBreakpoints != null, "boundBreakpoints");

            _pendingBreakpoint = pendingBreakpoint;
            _boundBreakpoints = boundBreakpoints;
        }
        public DebugActivateDocumentEvent(enum_EVENTATTRIBUTES attributes, IDebugDocument2 document, IDebugDocumentContext2 documentContext)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(document != null, "document");
            Contract.Requires <ArgumentNullException>(documentContext != null, "documentContext");

            _document        = document;
            _documentContext = documentContext;
        }
Exemplo n.º 19
0
        public DebugModuleLoadEvent(enum_EVENTATTRIBUTES attributes, IDebugModule2 module, string debugMessage, bool isLoading)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(module != null, "module");

            _module = module;
            _debugMessage = debugMessage;
            _isLoading = isLoading;
        }
        public DebugActivateDocumentEvent(enum_EVENTATTRIBUTES attributes, IDebugDocument2 document, IDebugDocumentContext2 documentContext)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(document != null, "document");
            Contract.Requires<ArgumentNullException>(documentContext != null, "documentContext");

            _document = document;
            _documentContext = documentContext;
        }
 public DebugErrorEvent(enum_EVENTATTRIBUTES attributes, enum_MESSAGETYPE messageType, string format, int reason, MessageBoxIcon severity, string helpFileName = null, uint helpId = 0)
     : base(attributes)
 {
     _messageType  = messageType;
     _format       = format;
     _reason       = reason;
     _severity     = severity;
     _helpFileName = helpFileName;
     _helpId       = helpId;
 }
Exemplo n.º 22
0
        public DebugSymbolSearchEvent(enum_EVENTATTRIBUTES attributes, IDebugModule3 module, string debugMessage, enum_MODULE_INFO_FLAGS moduleInfoFlags)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(module != null, "module");
            Contract.Requires <ArgumentNullException>(debugMessage != null, "debugMessage");
            Contract.Requires <ArgumentException>(!string.IsNullOrEmpty(debugMessage));

            _module          = module;
            _debugMessage    = debugMessage;
            _moduleInfoFlags = moduleInfoFlags;
        }
Exemplo n.º 23
0
        public static int Event(this IDebugEventCallback2 callback, IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program, IDebugThread2 thread, DebugEvent debugEvent)
        {
            Contract.Requires <ArgumentNullException>(callback != null, "callback");
            Contract.Requires <ArgumentNullException>(debugEvent != null, "debugEvent");
            Contract.Requires <ArgumentNullException>(engine != null, "engine");

            Guid guid = debugEvent.EventGuid;
            enum_EVENTATTRIBUTES attributes = debugEvent.Attributes;

            return(callback.Event(engine, process, program, thread, debugEvent, ref guid, (uint)attributes));
        }
Exemplo n.º 24
0
        public DebugSymbolSearchEvent(enum_EVENTATTRIBUTES attributes, IDebugModule3 module, string debugMessage, enum_MODULE_INFO_FLAGS moduleInfoFlags)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(module != null, "module");
            Contract.Requires<ArgumentNullException>(debugMessage != null, "debugMessage");
            Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(debugMessage));

            _module = module;
            _debugMessage = debugMessage;
            _moduleInfoFlags = moduleInfoFlags;
        }
Exemplo n.º 25
0
        private void SendProgramEvent(IDebugProgramNode2 programNode, enum_EVENTATTRIBUTES attributes, Guid iidEvent)
        {
            CorDebugProcess   process   = GetProcess(programNode);
            CorDebugAppDomain appDomain = GetAppDomain(programNode);

            IDebugEvent2 evt = new DebugEvent((uint)attributes);

            foreach (IDebugPortEvents2 dpe in m_cpDebugPortEvents2.Sinks)
            {
                dpe.Event(this.DebugPortSupplier.CoreServer, this, (IDebugProcess2)process, (IDebugProgram2)appDomain, evt, ref iidEvent);
            }
        }
Exemplo n.º 26
0
        public DebugMessageEvent(enum_EVENTATTRIBUTES attributes, enum_MESSAGETYPE messageType, string message, MessageBoxIcon severity, string helpFileName = null, uint helpId = 0)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(message != null, "message");
            Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(message));

            _messageType = messageType;
            _message = message;
            _severity = severity;
            _helpFileName = helpFileName;
            _helpId = helpId;
        }
Exemplo n.º 27
0
        public DebugMessageEvent(enum_EVENTATTRIBUTES attributes, enum_MESSAGETYPE messageType, string message, MessageBoxIcon severity, string helpFileName = null, uint helpId = 0)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(message != null, "message");
            Contract.Requires <ArgumentException>(!string.IsNullOrEmpty(message));

            _messageType  = messageType;
            _message      = message;
            _severity     = severity;
            _helpFileName = helpFileName;
            _helpId       = helpId;
        }
        public JavaDebugExceptionEvent(enum_EVENTATTRIBUTES attributes, JavaDebugProgram program, IThreadReference thread, IObjectReference exceptionObject, ILocation location, ILocation catchLocation)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(program != null, "program");
            Contract.Requires <ArgumentNullException>(thread != null, "thread");
            Contract.Requires <ArgumentNullException>(exceptionObject != null, "exceptionObject");

            _program         = program;
            _thread          = thread;
            _exceptionObject = exceptionObject;
            _location        = location;
            _catchLocation   = catchLocation;
        }
Exemplo n.º 29
0
        public JavaDebugExceptionEvent(enum_EVENTATTRIBUTES attributes, JavaDebugProgram program, IThreadReference thread, IObjectReference exceptionObject, ILocation location, ILocation catchLocation)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(program != null, "program");
            Contract.Requires<ArgumentNullException>(thread != null, "thread");
            Contract.Requires<ArgumentNullException>(exceptionObject != null, "exceptionObject");

            _program = program;
            _thread = thread;
            _exceptionObject = exceptionObject;
            _location = location;
            _catchLocation = catchLocation;
        }
            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);
                }
            }
        private static enum_EVENTATTRIBUTES GetAttributesForEvent(VirtualMachineEventArgs e)
        {
            enum_EVENTATTRIBUTES attributes = 0;

            if (e.SuspendPolicy != SuspendPolicy.None)
            {
                attributes |= enum_EVENTATTRIBUTES.EVENT_SYNCHRONOUS;
            }
            else
            {
                attributes |= enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS;
            }

            if (e.SuspendPolicy == SuspendPolicy.All)
            {
                attributes |= enum_EVENTATTRIBUTES.EVENT_STOPPING;
            }

            return(attributes);
        }
Exemplo n.º 32
0
 public DebugStepCompleteEvent(enum_EVENTATTRIBUTES attributes, IEnumDebugBoundBreakpoints2 breakpoints, enum_STEPSTATUS stepStatus)
     : base(attributes)
 {
     _breakpoints = breakpoints;
     _stepStatus = stepStatus;
 }
Exemplo n.º 33
0
 public DebugProcessDestroyEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
 public DebugThreadDisplayNameChangeEvent(enum_EVENTATTRIBUTES attributes, IDebugThread100 thread)
     : base(attributes)
 {
     Contract.Requires <ArgumentNullException>(thread != null, "thread");
     _thread = thread;
 }
Exemplo n.º 35
0
 public DebugStepCompleteEvent(enum_EVENTATTRIBUTES attributes)
     : this(attributes, null, enum_STEPSTATUS.STEPSTATUS_UNKNOWN)
 {
 }
 public DebugThreadSuspendChangeEvent(enum_EVENTATTRIBUTES attributes, IDebugThread100 thread)
     : base(attributes)
 {
     Contract.Requires<ArgumentNullException>(thread != null, "thread");
     _thread = thread;
 }
Exemplo n.º 37
0
 public DebugBreakEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
Exemplo n.º 38
0
 public DebugProcessContinueEvent(enum_EVENTATTRIBUTES attributes, IDebugProcess2 process)
     : base(attributes)
 {
     Contract.Requires <ArgumentNullException>(process != null, "process");
     _process = process;
 }
Exemplo n.º 39
0
 public DebugThreadDestroyEvent(enum_EVENTATTRIBUTES attributes, uint exitCode)
     : base(attributes)
 {
     _exitCode = exitCode;
 }
 public DebugModuleReloadOperationCompleteEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
Exemplo n.º 41
0
 public DebugProcessCreateEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
Exemplo n.º 42
0
 public DebugBreakpointEvent(enum_EVENTATTRIBUTES attributes, IEnumDebugBoundBreakpoints2 breakpoints)
     : base(attributes)
 {
     Contract.Requires<ArgumentNullException>(breakpoints != null, "breakpoints");
     _breakpoints = breakpoints;
 }
 public DebugThreadNameChangedEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
 public DebugProgramCreateEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
Exemplo n.º 45
0
 public DebugLoadCompleteEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
     Contract.Requires<ArgumentException>((attributes & enum_EVENTATTRIBUTES.EVENT_STOPPING) != 0);
 }
Exemplo n.º 46
0
 protected DebugEvent(enum_EVENTATTRIBUTES attributes)
 {
     _attributes = attributes;
 }
Exemplo n.º 47
0
 public DebugThreadCreateEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
 public DebugProgramNameChangedEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
 public DebugInterceptExceptionCompleteEvent(enum_EVENTATTRIBUTES attributes, ulong cookie)
     : base(attributes)
 {
     _cookie = cookie;
 }
Exemplo n.º 50
0
 public DebugProgramNameChangedEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
Exemplo n.º 51
0
 public DebugCanStopEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 52
0
 public DebugBreakpointEvent(enum_EVENTATTRIBUTES attributes, IEnumDebugBoundBreakpoints2 breakpoints)
     : base(attributes)
 {
     Contract.Requires <ArgumentNullException>(breakpoints != null, "breakpoints");
     _breakpoints = breakpoints;
 }
Exemplo n.º 53
0
 public DebugThreadDestroyEvent(enum_EVENTATTRIBUTES attributes, uint exitCode)
     : base(attributes)
 {
     _exitCode = exitCode;
 }
Exemplo n.º 54
0
        private void SendProgramEvent(IDebugProgramNode2 programNode, enum_EVENTATTRIBUTES attributes, Guid iidEvent)
        {
            CorDebugProcess process = GetProcess( programNode );
            CorDebugAppDomain appDomain = GetAppDomain( programNode );

            IDebugEvent2 evt = new DebugEvent((uint) attributes);
            foreach (IDebugPortEvents2 dpe in m_cpDebugPortEvents2.Sinks)
            {
                dpe.Event(this.DebugPortSupplier.CoreServer, this, (IDebugProcess2)process, (IDebugProgram2) appDomain, evt, ref iidEvent);
            }
        }
 public DebugBreakpointErrorEvent(enum_EVENTATTRIBUTES attributes, IDebugErrorBreakpoint2 breakpoint)
     : base(attributes)
 {
     Contract.Requires<ArgumentNullException>(breakpoint != null, "breakpoint");
     _breakpoint = breakpoint;
 }
 public DebugCurrentThreadChangedEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
 public DebugInterceptExceptionCompleteEvent(enum_EVENTATTRIBUTES attributes, ulong cookie)
     : base(attributes)
 {
     _cookie = cookie;
 }
 public DebugModuleReloadOperationCompleteEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }
Exemplo n.º 59
0
 public DebugNoSymbolsEvent(enum_EVENTATTRIBUTES attributes)
     : base(attributes)
 {
 }