예제 #1
0
        public virtual void OnDebugEngineCreate()
        {
            Logger.Debug(string.Empty);
            var eventObject = new DebugEngineCreateEvent(DebugEngineBase);

            OnDebugEvent(eventObject, InterfaceGuids.EngineCreateEventGuid);
        }
예제 #2
0
        public int Attach(IDebugProgram2[] rgpPrograms, IDebugProgramNode2[] rgpProgramNodes, uint celtPrograms, IDebugEventCallback2 pCallback, enum_ATTACH_REASON dwReason)
        {
            if (celtPrograms == 0)
            {
                return(VSConstants.S_OK);
            }

            if (pCallback == null)
            {
                throw new ArgumentNullException("pCallback");
            }
            if (rgpPrograms == null || rgpPrograms.Length < celtPrograms)
            {
                throw new ArgumentException();
            }
            if (rgpProgramNodes == null || rgpProgramNodes.Length < celtPrograms)
            {
                throw new ArgumentException();
            }

            if (celtPrograms > 1)
            {
                throw new NotImplementedException();
            }

            if (dwReason != enum_ATTACH_REASON.ATTACH_REASON_LAUNCH)
            {
                throw new NotImplementedException();
            }

            JavaDebugProgram program = rgpProgramNodes[0] as JavaDebugProgram;

            if (program == null)
            {
                throw new NotSupportedException();
            }

            lock (_programs)
            {
                _programs.Add(program);
            }

            DebugEvent @event = new DebugEngineCreateEvent(enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS, this);

            pCallback.Event(this, program.GetProcess(), program, null, @event);

            program.InitializeDebuggerChannel(this, pCallback);
            return(VSConstants.S_OK);
        }