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
ファイル: Command.cs プロジェクト: baulig/debugger
 protected override void Action(ScriptingContext context, Event handle)
 {
     handle.IsEnabled = true;
 }
コード例 #5
0
ファイル: Command.cs プロジェクト: baulig/debugger
 protected override void Action(ScriptingContext context, Event handle)
 {
     context.Interpreter.Session.RemoveEvent (handle);
 }
コード例 #6
0
ファイル: Command.cs プロジェクト: baulig/debugger
 protected override void Action(ScriptingContext context, Event handle)
 {
     if (handle.IsActivated && handle.NeedsActivation)
         handle.Deactivate (context.Interpreter.CurrentThread);
 }
コード例 #7
0
ファイル: Command.cs プロジェクト: baulig/debugger
        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
ファイル: Command.cs プロジェクト: baulig/debugger
 protected abstract void Action(ScriptingContext context, Event handle);
コード例 #9
0
ファイル: DebuggerSession.cs プロジェクト: baulig/debugger
        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
ファイル: DebuggerSession.cs プロジェクト: baulig/debugger
        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
ファイル: DebuggerSession.cs プロジェクト: baulig/debugger
 public void DeleteEvent(Event handle)
 {
     RemoveEvent (handle);
 }
コード例 #15
0
ファイル: DebuggerSession.cs プロジェクト: baulig/debugger
 public void DeactivateEventAsync(Event handle)
 {
     ActivateOrDeactivateEventAsync (handle, false);
 }
コード例 #16
0
ファイル: DebuggerSession.cs プロジェクト: baulig/debugger
        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
ファイル: DebuggerSession.cs プロジェクト: baulig/debugger
 public void ActivateEventAsync(Event handle)
 {
     ActivateOrDeactivateEventAsync (handle, true);
 }