Ejemplo n.º 1
0
            DkmRuntimeInstructionBreakpoint PlaceBreakpointAtAddress(NullcRemoteProcessDataItem processData, DkmThread thread, ulong instructionAddress)
            {
                var dkmInstruction = DkmNativeInstructionAddress.Create(processData.nativeRuntimeInstance, processData.nativeModuleInstance, (uint)(instructionAddress - processData.nativeModuleInstance.BaseAddress), new DkmInstructionAddress.CPUInstruction(instructionAddress));

                var stepBreakpoint = DkmRuntimeInstructionBreakpoint.Create(DebugHelpers.NullcStepperBreakpointSourceId, thread, dkmInstruction, false, null);

                stepBreakpoint.Enable();

                return(stepBreakpoint);
            }
Ejemplo n.º 2
0
            void ClearStepBreakpoints(NullcRemoteProcessDataItem processData)
            {
                if (processData.stepBreakpoint != null)
                {
                    // Even though documentation for Close says that the breakpoint will be implicitly closed it doesn't, so we disable it manually
                    processData.stepBreakpoint.Disable();

                    processData.stepBreakpoint.Close();
                    processData.stepBreakpoint = null;
                }

                if (processData.secondaryStepBreakpoint != null)
                {
                    processData.secondaryStepBreakpoint.Disable();

                    processData.secondaryStepBreakpoint.Close();
                    processData.secondaryStepBreakpoint = null;
                }
            }