示例#1
0
        CorStepper CreateStepper(CorFrame frame)
        {
            if (frame == null)
                return null;

            var stepper = frame.CreateStepper();
            if (stepper == null)
                return null;
            if (!stepper.SetInterceptMask(debugOptions.StepperInterceptMask))
                return null;
            if (!stepper.SetUnmappedStopMask(debugOptions.StepperUnmappedStopMask))
                return null;
            if (!stepper.SetJMC(debugOptions.StepperJMC))
                return null;

            return stepper;
        }
示例#2
0
        /// <summary>
        /// Issue the step and creates the underlying ICorDebugStepper object.
        /// This does not Continue the process, nor does it register for a
        /// step-complete handler.
        /// </summary>
        /// <remarks>No other flags can be set after this.</remarks>
        /// <returns>A CorStepper object which can be associated with the StepComplete handler.</returns>
        public CorStepper Step()
        {
            EnsureNotYetStepped();

            m_HasIssuedStep = true;

            //
            // 1. Create the stepper on the proper thread / frame.
            //

            CorThread thread = m_thread;

            if (thread == null)
            {
                thread = m_process.Threads.Active.CorThread;
            }

            CorStepper stepper;

            if (m_frame == null)
            {
                stepper = thread.CreateStepper();
            }
            else
            {
                stepper = m_frame.CreateStepper();
            }

            if (stepper == null)
            {
                return(null);             //zos; CSScript.Npp related changes
            }
            Debug.Assert(stepper != null);

            //
            // 2. Set the flags
            //
            stepper.SetUnmappedStopMask(m_StopMask);
            stepper.SetInterceptMask(m_InterceptMask);
            if (m_isJmc)
            {
                stepper.SetJmcStatus(true);
            }
            stepper.SetRangeIL(m_isRangeIl);

            //
            // 3. Issue the proper Step() command.
            //

            // 3a. Step-out
            if (m_type == StepperType.Out)
            {
                stepper.StepOut();
                return(stepper);
            }

            //
            // Step In-Over
            //
            bool stepInto = (m_type == StepperType.In);

            if (m_stepRanges == null)
            {
                // 3b. Single-Step In/Over, no ranges
                stepper.Step(stepInto);
            }
            else
            {
                // 3c. Step-range in/over.
                stepper.StepRange(stepInto, m_stepRanges);
            }
            return(stepper);
        }