Ejemplo n.º 1
0
        public int EnumCodeContexts(IDebugDocumentPosition2 pDocPos, out IEnumDebugCodeContexts2 ppEnum)
        {
            TextPositionInfo posInfo = new TextPositionInfo(pDocPos);

            MonoDocumentContext docCtx    = new MonoDocumentContext(posInfo, null);
            MonoMemoryContext   memoryCtx = new MonoMemoryContext(docCtx, 0);

            ppEnum = new MonoCodeContextEnumerator(new IDebugCodeContext2[] { memoryCtx });

            return(S_OK);
        }
        public int GetResolutionInfo(uint dwFields, BP_RESOLUTION_INFO[] pBPResolutionInfo)
        {
            if ((dwFields & (uint)enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION) != 0)
            {
                BP_RESOLUTION_LOCATION location = new BP_RESOLUTION_LOCATION {
                    bpType = (uint)enum_BP_TYPE.BPT_CODE
                };

                MonoMemoryContext codeContext = new MonoMemoryContext(_document, _address);
                location.unionmember1 = Marshal.GetComInterfaceForObject(codeContext, typeof(IDebugCodeContext2));
                pBPResolutionInfo[0].bpResLocation = location;
                pBPResolutionInfo[0].dwFields     |= (uint)enum_BPRESI_FIELDS.BPRESI_BPRESLOCATION;
            }

            return(S_OK);
        }
Ejemplo n.º 3
0
 public MonoDocumentContext(TextPositionInfo info, MonoMemoryContext memory)
 {
     _info   = info;
     _memory = memory;
 }
Ejemplo n.º 4
0
        public int GetCodeContext(out IDebugCodeContext2 ppCodeCxt)
        {
            ppCodeCxt = new MonoMemoryContext(null, (uint)_monoStackFrame.Address);

            return(S_OK);
        }
Ejemplo n.º 5
0
        public int Compare(uint Compare, IDebugMemoryContext2[] rgpMemoryContextSet, uint dwMemoryContextSetLen, out uint pdwMemoryContext)
        {
            pdwMemoryContext = uint.MaxValue;

            for (uint c = 0; c < dwMemoryContextSetLen; c++)
            {
                MonoMemoryContext compareTo = rgpMemoryContextSet[c] as MonoMemoryContext;
                if (compareTo == null)
                {
                    continue;
                }

                bool result;

                switch ((enum_CONTEXT_COMPARE)Compare)
                {
                case enum_CONTEXT_COMPARE.CONTEXT_EQUAL:
                    result = _address == compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN:
                    result = _address < compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN:
                    result = _address > compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_LESS_THAN_OR_EQUAL:
                    result = _address <= compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_GREATER_THAN_OR_EQUAL:
                    result = _address >= compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_SAME_SCOPE:
                case enum_CONTEXT_COMPARE.CONTEXT_SAME_FUNCTION:
                    result = _address == compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_SAME_MODULE:
                    result = _address == compareTo._address;
                    break;

                case enum_CONTEXT_COMPARE.CONTEXT_SAME_PROCESS:
                    result = true;
                    break;

                default:
                    return(E_NOTIMPL);
                }

                if (result)
                {
                    pdwMemoryContext = c;
                    return(S_OK);
                }
            }

            return(S_FALSE);
        }
Ejemplo n.º 6
0
        public int Subtract(ulong dwCount, out IDebugMemoryContext2 ppMemCxt)
        {
            ppMemCxt = new MonoMemoryContext(_document, (uint)(_address - dwCount));

            return(S_OK);
        }