Esempio n. 1
0
        // Parses a text-based expression for evaluation.
        // The engine sample only supports locals and parameters so the only task here is to check the names in those collections.
        int IDebugExpressionContext2.ParseText(string pszCode,
                                               enum_PARSEFLAGS dwFlags,
                                               uint nRadix,
                                               out IDebugExpression2 ppExpr,
                                               out string pbstrError,
                                               out uint pichError)
        {
            pbstrError = null;
            pichError  = 0;
            ppExpr     = null;

            try
            {
                // we have no "parser" as such, so we accept anything that isn't blank and let the Evaluate method figure out the errors
                ppExpr = new AD7Expression(Engine, Engine.DebuggedProcess.Natvis.GetVariable(pszCode, this));
                return(Constants.S_OK);
            }
            catch (MIException e)
            {
                return(e.HResult);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
Esempio n. 2
0
        // Parses a text-based expression for evaluation.
        // The engine sample only supports locals and parameters so the only task here is to check the names in those collections.
        int IDebugExpressionContext2.ParseText(string pszCode,
                                                enum_PARSEFLAGS dwFlags,
                                                uint nRadix,
                                                out IDebugExpression2 ppExpr,
                                                out string pbstrError,
                                                out uint pichError)
        {
            pbstrError = null;
            pichError = 0;
            ppExpr = null;

            try
            {
                // we have no "parser" as such, so we accept anything that isn't blank and let the Evaluate method figure out the errors
                ppExpr = new AD7Expression(Engine.DebuggedProcess.Natvis.GetVariable(pszCode, this));
                return Constants.S_OK;
            }
            catch (MIException e)
            {
                return e.HResult;
            }
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
        }
Esempio n. 3
0
 public int GetExpression(out IDebugExpression2 expr)
 {
     expr = new AD7Expression(_engine, _var);
     return(Constants.S_OK);
 }
Esempio n. 4
0
 public int GetExpression(out IDebugExpression2 expr)
 {
     expr = new AD7Expression(_engine, _var);
     return Constants.S_OK;
 }