Inheritance: DebuggerMarshalByRefObject
示例#1
0
 public override void RemoveEvent(Mono.Debugger.Event ev)
 {
     if (!Process.MainThread.IsStopped)
     {
         ThrowNotSupported("Breakpoints can't be changed while the process is running.");
     }
     Session.DeleteEvent(ev);
 }
示例#2
0
 public override void ActivateEvent(Mono.Debugger.Event ev)
 {
     if (Process.MainThread.IsStopped)
     {
         ev.Activate(Process.MainThread);
     }
     else
     {
         ThrowNotSupported("Breakpoints can't be changed while the process is running.");
     }
 }
示例#3
0
 public override void EnableEvent(Mono.Debugger.Event ev, bool enable)
 {
     if (enable)
     {
         ev.Activate(Process.MainThread);
     }
     else
     {
         ev.Deactivate(Process.MainThread);
     }
 }
示例#4
0
 protected override void Action(ScriptingContext context, Event handle)
 {
     handle.IsEnabled = true;
 }
示例#5
0
 protected override void Action(ScriptingContext context, Event handle)
 {
     context.Interpreter.Session.RemoveEvent (handle);
 }
示例#6
0
 protected override void Action(ScriptingContext context, Event handle)
 {
     if (handle.IsActivated && handle.NeedsActivation)
         handle.Deactivate (context.Interpreter.CurrentThread);
 }
示例#7
0
        protected override bool DoResolve(ScriptingContext context)
        {
            if (Args == null || Args.Count == 0)
                return true;

            int id;
            try {
                id = (int) UInt32.Parse (Argument);
            } catch {
                context.Print ("event number expected.");
                return false;
            }

            handle = context.Interpreter.GetEvent (id);
            return handle != null;
        }
示例#8
0
 protected abstract void Action(ScriptingContext context, Event handle);
示例#9
0
        public bool ActivateOrDeactivateEventAsync(Event handle, bool activate)
        {
            lock (this) {
                if (!handle.NeedsActivation || (activate == handle.IsActivated))
                    return false;

                var action = activate ? BreakpointHandle.Action.Insert :
                    BreakpointHandle.Action.Remove;

                Breakpoint breakpoint = (Breakpoint) handle;
                if (pending_bpts.ContainsKey (breakpoint))
                    pending_bpts [breakpoint] = action;
                else
                    pending_bpts.Add (breakpoint, action);

                return true;
            }
        }
示例#10
0
 public virtual void RemoveEvent(MDB.Event ev)
 {
 }
示例#11
0
 public virtual void ActivateEvent(MDB.Event ev)
 {
 }
示例#12
0
 public virtual void EnableEvent(MDB.Event ev, bool enable)
 {
 }
示例#13
0
        public void RemoveEvent(Event handle)
        {
            lock (this) {
                var cp = handle as ExceptionCatchPoint;
                if (cp != null) {
                    exception_catchpoints.Remove (cp.UniqueID);
                    events.Remove (cp.Index);
                    return;
                }

                Breakpoint breakpoint = (Breakpoint) handle;
                breakpoint.IsEnabled = false;
                events.Remove (breakpoint.Index);
                if (pending_bpts.ContainsKey (breakpoint))
                    pending_bpts.Remove (breakpoint);
                if (reached_main)
                    pending_bpts.Add (breakpoint, BreakpointHandle.Action.Remove);
            }
        }
示例#14
0
 public void DeleteEvent(Event handle)
 {
     RemoveEvent (handle);
 }
示例#15
0
 public void DeactivateEventAsync(Event handle)
 {
     ActivateOrDeactivateEventAsync (handle, false);
 }
示例#16
0
        public void AddEvent(Event handle)
        {
            lock (this) {
                var cp = handle as ExceptionCatchPoint;
                if (cp != null) {
                    exception_catchpoints.Add (cp.UniqueID, cp);
                    events.Add (cp.Index, cp);
                    return;
                }

                Breakpoint breakpoint = (Breakpoint) handle;
                events.Add (breakpoint.Index, breakpoint);
                if (reached_main)
                    pending_bpts.Add (breakpoint, BreakpointHandle.Action.Insert);
            }
        }
示例#17
0
        public int InsertBreakEvent(DL.BreakEvent be, bool enable)
        {
            CancelRuntimeInvokes();
            DL.Breakpoint bp = be as DL.Breakpoint;
            MD.Event      ev = null;

            if (bp != null)
            {
                MD.SourceLocation   location = new MD.SourceLocation(bp.FileName, bp.Line);
                MD.SourceBreakpoint sbp      = new MD.SourceBreakpoint(session, ThreadGroup.Global, location);
                mdbAdaptor.InitializeBreakpoint(sbp);
                session.AddEvent(sbp);
                ev = sbp;
            }
            else if (be is Catchpoint)
            {
                lock (pendingCatchpoints) {
                    Catchpoint    cp  = (Catchpoint)be;
                    ML.TargetType exc = null;
                    if (process != null)
                    {
                        foreach (Module mod in process.Modules)
                        {
                            exc = mod.Language.LookupType(cp.ExceptionName);
                            if (exc != null)
                            {
                                break;
                            }
                        }
                    }
                    if (exc != null)
                    {
                        ev = session.InsertExceptionCatchPoint(process.MainThread, ThreadGroup.Global, exc);
                    }
                    else
                    {
                        pendingCatchpoints.Add(cp);
                        return(-1);
                    }
                }
            }

            ev.IsEnabled = enable;

            if (!initializing)
            {
                lock (debugger) {
                    mdbAdaptor.ActivateEvent(ev);
                }
            }

            if (bp != null && !running && !initializing && activeThread.CurrentFrame != null && !string.IsNullOrEmpty(bp.ConditionExpression) && bp.BreakIfConditionChanges)
            {
                // Initial expression evaluation
                MdbEvaluationContext ctx = new MdbEvaluationContext(activeThread, activeThread.CurrentFrame, null, SessionOptions.EvaluationOptions);
                ML.TargetObject      ob  = EvaluateExp(ctx, bp.ConditionExpression);
                if (ob != null)
                {
                    lastConditionValue [ev.Index] = evaluator.TargetObjectToExpression(ctx, ob).Value;
                }
            }

            events [ev.Index] = be;
            return(ev.Index);
        }
示例#18
0
 public void ActivateEventAsync(Event handle)
 {
     ActivateOrDeactivateEventAsync (handle, true);
 }