示例#1
0
 public XamarinExpression(XamarinEngine engine, XamarinThread thread, Mono.Debugging.Client.ObjectValue var)
 {
     _var       = var;
     _asyncEval = null;
     _engine    = engine;
     _thread    = thread;
 }
 public XamarinThread(XamarinEngine engine, long id, string name, string location, SoftDebuggerSession session)
 {
     _engine   = engine;
     _id       = id;
     _name     = name;
     _location = location;
     _session  = session;
 }
示例#3
0
        public XamarinStackFrame(XamarinEngine engine, XamarinThread thread, Mono.Debugging.Client.StackFrame stackFrame)
        {
            _engine     = engine;
            _thread     = thread;
            _stackFrame = stackFrame;

            _parameters = _stackFrame.GetParameters();
            _locals     = _stackFrame.GetLocalVariables();
            _thisObject = _stackFrame.GetThisReference();
        }
示例#4
0
        // Compares the memory context to each context in the given array in the manner indicated by compare flags,
        // returning an index of the first context that matches.
        public int Compare(enum_CONTEXT_COMPARE uContextCompare, IDebugMemoryContext2[] compareToItems, uint compareToLength, out uint foundIndex)
        {
            foundIndex = uint.MaxValue;

            try
            {
                enum_CONTEXT_COMPARE contextCompare = (enum_CONTEXT_COMPARE)uContextCompare;

                for (uint c = 0; c < compareToLength; c++)
                {
                    XamarinMemoryAddress compareTo = compareToItems[c] as XamarinMemoryAddress;
                    if (compareTo == null)
                    {
                        continue;
                    }

                    if (!XamarinEngine.ReferenceEquals(this._engine, compareTo._engine))
                    {
                        continue;
                    }

                    bool result;

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

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

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

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

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

                    // The sample debug engine doesn't understand scopes or functions
                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_SCOPE:
                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_FUNCTION:
                        result = (this._address == compareTo._address);
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_MODULE:
                        result = (this._address == compareTo._address);

                        /*if (result == false)
                         * {
                         *  DebuggedModule module = m_engine.DebuggedProcess.ResolveAddress(m_address);
                         *
                         *  if (module != null)
                         *  {
                         *      result = (compareTo.m_address >= module.BaseAddress) &&
                         *          (compareTo.m_address < module.BaseAddress + module.Size);
                         *  }
                         * }*/
                        break;

                    case enum_CONTEXT_COMPARE.CONTEXT_SAME_PROCESS:
                        result = true;
                        break;

                    default:
                        // A new comparison was invented that we don't support
                        return(VisualStudioExtensionConstants.E_NOTIMPL);
                    }

                    if (result)
                    {
                        foundIndex = c;
                        return(VisualStudioExtensionConstants.S_OK);
                    }
                }

                return(VisualStudioExtensionConstants.S_FALSE);
            }
            catch (ComponentException e)
            {
                return(e.HResult);
            }
            catch (Exception e)
            {
                NLogService.Logger.Error(e);
                return(VisualStudioExtensionConstants.S_FALSE);
            }
        }
示例#5
0
 public XamarinMemoryAddress(XamarinEngine engine, uint address)
 {
     _engine  = engine;
     _address = address;
 }