Esempio n. 1
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);
        }
Esempio n. 2
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);
            }
        }
Esempio n. 3
0
 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);
        }
Esempio n. 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);
            }
        }
Esempio n. 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();
                        }
                    }
                }
            }
        }
Esempio n. 7
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;
		}