private bool HandleBreakPoint(BreakpointEvent ev)
        {
            if (isStepping)
                return true;

            bool resume = false;
            
            AD7PendingBreakpoint bp;
            lock (_pendingBreakpoints)
                bp = _pendingBreakpoints.FirstOrDefault(x => x.LastRequest == ev.Request);

            if (bp == null)
                return true;
            
            Mono.Debugger.Soft.StackFrame[] frames = ev.Thread.GetFrames();
            _engine.Callback.BreakpointHit(bp, _mainThread);

            return resume;
        }
Ejemplo n.º 2
0
        internal void OnBreakpoint(BreakpointEvent e, ResolvedBreakpoint bp)
        {
            m_currentThread = e.Thread;

            var frames = new LiveStack(m_currentThread);

            Contract.Assert(BreakpointCondition != null, "BreakpointCondition is null");
            DebuggerThread.HandlerAction action = BreakpointCondition(frames[0], bp.BreakPoint);
            if (action == DebuggerThread.HandlerAction.Suspend)
            {
                if (m_stepRequest != null)
                {
                    m_stepRequest.Disable();
                    m_stepRequest = null;
                }

                Log.WriteLine(TraceLevel.Info, "Debugger", "Hit breakpoint at {0}:{1:X4}", e.Method.FullName, bp.Offset);
                var context = new Context(e.Thread, e.Method, bp.Offset);
                Broadcaster.Invoke("debugger processed breakpoint event", context);

                if (!NSApplication.sharedApplication().isActive())
                    NSApplication.sharedApplication().activateIgnoringOtherApps(true);
            }
            else
            {
                Log.WriteLine(TraceLevel.Info, "Debugger", "ignoring breakpoint at {0}:{1:X4} (condition evaluated to false)", e.Method.FullName, bp.Offset);
                m_thread.Resume();
            }
        }
Ejemplo n.º 3
0
        private HandlerAction DoBreakpointEvent(BreakpointEvent e)
        {
            DoTransition(State.Paused);

            KeyValuePair<ResolvedBreakpoint, BreakpointEventRequest> bp = m_breakpoints.Single(candidate => e.Request == candidate.Value);	// hitting a breakpoint is a fairly rare event so we can get by with a linear search

            // If the breakpoint condition is false then we'll be (more or less) immediately resumed.
            NSApplication.sharedApplication().BeginInvoke(() => m_debugger.OnBreakpoint(e, bp.Key));

            return HandlerAction.Suspend;
        }
Ejemplo n.º 4
0
 private void HandleBreakPoint(BreakpointEvent bpEvent)
 {
     MonoPendingBreakpoint bp = _pendingBreakpoints.FirstOrDefault(x => x.LastRequest == bpEvent.Request);
     StackFrame[] frames = bpEvent.Thread.GetFrames();
     _engine.Events.BreakpointHit(bp, _mainThread);
 }