////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public DebuggeeProcess(DebuggeePort port, AndroidProcess androidProcess)
        {
            m_debuggeePort = port;

            DebuggeeProgram = new DebuggeeProgram(this);

            Guid = Guid.NewGuid();

            NativeProcess = androidProcess;
        }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public CLangDebuggeeProgram (CLangDebugger debugger, DebuggeeProgram debugProgram)
    {
      m_debugger = debugger;

      DebugProgram = debugProgram;

      IsRunning = false;

      m_debugModules = new Dictionary<string, DebuggeeModule> ();

      m_debugThreads = new Dictionary<uint, DebuggeeThread> ();
    }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public DebuggeeThread(DebuggeeProgram program, uint threadId, string threadName)
        {
            m_debugProgram = program;

            m_threadId = threadId;

            m_threadName = threadName;

            m_threadDisplayName = m_threadName;

            m_threadRunning = true;

            m_threadSuspendCount = 0;

            m_threadStackFrames = new List <DebuggeeStackFrame> ();
        }
Beispiel #4
0
        //private int m_interruptOperationCounter = 0;

        //private ManualResetEvent m_interruptOperationCompleted = null;

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public JavaLangDebugger(DebugEngine debugEngine, DebuggeeProgram debugProgram)
        {
            Engine = debugEngine;

            m_javaLangCallback = new JavaLangDebuggerCallback(debugEngine);

            JavaProgram = new JavaLangDebuggeeProgram(this, debugProgram);

            m_jdbSetup = new JdbSetup(debugProgram.DebugProcess.NativeProcess);

            Engine.Broadcast(new DebugEngineEvent.DebuggerConnectionEvent(DebugEngineEvent.DebuggerConnectionEvent.EventType.LogStatus, string.Format("Configuring JDB for {0}:{1}...", m_jdbSetup.Host, m_jdbSetup.Port)), null, null);

            JdbClient = new JdbClient(m_jdbSetup);

            JdbClient.OnAsyncStdout = OnClientAsyncOutput;

            JdbClient.OnAsyncStderr = OnClientAsyncOutput;

            JdbClient.Start();
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int AddProgramNode(IDebugProgramNode2 pProgramNode)
        {
            //
            // Registers a program that can be debugged with the port it is running on.
            //

            LoggingUtils.PrintFunction();

            try
            {
                IDebugProcess2 process;

                DebuggeeProgram program = pProgramNode as DebuggeeProgram;

                LoggingUtils.RequireOk(program.GetProcess(out process));

                foreach (IDebugPortEvents2 connectionPoint in m_eventConnectionPoints.Values)
                {
                    ProgramCreate debugEvent = new ProgramCreate();

                    Guid eventGuid = ComUtils.GuidOf(debugEvent);

                    int handle = connectionPoint.Event(null, this, process, program, debugEvent, ref eventGuid);

                    if (handle == unchecked ((int)0x80010108)) // RPC_E_DISCONNECTED
                    {
                        continue;                              // Connection point was previously used.
                    }

                    LoggingUtils.RequireOk(handle);
                }

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_FAIL);
            }
        }