本文整理汇总了C#中ICorDebugProcess类的典型用法代码示例。如果您正苦于以下问题:C# ICorDebugProcess类的具体用法?C# ICorDebugProcess怎么用?C# ICorDebugProcess使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICorDebugProcess类属于命名空间,在下文中一共展示了ICorDebugProcess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProcessCallbackInterface
public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugProcess pProcess)
{
Process process;
// We have to wait until the created process is added into the collection
lock(debugger.ProcessIsBeingCreatedLock) {
process = debugger.GetProcess(pProcess);
}
// Make *really* sure the process is not dead
if (process == null) {
debugger.TraceMessage("Ignoring callback \"" + name + "\": Process not found");
return null;
}
if (process.HasExited) {
debugger.TraceMessage("Ignoring callback \"" + name + "\": Process has exited");
return null;
}
if (process.TerminateCommandIssued && !(name == "ExitProcess")) {
debugger.TraceMessage("Ignoring callback \"" + name + "\": Terminate command was issued for the process");
return null;
}
// Check that the process is not exited
try {
int isRunning = process.CorProcess.IsRunning();
} catch (COMException e) {
process.TraceMessage("Ignoring callback \"" + name + "\": " + e.Message);
return null;
}
return process.CallbackInterface;
}
示例2: EnterCallback
void EnterCallback(PausedReason pausedReason, string name, ICorDebugProcess pProcess)
{
isInCallback = true;
process.TraceMessage("Callback: " + name);
System.Diagnostics.Debug.Assert(process.CorProcess == pProcess);
// After break is pressed we may receive some messages that were already queued
if (process.IsPaused && process.PauseSession.PausedReason == PausedReason.ForcedBreak) {
// TODO: This does not work well if exception if being processed and the user continues it
process.TraceMessage("Processing post-break callback");
// This compensates for the break call and we are in normal callback handling mode
process.AsyncContinue(DebuggeeStateAction.Keep, new Thread[] {}, null);
// Start of call back - create new pause session (as usual)
process.NotifyPaused(pausedReason);
// Make sure we stay pause after the callback is handled
pauseOnNextExit = true;
return;
}
if (process.IsRunning) {
process.NotifyPaused(pausedReason);
return;
}
throw new DebuggerException("Invalid state at the start of callback");
}
示例3: DebugProcess
internal DebugProcess(DebugContext context, ICorDebugProcess process)
{
this.context = context;
this.process = process;
this.Process = Process.GetProcessById(process.GetID());
}
示例4: EnterCallback
void EnterCallback(string name, ICorDebugProcess pProcess)
{
isInCallback = true;
process.TraceMessage("Callback: " + name);
System.Diagnostics.Debug.Assert(process.CorProcess == pProcess);
// After break is pressed we may receive some messages that were already queued
if (process.IsPaused) {
process.TraceMessage("Processing post-break callback");
// Decrese the "break count" from 2 to 1 - does not actually continue
// TODO: This inccorectly marks the debugger as running
process.AsyncContinue(DebuggeeStateAction.Keep);
// Make sure we stay paused after the callback is handled
pauseOnNextExit = true;
return;
}
if (process.IsRunning) {
process.NotifyPaused();
return;
}
throw new DebuggerException("Invalid state at the start of callback");
}
示例5: Detach
public void Detach(ICorDebugProcess process)
{
if (this.runningProcesses.Remove(process))
{
process.Stop(Constants.Infinite);
process.Detach();
}
}
示例6: 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;
}
示例7: GetProcess
internal Process GetProcess(ICorDebugProcess corProcess) {
foreach (Process process in this.Processes) {
if (process.CorProcess == corProcess) {
return process;
}
}
return null;
}
示例8: CreateAppDomain
public void CreateAppDomain(ICorDebugProcess pProcess, ICorDebugAppDomain pAppDomain)
{
var domain = new DebugDomain(null, pAppDomain);
Logger.WriteLine("App domain {0} created", domain.Name);
pAppDomain.Attach();
pProcess.Continue(0);
}
示例9: MoveNext
//
// IEnumerator interface
//
public bool MoveNext()
{
ICorDebugProcess[] a = new ICorDebugProcess[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_proc = CorProcess.GetCorProcess(a[0]);
else
m_proc = null;
return m_proc != null;
}
示例10: GetCorProcess
public static CorProcess GetCorProcess(ICorDebugProcess process)
{
Debug.Assert(process != null);
lock (m_instances)
{
if (!m_instances.Contains(process))
{
CorProcess p = new CorProcess(process);
m_instances.Add(process, p);
return p;
}
return (CorProcess)m_instances[process];
}
}
示例11: Process
internal Process(NDebugger debugger, ICorDebugProcess corProcess, string workingDirectory)
{
this.debugger = debugger;
this.corProcess = corProcess;
this.workingDirectory = workingDirectory;
this.callbackInterface = new ManagedCallback(this);
activeEvals = new EvalCollection(debugger);
modules = new ModuleCollection(debugger);
modules.Added += OnModulesAdded;
threads = new ThreadCollection(debugger);
appDomains = new AppDomainCollection(debugger);
}
示例12: foreach
int ICorDebug.GetProcess(uint dwProcessId, out ICorDebugProcess ppProcess)
{
ppProcess = null;
foreach (CorDebugProcess process in m_processes)
{
uint id = process.PhysicalProcessId.dwProcessId;
if (dwProcessId == id)
{
ppProcess = process;
break;
}
}
return Utility.COM_HResults.BOOL_TO_HRESULT_FAIL( ppProcess != null ); /*better failure?*/
}
示例13: CorAppDomainEventArgs
void ICorDebugManagedCallback.ExitAppDomain(
ICorDebugProcess process,
ICorDebugAppDomain appDomain)
{
HandleEvent(ManagedCallbackType.OnAppDomainExit,
new CorAppDomainEventArgs( process == null ? null : CorProcess.GetCorProcess(process),
appDomain == null ? null : new CorAppDomain(appDomain),
ManagedCallbackType.OnAppDomainExit));
}
示例14: CorProcessEventArgs
void ICorDebugManagedCallback.ControlCTrap(ICorDebugProcess process)
{
HandleEvent(ManagedCallbackType.OnControlCTrap,
new CorProcessEventArgs( process == null ? null : CorProcess.GetCorProcess(process),
ManagedCallbackType.OnControlCTrap));
}
示例15: CorDebuggerErrorEventArgs
void ICorDebugManagedCallback.DebuggerError(
ICorDebugProcess process,
int errorHR,
uint errorCode)
{
HandleEvent(ManagedCallbackType.OnDebuggerError,
new CorDebuggerErrorEventArgs( process == null ? null : CorProcess.GetCorProcess(process),
errorHR,
(int)errorCode,
ManagedCallbackType.OnDebuggerError));
}