public void Break(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread) { EnterCallback(PausedReason.Break, "Break", pThread); pauseOnNextExit = true; ExitCallback(); }
public CorDebugThread(ICorDebugThread _thread) { m_corThread = _thread; uint id; m_corThread.GetID(out id); ID = id; }
// Do not pass the pBreakpoint parameter as ICorDebugBreakpoint - marshaling of it fails in .NET 1.1 public void Breakpoint(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, IntPtr pBreakpoint) { ManagedCallback managedCallback = GetProcessCallbackInterface(pAppDomain); if (managedCallback != null) { managedCallback.Breakpoint(pAppDomain, pThread, pBreakpoint); } }
public virtual void Breakpoint( ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugBreakpoint breakpoint) { this.DefaultHandler(appDomain); }
public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) { ManagedCallback managedCallback = GetProcessCallbackInterface(pAppDomain); if (managedCallback != null) { managedCallback.StepComplete(pAppDomain, pThread, pStepper, reason); } }
public void Breakpoint( ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint) { m_listner.PostBreakPoint(new CorThread(pThread)); //controller.Continue(0); }
public virtual void EditAndContinueRemap( ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugFunction function, bool accurate) { this.DefaultHandler(appDomain); }
public void Breakpoint(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint) { var handler = OnBreakpoint; if (handler != null) { handler(this, new DebuggerBreakpointEventArgs(pThread, pBreakpoint)); } pAppDomain.Continue(0); }
internal void AddThread(ICorDebugThread corThread) { Thread thread = new Thread(this, corThread); threadCollection.Add(thread); OnThreadStarted(thread); thread.NativeThreadExited += delegate { threadCollection.Remove(thread); }; }
internal Thread GetThread(ICorDebugThread corThread) { foreach(Thread thread in threadCollection) { if (thread.CorThread == corThread) { return thread; } } throw new DebuggerException("Thread is not in collection"); }
private void HandleEvalEvent(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval pEval) { var domain = GetProcessWrapper(pAppDomain).GetAppDomain(pAppDomain); var thread = domain.GetThread(pThread); var eval = Session.ComInstanceCollector.GetWrapper<RuntimeEvaluation>(pEval); var eventArgs = new DebuggerEventArgs(domain, true); eval.DispatchEvaluationCompleted(eventArgs); FinalizeEvent(eventArgs); }
public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugThread pThread) { ICorDebugProcess pProcess; try { pProcess = pThread.Process; } catch (COMException e) { debugger.TraceMessage("Ignoring callback \"" + name + "\": " + e.Message); return null; } return GetProcessCallbackInterface(name, pProcess); }
// // IEnumerator interface // #region IEnumerator Members public bool MoveNext() { var a = new ICorDebugThread[1]; uint c = 0; int r = m_enum.Next((uint) a.Length, a, out c); if (r == 0 && c == 1) // S_OK && we got 1 new element m_th = new CorThread(a[0]); else m_th = null; return m_th != null; }
/// <summary> /// Finds appropriete SequncePointMap instances and builds SequencePointRemapper, gets new IL offset and call RemapFunction. /// </summary> public void FunctionRemapOpportunity(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pOldFunction, ICorDebugFunction pNewFunction, uint oldILOffset) { ICorDebugILFrame2 frame = (ICorDebugILFrame2) pThread.GetActiveFrame(); uint nToken = pOldFunction.GetToken(); SequencePointRemapper remapper; if(!remappers.TryGetValue(nToken,out remapper)){ throw new KeyNotFoundException("Methods sequence points not found."); } frame.__RemapFunction(remapper.TranslateILOffset(oldILOffset)); }
// Warning! Marshaing of ICorBreakpoint fails in .NET 1.1 public void Breakpoint(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint corBreakpoint) { EnterCallback(PausedReason.Breakpoint, "Breakpoint", pThread); Breakpoint breakpoint = process.Debugger.Breakpoints[corBreakpoint]; // The event will be risen outside the callback process.BreakpointHitEventQueue.Enqueue(breakpoint); pauseOnNextExit = true; ExitCallback(); }
public virtual void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA) { pController.Continue(0); }
public virtual void LogMessage(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int lLevel, string pLogSwitchName, string pMessage) { pAppDomain.Continue(0); }
public virtual void NameChange(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread) { pAppDomain.Continue(0); }
public virtual void EditAndContinueRemap(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction, int fAccurate) { pAppDomain.Continue(0); }
void ICorDebugManagedCallback2.ExceptionUnwind(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags) { var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }
void ICorDebugManagedCallback.BreakpointSetError(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint, uint dwError) { var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }
void ICorDebugManagedCallback.CreateThread(ICorDebugAppDomain pAppDomain, ICorDebugThread thread) { var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }
public virtual void ExceptionUnwind(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags) { pAppDomain.Continue(0); }
public virtual void EvalException(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval pEval) { pAppDomain.Continue(0); }
public virtual void EvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval pEval) { pAppDomain.Continue(0); }
public virtual void Exception(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int unhandled) { pAppDomain.Continue(0); }
public virtual void Break(ICorDebugAppDomain pAppDomain, ICorDebugThread thread) { pAppDomain.Continue(0); }
public virtual void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) { pAppDomain.Continue(0); }
public virtual void Breakpoint(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint) { pAppDomain.Continue(0); }
public virtual void BreakpointSetError(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint, uint dwError) { pAppDomain.Continue(0); }
void ICorDebugManagedCallback.EvalException(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval pEval) { var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }
void ICorDebugManagedCallback.StepComplete(ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugStepper stepper, CorDebugStepReason stepReason) { HandleEvent(ManagedCallbackType.OnStepComplete, new CorStepCompleteEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), stepper == null ? null : new CorStepper(stepper), stepReason, ManagedCallbackType.OnStepComplete)); }
void ICorDebugManagedCallback.EditAndContinueRemap(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction, int fAccurate) { // TODO HandleEvent(ManagedCallbackType.On new CorEventArgs(new CorAppDomain(pAppDomain))); }
void ICorDebugManagedCallback.EvalException( ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugEval eval) { HandleEvent(ManagedCallbackType.OnEvalException, new CorEvalEventArgs( appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), eval == null ? null : new CorEval(eval), ManagedCallbackType.OnEvalException)); }
void ICorDebugManagedCallback2.FunctionRemapOpportunity(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pOldFunction, ICorDebugFunction pNewFunction, uint oldILOffset) { var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }
void ICorDebugManagedCallback.LogMessage( ICorDebugAppDomain appDomain, ICorDebugThread thread, int level, string logSwitchName, string message) { HandleEvent(ManagedCallbackType.OnLogMessage, new CorLogMessageEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), level, logSwitchName, message, ManagedCallbackType.OnLogMessage)); }
void ICorDebugManagedCallback2.FunctionRemapComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction) { // TODO HandleEvent(<new CorEventArgs(new CorAppDomain(pAppDomain))); }
void ICorDebugManagedCallback.NameChange( ICorDebugAppDomain appDomain, ICorDebugThread thread) { HandleEvent(ManagedCallbackType.OnNameChange, new CorThreadEventArgs( appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), ManagedCallbackType.OnNameChange)); }
void ICorDebugManagedCallback.BreakpointSetError( ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugBreakpoint breakpoint, UInt32 errorCode) { HandleEvent(ManagedCallbackType.OnBreakpointSetError, new CorBreakpointSetErrorEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), null, (int)errorCode, ManagedCallbackType.OnBreakpointSetError)); }
void ICorDebugManagedCallback2.FunctionRemapComplete(ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugFunction managedFunction) { HandleEvent(ManagedCallbackType.OnFunctionRemapComplete, new CorFunctionRemapCompleteEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), managedFunction == null ? null : new CorFunction(managedFunction), ManagedCallbackType.OnFunctionRemapComplete)); }
public virtual void LogSwitch(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int lLevel, uint ulReason, string pLogSwitchName, string pParentName) { pAppDomain.Continue(0); }
void ICorDebugManagedCallback2.ExceptionUnwind(ICorDebugAppDomain ad, ICorDebugThread thread, CorDebugExceptionUnwindCallbackType eventType, uint flags) { HandleEvent(ManagedCallbackType.OnExceptionUnwind2, new CorExceptionUnwind2EventArgs(ad == null ? null : new CorAppDomain(ad), thread == null ? null : new CorThread(thread), eventType, (int)flags, ManagedCallbackType.OnExceptionUnwind2)); }
internal DnThread(DnProcess ownerProcess, ICorDebugThread thread, int incrementedId) { this.ownerProcess = ownerProcess; this.thread = new CorThread(thread); this.incrementedId = incrementedId; }
public virtual void FunctionRemapComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction) { pAppDomain.Continue(0); }
void ICorDebugManagedCallback.Breakpoint(ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugBreakpoint breakpoint) { HandleEvent(ManagedCallbackType.OnBreakpoint, new CorBreakpointEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), breakpoint == null ? null : new CorFunctionBreakpoint((ICorDebugFunctionBreakpoint)breakpoint), ManagedCallbackType.OnBreakpoint )); }
public void BreakpointSetError(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint, uint dwError) { EnterCallback(PausedReason.Other, "BreakpointSetError", pThread); ExitCallback(); }
void ICorDebugManagedCallback.Exception( ICorDebugAppDomain appDomain, ICorDebugThread thread, int unhandled) { HandleEvent(ManagedCallbackType.OnException, new CorExceptionEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), !(unhandled == 0), ManagedCallbackType.OnException)); }
public void LogSwitch(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int lLevel, uint ulReason, string pLogSwitchName, string pParentName) { EnterCallback(PausedReason.Other, "LogSwitch", pThread); ExitCallback(); }
void ICorDebugManagedCallback.ExitThread( ICorDebugAppDomain appDomain, ICorDebugThread thread) { HandleEvent(ManagedCallbackType.OnThreadExit, new CorThreadEventArgs( appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), ManagedCallbackType.OnThreadExit)); }
public void EditAndContinueRemap(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction, int fAccurate) { EnterCallback(PausedReason.Other, "EditAndContinueRemap", pThread); ExitCallback(); }
void ICorDebugManagedCallback.LogSwitch( ICorDebugAppDomain appDomain, ICorDebugThread thread, int level, uint reason, string logSwitchName, string parentName) { HandleEvent(ManagedCallbackType.OnLogSwitch, new CorLogSwitchEventArgs( appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), level, (int)reason, logSwitchName, parentName, ManagedCallbackType.OnLogSwitch)); }
public void EvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval) { EnterCallback(PausedReason.EvalComplete, "EvalComplete", pThread); HandleEvalComplete(pAppDomain, pThread, corEval, false); }
void ICorDebugManagedCallback.EditAndContinueRemap( ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugFunction managedFunction, int isAccurate) { Debug.Assert(false); //OBSOLETE callback }
public void FunctionRemapComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction) { EnterCallback(PausedReason.Other, "FunctionRemapComplete", pThread); ExitCallback(); }
void ICorDebugManagedCallback2.FunctionRemapOpportunity(ICorDebugAppDomain appDomain, ICorDebugThread thread, ICorDebugFunction oldFunction, ICorDebugFunction newFunction, uint oldILoffset) { HandleEvent(ManagedCallbackType.OnFunctionRemapOpportunity, new CorFunctionRemapOpportunityEventArgs(appDomain == null ? null : new CorAppDomain(appDomain), thread == null ? null : new CorThread(thread), oldFunction == null ? null : new CorFunction(oldFunction), newFunction == null ? null : new CorFunction(newFunction), (int)oldILoffset, ManagedCallbackType.OnFunctionRemapOpportunity)); }
public void FunctionRemapOpportunity(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pOldFunction, ICorDebugFunction pNewFunction, uint oldILOffset) { EnterCallback(PausedReason.Other, "FunctionRemapOpportunity", pThread); ExitCallback(); }
void ICorDebugManagedCallback2.Exception(ICorDebugAppDomain ad, ICorDebugThread thread, ICorDebugFrame frame, uint offset, CorDebugExceptionCallbackType eventType, uint flags) { HandleEvent(ManagedCallbackType.OnException2, new CorException2EventArgs(ad == null ? null : new CorAppDomain(ad), thread == null ? null : new CorThread(thread), frame == null ? null : new CorFrame(frame), (int)offset, eventType, (int)flags, ManagedCallbackType.OnException2)); }
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread) { EnterCallback(pausedReason, name, pThread.GetProcess()); process.SelectedThread = process.GetThread(pThread); }
void ICorDebugManagedCallback2.MDANotification(ICorDebugController pController, ICorDebugThread thread, ICorDebugMDA pMDA) { CorMDA c = new CorMDA(pMDA); string szName = c.Name; CorDebugMDAFlags f = c.Flags; CorProcess p = GetProcessFromController(pController); HandleEvent(ManagedCallbackType.OnMDANotification, new CorMDAEventArgs(c, thread == null ? null : new CorThread(thread), p, ManagedCallbackType.OnMDANotification)); }
void ICorDebugManagedCallback.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) { var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }