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);
        }
コード例 #2
0
 protected override unsafe int OnExceptionUnwind(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugExceptionUnwindCallbackType dwEventType,
     uint dwFlags)
 {
     ExceptionUnwind?.Invoke(this, pAppDomain, pThread, dwEventType, dwFlags);
     return(Continue());
 }
コード例 #3
0
 protected override unsafe int OnEditAndContinueRemap(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugFunction pFunction,
     bool fAccurate)
 {
     EditAndContinueRemap?.Invoke(this, pAppDomain, pThread, pFunction, fAccurate);
     return(Continue());
 }
コード例 #4
0
 protected override unsafe int OnBreakpointSetError(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugBreakpoint pBreakpoint,
     uint dwError)
 {
     BreakpointSetError?.Invoke(this, pAppDomain, pThread, pBreakpoint, dwError);
     return(Continue());
 }
コード例 #5
0
 protected override unsafe int OnStepComplete(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugStepper pStepper,
     CorDebugStepReason reason)
 {
     StepComplete?.Invoke(this, pAppDomain, pThread, pStepper, reason);
     return(Continue());
 }
コード例 #6
0
        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);
        }
コード例 #7
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());
 }
コード例 #8
0
        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);
        }
コード例 #9
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());
        }
コード例 #10
0
        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());
        }
コード例 #11
0
        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());
        }
コード例 #12
0
 protected abstract int OnEvalException(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugEval pEval);
コード例 #13
0
 protected abstract int OnEvalComplete(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugEval pEval);
コード例 #14
0
 protected abstract int OnBreakpointSetError(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugBreakpoint pBreakpoint,
     uint dwError);
コード例 #15
0
 protected abstract int OnUpdateModuleSymbols(
     CorDebugAppDomain pAppDomain,
     CorDebugModule pModule,
     IntPtr pSymbolStream);
コード例 #16
0
 protected abstract int OnUnloadAssembly(CorDebugAppDomain pAppDomain, CorDebugAssembly pAssembly);
コード例 #17
0
 protected abstract int OnUnloadClass(CorDebugAppDomain pAppDomain, CorDebugClass c);
コード例 #18
0
 protected abstract int OnExitThread(CorDebugAppDomain pAppDomain, CorDebugThread thread);
コード例 #19
0
 protected abstract int OnUnloadModule(CorDebugAppDomain pAppDomain, CorDebugModule pModule);
コード例 #20
0
 protected abstract int OnBreakpoint(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugBreakpoint pBreakpoint);
コード例 #21
0
 protected abstract int OnLogMessage(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     int lLevel,
     ReadOnlySpan <char> pLogSwitchName,
     ReadOnlySpan <char> pMessage);
コード例 #22
0
 protected abstract int OnStepComplete(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugStepper pStepper,
     CorDebugStepReason reason);
コード例 #23
0
 protected abstract int OnExitAppDomain(CorDebugProcess pProcess, CorDebugAppDomain pAppDomain);
コード例 #24
0
 protected abstract int OnExceptionUnwind(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugExceptionUnwindCallbackType dwEventType,
     uint dwFlags);
コード例 #25
0
 protected abstract int OnNameChange(CorDebugAppDomain pAppDomain, CorDebugThread pThread);
コード例 #26
0
 protected abstract int OnFunctionRemapComplete(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugFunction pFunction);
コード例 #27
0
 protected abstract int OnEditAndContinueRemap(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugFunction pFunction,
     bool fAccurate);
コード例 #28
0
 protected abstract int OnBreak(CorDebugAppDomain pAppDomain, CorDebugThread thread);
コード例 #29
0
 protected abstract int OnFunctionRemapOpportunity(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugFunction pOldFunction,
     CorDebugFunction pNewFunction,
     uint oldILOffset);
コード例 #30
0
 protected abstract int OnException(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     bool unhandled);