本文整理汇总了C#中dndbg.Engine.DnDebugger类的典型用法代码示例。如果您正苦于以下问题:C# DnDebugger类的具体用法?C# DnDebugger怎么用?C# DnDebugger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DnDebugger类属于dndbg.Engine命名空间,在下文中一共展示了DnDebugger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DnDebugger_DebugCallbackEvent
void DnDebugger_DebugCallbackEvent(DnDebugger dbg, DebugCallbackEventArgs e) {
if (e.Type == DebugCallbackType.CreateProcess) {
dbg.DebugCallbackEvent -= DnDebugger_DebugCallbackEvent;
var cpArgs = (CreateProcessDebugCallbackEventArgs)e;
bool b = Initialize(cpArgs.CorProcess, dbg.DebuggeeVersion);
Debug.Assert(b);
}
}
示例2: InstallDebuggerHooks
void InstallDebuggerHooks(DnDebugger dbg) {
dbg.OnModuleAdded += DnDebugger_OnModuleAdded;
dbg.OnNameChanged += DnDebugger_OnNameChanged;
var modules = GetAllModules(dbg).ToArray();
Array.Sort(modules, (a, b) => a.ModuleOrder.CompareTo(b.ModuleOrder));
foreach (var module in modules)
Add(module);
}
示例3: BreakProcessHelper
public BreakProcessHelper(DnDebugger debugger, BreakProcessKind type, string filename) {
if (debugger == null)
throw new ArgumentNullException();
this.debugger = debugger;
this.type = type;
this.filename = filename;
AddStartupBreakpoint();
}
示例4: DnProcess
internal DnProcess(DnDebugger ownerDebugger, ICorDebugProcess process, int incrementedId)
{
this.ownerDebugger = ownerDebugger;
this.appDomains = new DebuggerCollection<ICorDebugAppDomain, DnAppDomain>(CreateAppDomain);
this.threads = new DebuggerCollection<ICorDebugThread, DnThread>(CreateThread);
this.process = new CorProcess(process);
this.incrementedId = incrementedId;
}
示例5: Initialize
public void Initialize(DnDebugger dbg) {
Debug.Assert(debugger.Dispatcher.CheckAccess());
Debug.Assert(dbgBreakpoint == null);
if (dbgBreakpoint != null)
throw new InvalidOperationException();
dbgBreakpoint = dbg.CreateBreakpoint(EventKind.ToDebugEventBreakpointKind(), HitHandler);
dbgBreakpoint.IsEnabled = isEnabled;
dbgBreakpoint.Tag = this;
}
示例6: DnDebugger_DebugCallbackEvent
void DnDebugger_DebugCallbackEvent(DnDebugger dbg, DebugCallbackEventArgs e) {
if (nameErrorCounter != 0 && e.Type == DebugCallbackType.LoadClass) {
var lcArgs = (LoadClassDebugCallbackEventArgs)e;
var module = dbg.TryGetModule(lcArgs.CorAppDomain, lcArgs.CorClass);
Debug.Assert(module != null);
if (module != null && module.IsDynamic)
pendingModules.Add(module.SerializedDnModule);
}
}
示例7: GetAllModules
static IEnumerable<DnModule> GetAllModules(DnDebugger dbg) {
foreach (var process in dbg.Processes) {
foreach (var appDomain in process.AppDomains) {
foreach (var assembly in appDomain.Assemblies) {
foreach (var module in assembly.Modules)
yield return module;
}
}
}
}
示例8: DnDebugger_DebugCallbackEvent
void DnDebugger_DebugCallbackEvent(DnDebugger dbg, DebugCallbackEventArgs e)
{
try {
DebugCallbackEvent_counter++;
if (DebugCallbackEvent_counter > 1)
return;
if (e.Type == DebugCallbackType.Exception2) {
var ee = (Exception2DebugCallbackEventArgs)e;
if (ee.EventType == CorDebugExceptionCallbackType.DEBUG_EXCEPTION_UNHANDLED)
UnhandledException(ee);
}
else if (e.Type == DebugCallbackType.DebuggerError)
OnDebuggerError((DebuggerErrorDebugCallbackEventArgs)e);
}
finally {
DebugCallbackEvent_counter--;
}
}
示例9: Initialize
public static void Initialize(DnDebugger debugger) {
new DisableSystemDebuggerDetection(debugger);
}
示例10: AddDebugger
void AddDebugger(DnDebugger newDebugger)
{
RemoveDebugger();
debugger = newDebugger;
DebugCallbackEvent_counter = 0;
newDebugger.OnProcessStateChanged += DnDebugger_OnProcessStateChanged;
newDebugger.DebugCallbackEvent += DnDebugger_DebugCallbackEvent;
}
示例11: CallOnProcessStateChanged
void CallOnProcessStateChanged(DnDebugger dbg = null)
{
CallOnProcessStateChanged(dbg ?? debugger, DebuggerEventArgs.Empty);
}
示例12: Debugger_DebugCallbackEvent
void Debugger_DebugCallbackEvent(DnDebugger dbg, DebugCallbackEventArgs e)
{
var ee = e as EvalDebugCallbackEventArgs;
if (ee == null)
return;
if (ee.Eval == eval.RawObject) {
debugger.DebugCallbackEvent -= Debugger_DebugCallbackEvent;
e.AddStopReason(DebuggerStopReason.Eval);
debugMessageDispatcher.CancelDispatchQueue(ee.WasException);
return;
}
}
示例13: CreateMethodKey
static MethodKey? CreateMethodKey(DnDebugger debugger, CorFrame frame)
{
var sma = frame.GetSerializedDnModuleWithAssembly();
if (sma == null)
return null;
return MethodKey.Create(frame.Token, sma.Value.Module);
}
示例14: CreateDnDebuggerCoreCLR
static DnDebugger CreateDnDebuggerCoreCLR(DebugProcessOptions options)
{
var clrType = (CoreCLRTypeDebugInfo)options.CLRTypeDebugInfo;
var dbg2 = CoreCLRHelper.CreateDnDebugger(options, clrType, () => false, (cd, pid) => {
var dbg = new DnDebugger(cd, options.DebugOptions, options.DebugMessageDispatcher, null);
if (options.BreakProcessType != BreakProcessType.None)
new BreakProcessHelper(dbg, options.BreakProcessType, options.Filename);
ICorDebugProcess comProcess;
cd.DebugActiveProcess((int)pid, 0, out comProcess);
var dnProcess = dbg.TryAdd(comProcess);
if (dnProcess != null)
dnProcess.Initialize(false, options.Filename, options.CurrentDirectory, options.CommandLine);
return dbg;
});
if (dbg2 == null)
throw new Exception("Could not create a debugger instance");
return dbg2;
}
示例15: DnDebugger_DebugCallbackEvent
void DnDebugger_DebugCallbackEvent(DnDebugger dbg, DebugCallbackEventArgs e)
{
if (e.Type == DebugCallbackType.Exception2)
OnException((Exception2DebugCallbackEventArgs)e);
}