Beispiel #1
0
        /// <summary>
        /// Informs a debug engine (DE) that the program specified has been atypically terminated and that the DE should clean up all references
        /// to the program and send a program destroy event.
        /// </summary>
        public int DestroyProgram(IDebugProgram2 pProgram)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "IDebugEngine2.DestroyProgram");

            // Avoid recursion
            if (destroying)
            {
                return(VSConstants.S_OK);
            }
            destroying = true;

            var program = pProgram as DebugProgram;

            if (program == null)
            {
                return(VSConstants.E_INVALIDARG);
            }
            var port = (IDebugPortNotify2)program.Process.Port;

            port.RemoveProgramNode(program);

            if (this.program == program)
            {
                // Detach
                this.program = null;
            }

            //eventCallback.Send(program, new ProgramDestroyEvent(0));
            return(VSConstants.S_OK);
        }
Beispiel #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugThread(DebugProgram program, EngineEventCallback eventCallback, ThreadManager manager, ThreadId threadId, int tid)
     : base(threadId, manager)
 {
     this.program       = program;
     this.eventCallback = eventCallback;
     this.tid           = tid;
 }
Beispiel #3
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugThread(DebugProgram program, EngineEventCallback eventCallback, ThreadManager manager, ThreadId threadId, int tid)
     : base(threadId, manager)
 {
     this.program = program;
     this.eventCallback = eventCallback;
     this.tid = tid;
 }
Beispiel #4
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugProcess(DebugEngine engine, DebugPort port, DebuggerLib.Debugger debugger, int processId, Guid guid, string apkPath, MapFile mapFile, EngineEventCallback eventCallback)
 {
     this.engine         = engine;
     this.port           = port;
     this.debugger       = debugger;
     this.processId      = processId;
     this.guid           = guid;
     this.apkPath        = apkPath;
     this.eventCallback  = eventCallback;
     creationDate        = DateTime.Now;
     program             = new DebugProgram(this, debugger, apkPath, mapFile, eventCallback);
     program.Terminated += OnProgramTerminated;
 }
Beispiel #5
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugProcess(DebugEngine engine, DebugPort port, DebuggerLib.Debugger debugger, int processId, Guid guid, string apkPath, MapFile mapFile, EngineEventCallback eventCallback)
 {
     this.engine = engine;
     this.port = port;
     this.debugger = debugger;
     this.processId = processId;
     this.guid = guid;
     this.apkPath = apkPath;
     this.eventCallback = eventCallback;
     creationDate = DateTime.Now;
     program = new DebugProgram(this, debugger, apkPath, mapFile, eventCallback);
     program.Terminated += OnProgramTerminated;
 }
Beispiel #6
0
        /// <summary>
        /// Attaches a debug engine (DE) to a program or programs. Called by the session debug manager (SDM) when the DE is running in-process to the SDM.
        /// </summary>
        public int Attach(IDebugProgram2[] rgpPrograms, IDebugProgramNode2[] rgpProgramNodes, uint celtPrograms, IDebugEventCallback2 pCallback, enum_ATTACH_REASON dwReason)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "IDebugEngine2.Attach");

            // Save program
            program = rgpPrograms[0] as DebugProgram;
            if (program == null)
                return VSConstants.E_INVALIDARG;

            // Update program state
            CopyExceptionMapToProgramDelayed();

            //eventCallback.Send(process, new ProcessCreateEvent());
            eventCallback.Send(program, new ProgramCreateEvent());
            return VSConstants.S_OK;
        }
Beispiel #7
0
        /// <summary>
        /// Attaches a debug engine (DE) to a program or programs. Called by the session debug manager (SDM) when the DE is running in-process to the SDM.
        /// </summary>
        public int Attach(IDebugProgram2[] rgpPrograms, IDebugProgramNode2[] rgpProgramNodes, uint celtPrograms, IDebugEventCallback2 pCallback, enum_ATTACH_REASON dwReason)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "IDebugEngine2.Attach");

            // Save program
            program = rgpPrograms[0] as DebugProgram;
            if (program == null)
            {
                return(VSConstants.E_INVALIDARG);
            }

            // Update program state
            CopyExceptionMapToProgram();

            //eventCallback.Send(process, new ProcessCreateEvent());
            eventCallback.Send(program, new ProgramCreateEvent());
            return(VSConstants.S_OK);
        }
Beispiel #8
0
        /// <summary>
        /// Informs a debug engine (DE) that the program specified has been atypically terminated and that the DE should clean up all references 
        /// to the program and send a program destroy event.
        /// </summary>
        public int DestroyProgram(IDebugProgram2 pProgram)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "IDebugEngine2.DestroyProgram");

            // Avoid recursion
            if (destroying)
                return VSConstants.S_OK;
            destroying = true;

            var program = pProgram as DebugProgram;
            if (program == null)
                return VSConstants.E_INVALIDARG;
            var port = (IDebugPortNotify2) program.Process.Port;
            port.RemoveProgramNode(program);

            if (this.program == program)
            {
                // Detach
                this.program = null;
            }

            //eventCallback.Send(program, new ProgramDestroyEvent(0));
            return VSConstants.S_OK;
        }
 public DebugDisassemblyStream(DebugProgram program, DebugCodeContext documentContext)
 {
     _loc    = documentContext.DocumentContext.DocumentLocation;
     _method = program.DisassemblyProvider.GetFromLocation(_loc);
 }
 /// <summary>
 /// Send an event from the given sender.
 /// </summary>
 public void Send(DebugProgram sender, BaseEvent @event)
 {
     Send(sender.Process, sender, null, @event);
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugExceptionManager(DebugProgram program, EngineEventCallback eventCallback)
     : base(program)
 {
     this.program       = program;
     this.eventCallback = eventCallback;
 }
Beispiel #12
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugExceptionManager(DebugProgram program, EngineEventCallback eventCallback)
     : base(program)
 {
     this.program = program;
     this.eventCallback = eventCallback;
 }
 public DebugDisassemblyStream(DebugProgram program, DebugCodeContext documentContext)
 {
     _loc = documentContext.DocumentContext.DocumentLocation;
     _method = program.DisassemblyProvider.GetFromLocation(_loc);
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugBreakpointManager(DebugProgram program, EngineEventCallback eventCallback)
     : base(program)
 {
     this.program = program;
     this.eventCallback = eventCallback;
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 public DebugBreakpointResolution(enum_BP_TYPE type, DebugProgram program)
 {
     this.type    = type;
     this.program = program;
 }
Beispiel #16
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public ThreadManager(DebugProgram program, EngineEventCallback eventCallback)
     : base(program)
 {
     this.program = program;
     this.eventCallback = eventCallback;
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 public DebugBreakpointResolution(enum_BP_TYPE type, DebugProgram program)
 {
     this.type = type;
     this.program = program;
 }
Beispiel #18
0
 /// <summary>
 /// Send an event from the given sender.
 /// </summary>
 public void Send(DebugProgram sender, BaseEvent @event)
 {
     Send(sender.Process, sender, null, @event);
 }
Beispiel #19
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public ThreadManager(DebugProgram program, EngineEventCallback eventCallback)
     : base(program)
 {
     this.program       = program;
     this.eventCallback = eventCallback;
 }
Beispiel #20
0
 /// <summary>
 /// breakpoint can be null.
 /// </summary>
 public DebugBreakpointResolution(enum_BP_TYPE type, DebugProgram program, DalvikLocationBreakpoint locationBP)
 {
     this.type       = type;
     this.program    = program;
     this.locationBP = locationBP;
 }
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugBreakpointManager(DebugProgram program, EngineEventCallback eventCallback)
     : base(program)
 {
     this.program       = program;
     this.eventCallback = eventCallback;
 }
 /// <summary>
 /// breakpoint can be null.
 /// </summary>
 public DebugBreakpointResolution(enum_BP_TYPE type, DebugProgram program, DalvikLocationBreakpoint locationBP)
 {
     this.type = type;
     this.program = program;
     this.locationBP = locationBP;
 }