Example #1
0
		public bool Hit(BreakpointConditionContext context) {
			foreach (var hitBp in hitBps) {
				if (!hitBp.Hit(context))
					return false;
			}
			return true;
		}
Example #2
0
 public bool Hit(BreakpointConditionContext context)
 {
     foreach (var hitBp in hitBps)
     {
         if (!hitBp.Hit(context))
         {
             return(false);
         }
     }
     return(true);
 }
Example #3
0
        bool OnLoadModule(BreakpointConditionContext context)
        {
            var ctx    = (DebugEventBreakpointConditionContext)context;
            var lmArgs = (LoadModuleDebugCallbackEventArgs)ctx.EventArgs;
            var mod    = lmArgs.CorModule;

            if (!IsOurModule(mod))
            {
                return(false);
            }
            debugger.RemoveBreakpoint(breakpoint);
            breakpoint = null;
            var serMod = mod.SerializedDnModule;

            if (type == BreakProcessType.ModuleCctorOrEntryPoint)
            {
                uint cctorToken = MetaDataUtils.GetGlobalStaticConstructor(mod.GetMetaDataInterface <IMetaDataImport>());
                if (cctorToken != 0)
                {
                    SetILBreakpoint(serMod, cctorToken);
                    return(false);
                }
            }

            string otherModuleName;
            uint   epToken = GetEntryPointToken(filename, out otherModuleName);

            if (epToken != 0)
            {
                if ((Table)(epToken >> 24) == Table.Method)
                {
                    SetILBreakpoint(serMod, epToken);
                    return(false);
                }

                if (otherModuleName != null)
                {
                    Debug.Assert((Table)(epToken >> 24) == Table.File);
                    otherModuleFullName = GetOtherModuleFullName(otherModuleName);
                    if (otherModuleFullName != null)
                    {
                        thisAssembly = mod.Assembly;
                        breakpoint   = debugger.CreateBreakpoint(DebugEventBreakpointType.LoadModule, OnLoadOtherModule);
                        return(false);
                    }
                }
            }

            // Failed to set BP. Break to debugger.
            return(true);
        }
Example #4
0
        bool OnLoadOtherModule(BreakpointConditionContext context)
        {
            var ctx    = (DebugEventBreakpointConditionContext)context;
            var lmArgs = (LoadModuleDebugCallbackEventArgs)ctx.EventArgs;
            var mod    = lmArgs.CorModule;

            if (!IsModule(mod, otherModuleFullName) || mod.Assembly != thisAssembly)
            {
                return(false);
            }
            debugger.RemoveBreakpoint(breakpoint);
            breakpoint = null;

            string otherModuleName;
            uint   epToken = GetEntryPointToken(otherModuleFullName, out otherModuleName);

            if (epToken != 0 && (Table)(epToken >> 24) == Table.Method)
            {
                SetILBreakpoint(mod.SerializedDnModule, epToken);
                return(false);
            }

            return(true);
        }
Example #5
0
        bool OnLoadOtherModule(BreakpointConditionContext context)
        {
            var ctx = (DebugEventBreakpointConditionContext)context;
            var lmArgs = (LoadModuleDebugCallbackEventArgs)ctx.EventArgs;
            var mod = lmArgs.CorModule;
            if (!IsModule(mod, otherModuleFullName) || mod.Assembly != thisAssembly)
                return false;
            debugger.RemoveBreakpoint(breakpoint);
            breakpoint = null;

            string otherModuleName;
            uint epToken = GetEntryPointToken(otherModuleFullName, out otherModuleName);
            if (epToken != 0 && (Table)(epToken >> 24) == Table.Method) {
                SetILBreakpoint(mod.SerializedDnModule, epToken);
                return false;
            }

            return true;
        }
Example #6
0
        bool OnLoadModule(BreakpointConditionContext context)
        {
            var ctx = (DebugEventBreakpointConditionContext)context;
            var lmArgs = (LoadModuleDebugCallbackEventArgs)ctx.EventArgs;
            var mod = lmArgs.CorModule;
            if (!IsOurModule(mod))
                return false;
            debugger.RemoveBreakpoint(breakpoint);
            breakpoint = null;
            var serMod = mod.SerializedDnModule;

            if (type == BreakProcessType.ModuleCctorOrEntryPoint) {
                uint cctorToken = MetaDataUtils.GetGlobalStaticConstructor(mod.GetMetaDataInterface<IMetaDataImport>());
                if (cctorToken != 0) {
                    SetILBreakpoint(serMod, cctorToken);
                    return false;
                }
            }

            string otherModuleName;
            uint epToken = GetEntryPointToken(filename, out otherModuleName);
            if (epToken != 0) {
                if ((Table)(epToken >> 24) == Table.Method) {
                    SetILBreakpoint(serMod, epToken);
                    return false;
                }

                if (otherModuleName != null) {
                    Debug.Assert((Table)(epToken >> 24) == Table.File);
                    otherModuleFullName = GetOtherModuleFullName(otherModuleName);
                    if (otherModuleFullName != null) {
                        thisAssembly = mod.Assembly;
                        breakpoint = debugger.CreateBreakpoint(DebugEventBreakpointType.LoadModule, OnLoadOtherModule);
                        return false;
                    }
                }
            }

            // Failed to set BP. Break to debugger.
            return true;
        }
Example #7
0
 public bool Hit(BreakpointConditionContext context)
 {
     return(++hits == count);
 }
Example #8
0
 public bool Hit(BreakpointConditionContext context)
 {
     return(false);
 }
Example #9
0
 public bool Hit(BreakpointConditionContext context)
 {
     return(cond(context));
 }
Example #10
0
		public bool Hit(BreakpointConditionContext context) {
			return ++hits == count;
		}
Example #11
0
		public bool Hit(BreakpointConditionContext context) {
			return false;
		}
Example #12
0
		public bool Hit(BreakpointConditionContext context) {
			return cond(context);
		}