Exemplo n.º 1
0
            /// <summary>
            /// Disconnect all debuggers except the given one.
            /// </summary>
            private void DisposeOtherDebuggers(XDebugger correctDebugger)
            {
                XDebugger debugger;

                while (debuggers.TryTake(out debugger))
                {
                    if (debugger != correctDebugger)
                    {
                        debugger.Dispose();
                    }
                }
            }
Exemplo n.º 2
0
            /// <summary>
            /// New JDWP process found, attach debugger to it.
            /// </summary>
            private void OnDebuggableProcessAdded(IDevice device, int pid)
            {
                // Did we see the pid before?
                lock (processedPidsLock)
                {
                    if (!processedPids.Add(pid))
                    {
                        outputPane.LogLine(string.Format("Found debuggable process {0} again, ignoring", pid));
                        return;
                    }
                }

                // Wait a while, it can be a very short lived process
                Thread.Sleep(500);

                // Cancelled?
                if (token.IsCancellationRequested)
                {
                    DLog.Debug(DContext.VSDebuggerLauncher, "Cancel requested");
                    return;
                }

                // Check if pid still exists
                var monitor = jdwpMonitor;

                if ((monitor == null) || !monitor.ContainsProcess(pid))
                {
                    DLog.Debug(DContext.VSDebuggerLauncher, "JDWP process gone {0}", pid);
                    return;
                }

                // Create and attach debugger
                outputPane.LogLine(string.Format("Found debuggable process {0}", pid));
                var debugger = new XDebugger(ide.GetFrameworkTypeMap(apiLevel));

                debuggers.Add(debugger);
                debugger.JdwpEvent += OnDebuggerDalvikEvent;
                debugger.Connect(device, pid, new MapFile(), apkPath);
                ide.CurrentDevice    = device;
                ide.CurrentProcessId = pid;
            }
Exemplo n.º 3
0
 internal ReferenceTypeCommandSet(Debugger debugger)
     : base(debugger, 2)
 {
 }
Exemplo n.º 4
0
 internal StringReferenceCommandSet(Debugger debugger)
     : base(debugger, 10)
 {
 }
Exemplo n.º 5
0
 internal ClassTypeCommandSet(Debugger debugger)
     : base(debugger, 3)
 {
 }
Exemplo n.º 6
0
 internal VirtualMachineCommandSet(Debugger debugger)
     : base(debugger, 1)
 {
 }
Exemplo n.º 7
0
 internal DdmsCommandSet(Debugger debugger)
     : base(debugger, 0xC7)
 {
 }
Exemplo n.º 8
0
 internal StackFrameCommandSet(Debugger debugger)
     : base(debugger, 16)
 {
 }
Exemplo n.º 9
0
 internal ClassReferenceCommandSet(Debugger debugger)
     : base(debugger, 17)
 {
 }
Exemplo n.º 10
0
 internal ObjectReferenceCommandSet(Debugger debugger)
     : base(debugger, 9)
 {
 }
Exemplo n.º 11
0
 internal EventRequestCommandSet(Debugger debugger)
     : base(debugger, 15)
 {
 }
Exemplo n.º 12
0
 /// <summary>
 /// Disconnect all debuggers except the given one.
 /// </summary>
 private void DisposeOtherDebuggers(XDebugger correctDebugger)
 {
     XDebugger debugger;
     while (debuggers.TryTake(out debugger))
     {
         if (debugger != correctDebugger)
         {
             debugger.Dispose();
         }
     }
 }
Exemplo n.º 13
0
            /// <summary>
            /// New JDWP process found, attach debugger to it.
            /// </summary>
            private void OnDebuggableProcessAdded(IDevice device, int pid)
            {
                // Did we see the pid before?
                lock (processedPidsLock)
                {
                    if (!processedPids.Add(pid))
                    {
                        outputPane.LogLine(string.Format("Found debuggable process {0} again, ignoring", pid));
                        return;
                    }
                }

                // Wait a while, it can be a very short lived process
                Thread.Sleep(500);

                // Cancelled?
                if (token.IsCancellationRequested)
                {
                    DLog.Debug(DContext.VSDebuggerLauncher, "Cancel requested");
                    return;                    
                }

                // Check if pid still exists
                var monitor = jdwpMonitor;
                if ((monitor == null) || !monitor.ContainsProcess(pid))
                {
                    DLog.Debug(DContext.VSDebuggerLauncher, "JDWP process gone {0}", pid);
                    return;
                }

                // Create and attach debugger
                outputPane.LogLine(string.Format("Found debuggable process {0}", pid));
                var debugger = new XDebugger(ide.GetFrameworkTypeMap(apiLevel));
                debuggers.Add(debugger);
                debugger.JdwpEvent += OnDebuggerDalvikEvent;
                debugger.Connect(device, pid, new MapFile());
                ide.CurrentDevice = device;
                ide.CurrentProcessId = pid;
            }
Exemplo n.º 14
0
 internal ThreadReferenceCommandSet(Debugger debugger)
     : base(debugger, 11)
 {
 }
Exemplo n.º 15
0
 internal MethodCommandSet(Debugger debugger)
     : base(debugger, 6)
 {
 }
Exemplo n.º 16
0
 internal ArrayReferenceCommandSet(Debugger debugger)
     : base(debugger, 13)
 {
 }
Exemplo n.º 17
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public DebugProcess(Dot42.DebuggerLib.Debugger debugger, MapFile mapFile) : base(debugger, mapFile, null)
 {
 }