Esempio n. 1
0
        private void SetASMBreakpoint(UInt32 aAddress)
        {
            if (GetASMBreakpointInfoFromASMAddress(aAddress) == null)
            {
                bool set = false;
                for (int xID = 0; xID < BreakpointManager.MaxBP; xID++)
                {
                    if (mEngine.BPMgr.mActiveBPs[xID] == null)
                    {
                        UInt32 CSBPAddress = mDebugInfoDb.GetClosestCSharpBPAddress(aAddress);
                        ASMBreakpoints.Add(new Tuple <UInt32, UInt32, int>(CSBPAddress, aAddress, xID));

                        mEngine.BPMgr.mActiveBPs[xID] = new AD7BoundBreakpoint(CSBPAddress);
                        var label = mDebugInfoDb.GetLabels(CSBPAddress)[0];
                        INT3sSet.Add(new KeyValuePair <uint, string>(CSBPAddress, label));
                        mDbgConnector.SetBreakpoint(xID, CSBPAddress);

                        set = true;
                        break;
                    }
                }
                if (!set)
                {
                    throw new Exception("Maximum number of active breakpoints exceeded (" + BreakpointManager.MaxBP + ").");
                }
            }
        }
Esempio n. 2
0
        private void ClearASMBreakpoint(UInt32 aAddress)
        {
            var bp = GetASMBreakpointInfoFromASMAddress(aAddress);

            if (bp != null)
            {
                var xID   = bp.Item3;
                int index = INT3sSet.FindIndex(x => x.Key == bp.Item1);
                INT3sSet.RemoveAt(index);
                mDbgConnector.DeleteBreakpoint(xID);
                mEngine.BPMgr.mActiveBPs[xID] = null;
                ASMBreakpoints.Remove(bp);
            }
        }
Esempio n. 3
0
        protected void DbgCmdStarted()
        {
            OutputText("DebugStub handshake completed.");
            DebugMsg("RmtDbg: Started");

            // OK, now debugger is ready. Send it a list of breakpoints that were set before
            // program run.
            foreach (var xBP in mEngine.BPMgr.mPendingBPs)
            {
                foreach (var xBBP in xBP.mBoundBPs)
                {
                    var label = mDebugInfoDb.GetLabels(xBBP.mAddress)[0];
                    INT3sSet.Add(new KeyValuePair <uint, string>(xBBP.mAddress, label));
                    mDbgConnector.SetBreakpoint(xBBP.RemoteID, xBBP.mAddress);
                }
            }
            mDbgConnector.SendCmd(Vs2Ds.BatchEnd);
        }