int ICorDebugManagedCallback.LoadAssembly(CorDebugAppDomain pAppDomain, CorDebugAssembly pAssembly) { assemblies.Add(pAssembly); //CorMetadataImport mi = new CorMetadataImport(pAssembly); //Seems like this is always set on MicroFramework //pAssembly. JITCompilerFlags = CorDebugJITCompilerFlags.CORDEBUG_JIT_DISABLE_OPTIMIZATION; List <string> docPaths = new List <string>(); if (pAssembly.DebugData != null) { var md = pAssembly.MetaData; var reader = pAssembly.DebugData; if (!pAssembly.IsFrameworkAssembly) { foreach (var module in md.Assembly.Modules) { foreach (var t in module.Types) { foreach (var m in t.Methods) { var methodSymbols = m.DebugInformation; if (!methodSymbols.HasSequencePoints) { continue; } DocInfo document; if (!documents.TryGetValue(methodSymbols.SequencePoints[0].Document.Url, out document)) { document = new DocInfo(methodSymbols.SequencePoints[0].Document.Url); document.Assembly = pAssembly; documents.Add(document.Url, document); } document.AddMethod(m, methodSymbols); if (!docPaths.Contains(document.Url)) { docPaths.Add(document.Url); } } } } } pAssembly.SetJmcStatus(true); } else { // Flag modules without debug info as not JMC. In this way // the debugger won't try to step into them pAssembly.SetJmcStatus(false); } foreach (var docPath in docPaths) { BindSourceFileBreakpoints(docPath); } pAppDomain.Process.Continue(); return(0); }
protected override unsafe int OnExceptionUnwind( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags) { ExceptionUnwind?.Invoke(this, pAppDomain, pThread, dwEventType, dwFlags); return(Continue()); }
protected override unsafe int OnEditAndContinueRemap( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugFunction pFunction, bool fAccurate) { EditAndContinueRemap?.Invoke(this, pAppDomain, pThread, pFunction, fAccurate); return(Continue()); }
protected override unsafe int OnBreakpointSetError( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugBreakpoint pBreakpoint, uint dwError) { BreakpointSetError?.Invoke(this, pAppDomain, pThread, pBreakpoint, dwError); return(Continue()); }
protected override unsafe int OnStepComplete( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugStepper pStepper, CorDebugStepReason reason) { StepComplete?.Invoke(this, pAppDomain, pThread, pStepper, reason); return(Continue()); }
int ICorDebugManagedCallback.Breakpoint(CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugBreakpointBase pBreakpoint) { TargetEventArgs args = new TargetEventArgs(TargetEventType.TargetStopped); args.Process = GetProcess(pAppDomain.Process); args.Thread = pAppDomain.Process.GetThread(pThread); args.Backtrace = new Backtrace(new CorDebugBacktrace(pThread, this)); OnTargetEvent(args); SetActiveThread(pThread); return(0); }
protected override unsafe int OnException2( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType dwEventType, uint dwFlags) { Exception2?.Invoke(this, pAppDomain, pThread, pFrame, nOffset, dwEventType, dwFlags); return(Continue()); }
int ICorDebugManagedCallback.StepComplete(CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugStepper pStepper, CorDebugStepReason reason) { TargetEventArgs args = new TargetEventArgs(TargetEventType.TargetStopped); args.Process = GetProcess(pAppDomain.Process); args.Thread = pAppDomain.Process.GetThread(pThread); args.Backtrace = new Backtrace(new CorDebugBacktrace(pThread, this)); OnTargetEvent(args); SetActiveThread(pThread); return(0); }
protected override unsafe int OnFunctionRemapOpportunity( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugFunction pOldFunction, CorDebugFunction pNewFunction, uint oldILOffset) { FunctionRemapOpportunity?.Invoke( this, pAppDomain, pThread, pOldFunction, pNewFunction, oldILOffset); return(Continue()); }
protected override unsafe int OnLogMessage( CorDebugAppDomain pAppDomain, CorDebugThread pThread, int lLevel, ReadOnlySpan <char> pLogSwitchName, ReadOnlySpan <char> pMessage) { LogMessage?.Invoke( this, pAppDomain, pThread, lLevel, pLogSwitchName, pMessage); return(Continue()); }
protected override unsafe int OnLogSwitch( CorDebugAppDomain pAppDomain, CorDebugThread pThread, int lLevel, uint ulReason, ReadOnlySpan <char> pLogSwitchName, ReadOnlySpan <char> pParentName) { LogSwitch?.Invoke( this, pAppDomain, pThread, lLevel, ulReason, pLogSwitchName, pParentName); return(Continue()); }
protected abstract int OnEvalException( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugEval pEval);
protected abstract int OnEvalComplete( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugEval pEval);
protected abstract int OnBreakpointSetError( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugBreakpoint pBreakpoint, uint dwError);
protected abstract int OnUpdateModuleSymbols( CorDebugAppDomain pAppDomain, CorDebugModule pModule, IntPtr pSymbolStream);
protected abstract int OnUnloadAssembly(CorDebugAppDomain pAppDomain, CorDebugAssembly pAssembly);
protected abstract int OnUnloadClass(CorDebugAppDomain pAppDomain, CorDebugClass c);
protected abstract int OnExitThread(CorDebugAppDomain pAppDomain, CorDebugThread thread);
protected abstract int OnUnloadModule(CorDebugAppDomain pAppDomain, CorDebugModule pModule);
protected abstract int OnBreakpoint( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugBreakpoint pBreakpoint);
protected abstract int OnLogMessage( CorDebugAppDomain pAppDomain, CorDebugThread pThread, int lLevel, ReadOnlySpan <char> pLogSwitchName, ReadOnlySpan <char> pMessage);
protected abstract int OnStepComplete( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugStepper pStepper, CorDebugStepReason reason);
protected abstract int OnExitAppDomain(CorDebugProcess pProcess, CorDebugAppDomain pAppDomain);
protected abstract int OnExceptionUnwind( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags);
protected abstract int OnNameChange(CorDebugAppDomain pAppDomain, CorDebugThread pThread);
protected abstract int OnFunctionRemapComplete( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugFunction pFunction);
protected abstract int OnEditAndContinueRemap( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugFunction pFunction, bool fAccurate);
protected abstract int OnBreak(CorDebugAppDomain pAppDomain, CorDebugThread thread);
protected abstract int OnFunctionRemapOpportunity( CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugFunction pOldFunction, CorDebugFunction pNewFunction, uint oldILOffset);
protected abstract int OnException( CorDebugAppDomain pAppDomain, CorDebugThread pThread, bool unhandled);