Exemple #1
0
 public void Enable() {
   DkmNativeModuleInstance module = entryAddress.ModuleInstance;
   FunctionTraceDataItem traceDataItem = new FunctionTraceDataItem { Tracer = this };
   entryBp = DkmRuntimeInstructionBreakpoint.Create(
       Guids.Source.FunctionTraceEnter, null, entryAddress, false, null);
   entryBp.SetDataItem(DkmDataCreationDisposition.CreateAlways, traceDataItem);
   entryBp.Enable();
 }
        public void Enable()
        {
            DkmNativeModuleInstance module        = entryAddress.ModuleInstance;
            FunctionTraceDataItem   traceDataItem = new FunctionTraceDataItem {
                Tracer = this
            };

            entryBp = DkmRuntimeInstructionBreakpoint.Create(
                Guids.Source.FunctionTraceEnter, null, entryAddress, false, null);
            entryBp.SetDataItem(DkmDataCreationDisposition.CreateAlways, traceDataItem);
            entryBp.Enable();
        }
Exemple #3
0
        public void OnRuntimeBreakpointReceived(
            DkmRuntimeBreakpoint bp,
            DkmThread thread,
            bool hasException,
            DkmEventDescriptorS eventDescriptor)
        {
            FunctionTraceDataItem traceDataItem = bp.GetDataItem <FunctionTraceDataItem>();

            if (traceDataItem != null && traceDataItem.Tracer != null)
            {
                if (bp.SourceId == Guids.Source.FunctionTraceEnter)
                {
                    traceDataItem.Tracer.OnEntryBreakpointHit(bp, thread, hasException);
                }
                else if (bp.SourceId == Guids.Source.FunctionTraceExit)
                {
                    traceDataItem.Tracer.OnExitBreakpointHit(bp, thread, hasException);
                }
            }
        }