Example #1
0
        // Gets the document context for this stack frame. The debugger will call this when the current stack frame is changed
        // and will use it to open the correct source document for this stack frame.
        int IDebugStackFrame2.GetDocumentContext(out IDebugDocumentContext2 docContext)
        {
            docContext = null;
            try
            {
                if (hasSource)
                {
                    // Assume all lines begin and end at the beginning of the line.
                    // TODO: Accurate line endings
                    var           lineNumber = (uint)LineNumber;
                    TEXT_POSITION begTp      = new TEXT_POSITION();
                    begTp.dwColumn = 0;
                    begTp.dwLine   = lineNumber - 1;
                    TEXT_POSITION endTp = new TEXT_POSITION();
                    endTp.dwColumn = 0;
                    endTp.dwLine   = lineNumber - 1;

                    docContext = new MonoDocumentContext(engine.TranslateToLocalPath(documentName), begTp, endTp, null);
                    return(VSConstants.S_OK);
                }
            }
            catch (ComponentException e)
            {
                return(e.HResult);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }

            return(VSConstants.S_FALSE);
        }
Example #2
0
        public int EnumCodeContexts(IDebugDocumentPosition2 pDocPos, out IEnumDebugCodeContexts2 ppEnum)
        {
            TEXT_POSITION[] startPosition;
            TEXT_POSITION[] endPosition;
            var             documentName = breakpointManager.Engine.GetLocationInfo(pDocPos, out startPosition, out endPosition);

            var textPosition = new TEXT_POSITION {
                dwLine = startPosition[0].dwLine + 1
            };
            var documentContext = new MonoDocumentContext(documentName, textPosition, textPosition, null);

            ppEnum = new MonoCodeContextEnum(new[] { new MonoMemoryAddress(this, 0, documentContext) });
            return(VSConstants.S_OK);
        }
Example #3
0
 public MonoBreakpointResolution(MonoEngine engine, uint address, MonoDocumentContext documentContext)
 {
     this.engine          = engine;
     this.address         = address;
     this.documentContext = documentContext;
 }
Example #4
0
 public MonoMemoryAddress(MonoEngine engine, uint address, MonoDocumentContext documentContext)
 {
     this.engine          = engine;
     this.address         = 0;//address;
     this.documentContext = documentContext;
 }