Exemple #1
0
        public override bool SetBreakpoint(Module module)
        {
            bool okMod = MethodKey.IsSameModule(module.FullPath);

            Debug.Assert(okMod, "Trying to set a BP that belongs in another module");
            if (!okMod)
            {
                return(false);
            }
            SourcecodeSegment segment = SourcecodeSegment.CreateForIL(module, this.Location.Line, (int)MethodKey.Token, (int)ILOffset);

            if (segment == null)
            {
                return(false);
            }
            try {
                ICorDebugFunctionBreakpoint corBreakpoint = segment.CorFunction.GetILCode().CreateBreakpoint((uint)segment.ILStart);
                corBreakpoint.Activate(Enabled ? 1 : 0);

                corBreakpoints.Add(corBreakpoint);

                OnSet(new BreakpointEventArgs(this));

                return(true);
            } catch {
                return(false);
            }
        }
Exemple #2
0
        public virtual bool SetBreakpoint(Module module)
        {
            if (this.fileName == null)
            {
                return(false);
            }

            SourcecodeSegment segment = SourcecodeSegment.Resolve(module, FileName, CheckSum, Line, Column);

            if (segment == null)
            {
                return(false);
            }

            originalLocation = segment;

            ICorDebugFunctionBreakpoint corBreakpoint = segment.CorFunction.GetILCode().CreateBreakpoint((uint)segment.ILStart);

            corBreakpoint.Activate(enabled ? 1 : 0);

            corBreakpoints.Add(corBreakpoint);

            OnSet(new BreakpointEventArgs(this));

            return(true);
        }
 public void SetBreakpoint(Module module)
 {
     foreach (var symbolSource in module.Process.Debugger.SymbolSources)
     {
         foreach (var seq in symbolSource.GetSequencePoints(module, this.FileName, this.Line, this.Column))
         {
             ICorDebugFunction           corFunction   = module.CorModule.GetFunctionFromToken(seq.MethodDefToken);
             ICorDebugFunctionBreakpoint corBreakpoint = corFunction.GetILCode().CreateBreakpoint((uint)seq.ILOffset);
             corBreakpoint.Activate(enabled ? 1 : 0);
             corBreakpoints.Add(corBreakpoint);
         }
     }
 }
        public bool SetBreakpoint(Module module)
        {
            ICorDebugFunction corFunction;
            int ilOffset;

            if (!sourcecodeSegment.GetFunctionAndOffset(module, false, out corFunction, out ilOffset))
            {
                return(false);
            }

            corBreakpoint = corFunction.ILCode.CreateBreakpoint((uint)ilOffset);

            hadBeenSet = true;
            corBreakpoint.Activate(enabled?1:0);

            OnChanged();

            return(true);
        }
Exemple #5
0
        public override bool SetBreakpoint(Module module)
        {
            SourcecodeSegment segment = SourcecodeSegment.CreateForIL(module, this.Line, (int)MetadataToken, ILOffset);

            if (segment == null)
            {
                return(false);
            }
            try {
                ICorDebugFunctionBreakpoint corBreakpoint = segment.CorFunction.GetILCode().CreateBreakpoint((uint)segment.ILStart);
                corBreakpoint.Activate(Enabled ? 1 : 0);

                corBreakpoints.Add(corBreakpoint);

                OnSet(new BreakpointEventArgs(this));

                return(true);
            } catch {
                return(false);
            }
        }
Exemple #6
0
        public void RunTo(string fileName, int line, int column)
        {
            foreach (var symbolSource in this.Debugger.SymbolSources)
            {
                foreach (Module module in this.Modules)
                {
                    // Note the we might get multiple matches
                    foreach (SequencePoint seq in symbolSource.GetSequencePoints(module, fileName, line, column))
                    {
                        ICorDebugFunction           corFunction   = module.CorModule.GetFunctionFromToken(seq.MethodDefToken);
                        ICorDebugFunctionBreakpoint corBreakpoint = corFunction.GetILCode().CreateBreakpoint((uint)seq.ILOffset);
                        corBreakpoint.Activate(1);
                        this.tempBreakpoints.Add(corBreakpoint);

                        if (this.IsPaused)
                        {
                            AsyncContinue();
                        }
                    }
                }
            }
        }
Exemple #7
0
 internal CorFunctionBreakpoint(ICorDebugFunctionBreakpoint breakpoint)
     : base(breakpoint)
 {
     m_breakpoint = breakpoint;
 }
Exemple #8
0
		public bool SetBreakpoint(Module module)
		{
			ICorDebugFunction corFunction;
			int ilOffset;
			if (!sourcecodeSegment.GetFunctionAndOffset(module, false, out corFunction, out ilOffset)) {
				return false;
			}
			
			corBreakpoint = corFunction.ILCode.CreateBreakpoint((uint)ilOffset);
			
			hadBeenSet = true;
			corBreakpoint.Activate(enabled?1:0);
			
			OnChanged();
			
			return true;
		}
Exemple #9
0
		public Breakpoint(NDebugger debugger, ICorDebugFunctionBreakpoint corBreakpoint)
		{
			this.debugger = debugger;
			this.corBreakpoints.Add(corBreakpoint);
		}
        int ICorDebugCode.CreateBreakpoint(uint offset, out ICorDebugFunctionBreakpoint ppBreakpoint)
        {
            ppBreakpoint = new CorDebugFunctionBreakpoint(m_function, offset);

            return(COM_HResults.S_OK);
        }
 internal bool Equals(ICorDebugFunctionBreakpoint obj)
 {
     return(corBreakpoint == obj);
 }
Exemple #12
0
        int ICorDebugFunction.CreateBreakpoint(out ICorDebugFunctionBreakpoint ppBreakpoint)
        {
            ppBreakpoint = new CorDebugFunctionBreakpoint(this, 0);

            return(COM_HResults.S_OK);
        }
Exemple #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CorFunctionBreakpoint"/> class.
 /// </summary>
 /// <param name="cobreakpoint">The cobreakpoint.</param>
 internal CorFunctionBreakpoint(ICorDebugFunctionBreakpoint cobreakpoint, CorDebuggerOptions options)
     : base(cobreakpoint, options)
 {
     this.p_cobreakpoint = cobreakpoint;
 }
Exemple #14
0
		internal bool Equals(ICorDebugFunctionBreakpoint obj) 
		{
			return corBreakpoint == obj;
		}
Exemple #15
0
 public Breakpoint(NDebugger debugger, ICorDebugFunctionBreakpoint corBreakpoint)
 {
     this.debugger = debugger;
     this.corBreakpoints.Add(corBreakpoint);
 }
 public CorBreakPoint(ICorDebugFunctionBreakpoint _bp) {
     breakPoint = _bp;
 }
Exemple #17
0
 internal CorFunctionBreakpoint(ICorDebugFunctionBreakpoint breakpoint) : base(breakpoint)
 {
     m_breakpoint = breakpoint;
 }
 public DebugFunctionBreakpoint(ICorDebugFunctionBreakpoint bp)
 {
     _bp = bp;
 }
Exemple #19
0
 internal DebuggedFunctionBreakpoint(ICorDebugFunctionBreakpoint br)
     : base(br)
 {
 }
        int ICorDebugCode.CreateBreakpoint (uint offset, out ICorDebugFunctionBreakpoint ppBreakpoint)
        {
            ppBreakpoint = new CorDebugFunctionBreakpoint(m_function, offset);

            return Utility.COM_HResults.S_OK;
        }
 internal FunctionBreakpoint(RuntimeFunction function, ICorDebugFunctionBreakpoint comBreakpoint)
     : base(comBreakpoint)
 {
     _comBreakpoint = comBreakpoint;
     _function = function;
 }
        int ICorDebugFunction.CreateBreakpoint( out ICorDebugFunctionBreakpoint ppBreakpoint )
        {
            ppBreakpoint = new CorDebugFunctionBreakpoint( this, 0 );

            return Utility.COM_HResults.S_OK;
        }
Exemple #23
0
 internal FunctionBreakpoint(RuntimeFunction function, ICorDebugFunctionBreakpoint comBreakpoint)
     : base(comBreakpoint)
 {
     _comBreakpoint = comBreakpoint;
     _function      = function;
 }