Exemplo n.º 1
0
 private void InitCallbacks()
 {
     m_callbacksArray = new Dictionary <ManagedCallbackType, DebugEventHandler <CorEventArgs> > {
         { ManagedCallbackType.OnBreakpoint, (sender, args) => OnBreakpoint?.Invoke(sender, (BreakpointEventArgs)args) },
         { ManagedCallbackType.OnStepComplete, (sender, args) => OnStepComplete?.Invoke(sender, (StepCompleteEventArgs)args) },
         { ManagedCallbackType.OnBreak, (sender, args) => OnBreak?.Invoke(sender, (ThreadEventArgs)args) },
         { ManagedCallbackType.OnException, (sender, args) => OnException?.Invoke(sender, (ExceptionEventArgs)args) },
         { ManagedCallbackType.OnEvalComplete, (sender, args) => OnEvalComplete?.Invoke(sender, (EvalEventArgs)args) },
         { ManagedCallbackType.OnEvalException, (sender, args) => OnEvalException?.Invoke(sender, (EvalEventArgs)args) },
         { ManagedCallbackType.OnCreateProcess, (sender, args) => OnCreateProcess?.Invoke(sender, (ProcessEventArgs)args) },
         { ManagedCallbackType.OnProcessExit, (sender, args) => OnProcessExit?.Invoke(sender, (ProcessEventArgs)args) },
         { ManagedCallbackType.OnCreateThread, (sender, args) => OnCreateThread?.Invoke(sender, (ThreadEventArgs)args) },
         { ManagedCallbackType.OnThreadExit, (sender, args) => OnThreadExit?.Invoke(sender, (ThreadEventArgs)args) },
         { ManagedCallbackType.OnModuleLoad, (sender, args) => OnModuleLoad?.Invoke(sender, (ModuleEventArgs)args) },
         { ManagedCallbackType.OnModuleUnload, (sender, args) => OnModuleUnload?.Invoke(sender, (ModuleEventArgs)args) },
         { ManagedCallbackType.OnClassLoad, (sender, args) => OnClassLoad?.Invoke(sender, (ClassEventArgs)args) },
         { ManagedCallbackType.OnClassUnload, (sender, args) => OnClassUnload?.Invoke(sender, (ClassEventArgs)args) },
         { ManagedCallbackType.OnDebuggerError, (sender, args) => OnDebuggerError?.Invoke(sender, (DebuggerErrorEventArgs)args) },
         { ManagedCallbackType.OnLogMessage, (sender, args) => OnLogMessage?.Invoke(sender, (LogMessageEventArgs)args) },
         { ManagedCallbackType.OnLogSwitch, (sender, args) => OnLogSwitch?.Invoke(sender, (LogSwitchEventArgs)args) },
         { ManagedCallbackType.OnCreateAppDomain, (sender, args) => OnCreateAppDomain?.Invoke(sender, (AppDomainEventArgs)args) },
         { ManagedCallbackType.OnAppDomainExit, (sender, args) => OnAppDomainExit?.Invoke(sender, (AppDomainEventArgs)args) },
         { ManagedCallbackType.OnAssemblyLoad, (sender, args) => OnAssemblyLoad?.Invoke(sender, (AssemblyEventArgs)args) },
         { ManagedCallbackType.OnAssemblyUnload, (sender, args) => OnAssemblyUnload?.Invoke(sender, (AssemblyEventArgs)args) },
         { ManagedCallbackType.OnControlCTrap, (sender, args) => OnControlCTrap?.Invoke(sender, (ProcessEventArgs)args) },
         { ManagedCallbackType.OnNameChange, (sender, args) => OnNameChange?.Invoke(sender, (ThreadEventArgs)args) },
         { ManagedCallbackType.OnUpdateModuleSymbols, (sender, args) => OnUpdateModuleSymbols?.Invoke(sender, (UpdateModuleSymbolsEventArgs)args) },
         { ManagedCallbackType.OnFunctionRemapOpportunity, (sender, args) => OnFunctionRemapOpportunity?.Invoke(sender, (FunctionRemapOpportunityEventArgs)args) },
         { ManagedCallbackType.OnFunctionRemapComplete, (sender, args) => OnFunctionRemapComplete?.Invoke(sender, (FunctionRemapCompleteEventArgs)args) },
         { ManagedCallbackType.OnBreakpointSetError, (sender, args) => OnBreakpointSetError?.Invoke(sender, (BreakpointEventArgs)args) },
         { ManagedCallbackType.OnException2, (sender, args) => OnException2?.Invoke(sender, (Exception2EventArgs)args) },
         { ManagedCallbackType.OnExceptionUnwind2, (sender, args) => OnExceptionUnwind2?.Invoke(sender, (ExceptionUnwind2EventArgs)args) },
         { ManagedCallbackType.OnMDANotification, (sender, args) => OnMDANotification?.Invoke(sender, (MDAEventArgs)args) },
         { ManagedCallbackType.OnExceptionInCallback, (sender, args) => OnExceptionInCallback?.Invoke(sender, (ExceptionInCallbackEventArgs)args) },
     };
 }
Exemplo n.º 2
0
 public bool CreateProcess(string application, string command)
 {
     return(OnCreateProcess?.Invoke(application, command) ?? true);
 }