|
|
|
@ -10,7 +10,7 @@
@@ -10,7 +10,7 @@
|
|
|
|
|
// Output: \1 - intention \2 - declaration \3 - function name \4-9 parameters
|
|
|
|
|
|
|
|
|
|
// Replace with:
|
|
|
|
|
// \1\2\n\1{\n\1\tEnterCallback("\3");\n\1\t\n\1\tExitCallback_Continue();\n\1}
|
|
|
|
|
// \1\2\n\1{\n\1\tEnterCallback(PausedReason.Other, "\3");\n\1\t\n\1\tExitCallback_Continue();\n\1}
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Runtime.InteropServices; |
|
|
|
@ -22,88 +22,55 @@ namespace Debugger
@@ -22,88 +22,55 @@ namespace Debugger
|
|
|
|
|
class ManagedCallback |
|
|
|
|
{ |
|
|
|
|
NDebugger debugger; |
|
|
|
|
|
|
|
|
|
bool handlingCallback = false; |
|
|
|
|
|
|
|
|
|
Process callingProcess; |
|
|
|
|
Thread callingThread; |
|
|
|
|
|
|
|
|
|
public NDebugger Debugger { |
|
|
|
|
get { |
|
|
|
|
return debugger; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ManagedCallback(NDebugger debugger) |
|
|
|
|
{ |
|
|
|
|
this.debugger = debugger; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HandlingCallback { |
|
|
|
|
get { |
|
|
|
|
return handlingCallback; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Sets CurrentProcess
|
|
|
|
|
void EnterCallback(string name, ICorDebugProcess pProcess) |
|
|
|
|
{ |
|
|
|
|
EnterCallback(name); |
|
|
|
|
|
|
|
|
|
callingProcess = debugger.GetProcess(pProcess); |
|
|
|
|
callingProcess.IsRunning = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Sets CurrentProcess
|
|
|
|
|
void EnterCallback(string name, ICorDebugAppDomain pAppDomain) |
|
|
|
|
void EnterCallback(PausedReason pausedReason, string name, ICorDebugProcess pProcess) |
|
|
|
|
{ |
|
|
|
|
EnterCallback(name); |
|
|
|
|
|
|
|
|
|
callingProcess = debugger.GetProcess(pAppDomain.Process); |
|
|
|
|
callingProcess.IsRunning = false; |
|
|
|
|
debugger.TraceMessage("Callback: " + name); |
|
|
|
|
debugger.AssertRunning(); |
|
|
|
|
debugger.PauseSession = new PauseSession(pausedReason); |
|
|
|
|
debugger.CurrentProcess = debugger.GetProcess(pProcess); |
|
|
|
|
debugger.CurrentProcess.IsRunning = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void EnterCallback(string name, ICorDebugThread pThread) |
|
|
|
|
void EnterCallback(PausedReason pausedReason, string name, ICorDebugAppDomain pAppDomain) |
|
|
|
|
{ |
|
|
|
|
EnterCallback(name); |
|
|
|
|
|
|
|
|
|
callingThread = debugger.GetThread(pThread); |
|
|
|
|
|
|
|
|
|
callingProcess = callingThread.Process; |
|
|
|
|
callingProcess.IsRunning = false; |
|
|
|
|
EnterCallback(pausedReason, name, pAppDomain.Process); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void EnterCallback(string name) |
|
|
|
|
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread) |
|
|
|
|
{ |
|
|
|
|
handlingCallback = true; |
|
|
|
|
debugger.TraceMessage("Callback: " + name); |
|
|
|
|
// ExitProcess may be called at any time when debuggee is killed
|
|
|
|
|
if (name != "ExitProcess") { |
|
|
|
|
debugger.AssertRunning(); |
|
|
|
|
} |
|
|
|
|
if (name != "ExitProcess") debugger.AssertRunning(); |
|
|
|
|
Thread thread = debugger.GetThread(pThread); |
|
|
|
|
debugger.PauseSession = new PauseSession(pausedReason); |
|
|
|
|
debugger.CurrentProcess = thread.Process; |
|
|
|
|
debugger.CurrentProcess.IsRunning = false; |
|
|
|
|
debugger.CurrentProcess.CurrentThread = thread; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ExitCallback_Continue() |
|
|
|
|
{ |
|
|
|
|
callingProcess.ContinueCallback(); |
|
|
|
|
|
|
|
|
|
callingThread = null; |
|
|
|
|
callingProcess = null; |
|
|
|
|
handlingCallback = false; |
|
|
|
|
debugger.CurrentProcess.Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ExitCallback_Paused(PausedReason reason) |
|
|
|
|
void ExitCallback_Paused() |
|
|
|
|
{ |
|
|
|
|
if (callingThread != null) { |
|
|
|
|
callingThread.DeactivateAllSteppers(); |
|
|
|
|
if (debugger.CurrentThread != null) { |
|
|
|
|
debugger.CurrentThread.DeactivateAllSteppers(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
handlingCallback = false; |
|
|
|
|
|
|
|
|
|
debugger.Pause(reason, callingProcess, callingThread, null); |
|
|
|
|
|
|
|
|
|
callingThread = null; |
|
|
|
|
callingProcess = null; |
|
|
|
|
debugger.Pause(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -111,7 +78,7 @@ namespace Debugger
@@ -111,7 +78,7 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("StepComplete (" + reason.ToString() + ")", pThread); |
|
|
|
|
EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread); |
|
|
|
|
|
|
|
|
|
Stepper stepper = debugger.GetThread(pThread).GetStepper(pStepper); |
|
|
|
|
if (stepper != null) { |
|
|
|
@ -122,23 +89,23 @@ namespace Debugger
@@ -122,23 +89,23 @@ namespace Debugger
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!callingThread.LastFunction.HasSymbols) { |
|
|
|
|
if (!debugger.CurrentThread.LastFunction.HasSymbols) { |
|
|
|
|
// This should not happen with JMC enabled
|
|
|
|
|
debugger.TraceMessage(" - leaving code without symbols"); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
ExitCallback_Paused(PausedReason.StepComplete); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Do not pass the pBreakpoint parameter as ICorDebugBreakpoint - marshaling of it fails in .NET 1.1
|
|
|
|
|
public void Breakpoint(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, IntPtr pBreakpoint) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("Breakpoint", pThread); |
|
|
|
|
EnterCallback(PausedReason.Breakpoint, "Breakpoint", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Paused(PausedReason.Breakpoint); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
|
|
|
|
|
// foreach (Breakpoint b in debugger.Breakpoints) {
|
|
|
|
|
// if (b.Equals(pBreakpoint)) {
|
|
|
|
@ -150,23 +117,23 @@ namespace Debugger
@@ -150,23 +117,23 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void BreakpointSetError(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugBreakpoint pBreakpoint, uint dwError) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("BreakpointSetError", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "BreakpointSetError", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public unsafe void Break(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("Break", pThread); |
|
|
|
|
EnterCallback(PausedReason.Break, "Break", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Paused(PausedReason.Break); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ControlCTrap(ICorDebugProcess pProcess) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("ControlCTrap", pProcess); |
|
|
|
|
EnterCallback(PausedReason.ControlCTrap, "ControlCTrap", pProcess); |
|
|
|
|
|
|
|
|
|
ExitCallback_Paused(PausedReason.ControlCTrap); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public unsafe void Exception(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int unhandled) |
|
|
|
@ -179,7 +146,7 @@ namespace Debugger
@@ -179,7 +146,7 @@ namespace Debugger
|
|
|
|
|
Exception2(pAppDomain, pThread, null, 0, (CorDebugExceptionCallbackType)exceptionType, 0); |
|
|
|
|
} else { |
|
|
|
|
// This callback should be ignored in v2 applications
|
|
|
|
|
EnterCallback("Exception", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "Exception", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
@ -191,14 +158,14 @@ namespace Debugger
@@ -191,14 +158,14 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void LogSwitch(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int lLevel, uint ulReason, string pLogSwitchName, string pParentName) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("LogSwitch", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "LogSwitch", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void LogMessage(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int lLevel, string pLogSwitchName, string pMessage) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("LogMessage", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "LogMessage", pThread); |
|
|
|
|
|
|
|
|
|
debugger.OnLogMessage(pMessage); |
|
|
|
|
|
|
|
|
@ -207,21 +174,21 @@ namespace Debugger
@@ -207,21 +174,21 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void EditAndContinueRemap(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction, int fAccurate) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("EditAndContinueRemap", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "EditAndContinueRemap", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void EvalException(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("EvalException", pThread); |
|
|
|
|
EnterCallback(PausedReason.EvalComplete, "EvalException", pThread); |
|
|
|
|
|
|
|
|
|
HandleEvalComplete(pAppDomain, pThread, corEval, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void EvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("EvalComplete", pThread); |
|
|
|
|
EnterCallback(PausedReason.EvalComplete, "EvalComplete", pThread); |
|
|
|
|
|
|
|
|
|
HandleEvalComplete(pAppDomain, pThread, corEval, false); |
|
|
|
|
} |
|
|
|
@ -239,23 +206,23 @@ namespace Debugger
@@ -239,23 +206,23 @@ namespace Debugger
|
|
|
|
|
debugger.SetupNextEvaluation(debugger.GetThread(pThread)); |
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} else { |
|
|
|
|
ExitCallback_Paused(PausedReason.AllEvalsComplete); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void DebuggerError(ICorDebugProcess pProcess, int errorHR, uint errorCode) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("DebuggerError", pProcess); |
|
|
|
|
EnterCallback(PausedReason.DebuggerError, "DebuggerError", pProcess); |
|
|
|
|
|
|
|
|
|
string errorText = String.Format("Debugger error: \nHR = 0x{0:X} \nCode = 0x{1:X}", errorHR, errorCode); |
|
|
|
|
System.Windows.Forms.MessageBox.Show(errorText); |
|
|
|
|
|
|
|
|
|
ExitCallback_Paused(PausedReason.DebuggerError); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void UpdateModuleSymbols(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule, IStream pSymbolStream) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("UpdateModuleSymbols", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "UpdateModuleSymbols", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
@ -266,7 +233,7 @@ namespace Debugger
@@ -266,7 +233,7 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void CreateProcess(ICorDebugProcess pProcess) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("CreateProcess", pProcess); |
|
|
|
|
EnterCallback(PausedReason.Other, "CreateProcess", pProcess); |
|
|
|
|
|
|
|
|
|
// Process is added in NDebugger.Start
|
|
|
|
|
|
|
|
|
@ -275,7 +242,7 @@ namespace Debugger
@@ -275,7 +242,7 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void CreateAppDomain(ICorDebugProcess pProcess, ICorDebugAppDomain pAppDomain) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("CreateAppDomain", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "CreateAppDomain", pAppDomain); |
|
|
|
|
|
|
|
|
|
pAppDomain.Attach(); |
|
|
|
|
|
|
|
|
@ -284,14 +251,14 @@ namespace Debugger
@@ -284,14 +251,14 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void LoadAssembly(ICorDebugAppDomain pAppDomain, ICorDebugAssembly pAssembly) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("LoadAssembly", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "LoadAssembly", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public unsafe void LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("LoadModule", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "LoadModule", pAppDomain); |
|
|
|
|
|
|
|
|
|
debugger.AddModule(pModule); |
|
|
|
|
|
|
|
|
@ -302,14 +269,14 @@ namespace Debugger
@@ -302,14 +269,14 @@ namespace Debugger
|
|
|
|
|
{ |
|
|
|
|
if (pAppDomain != null) { |
|
|
|
|
|
|
|
|
|
EnterCallback("NameChange: pAppDomain", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "NameChange: pAppDomain", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if (pThread != null) { |
|
|
|
|
|
|
|
|
|
EnterCallback("NameChange: pThread", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "NameChange: pThread", pThread); |
|
|
|
|
|
|
|
|
|
Thread thread = debugger.GetThread(pThread); |
|
|
|
|
thread.HasBeenLoaded = true; |
|
|
|
@ -323,7 +290,7 @@ namespace Debugger
@@ -323,7 +290,7 @@ namespace Debugger
|
|
|
|
|
{ |
|
|
|
|
// We can not use pThread since it has not been added yet
|
|
|
|
|
// and we continue from this callback anyway
|
|
|
|
|
EnterCallback("CreateThread", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "CreateThread", pAppDomain); |
|
|
|
|
|
|
|
|
|
debugger.AddThread(pThread); |
|
|
|
|
|
|
|
|
@ -332,7 +299,7 @@ namespace Debugger
@@ -332,7 +299,7 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void LoadClass(ICorDebugAppDomain pAppDomain, ICorDebugClass c) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("LoadClass", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "LoadClass", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
@ -343,14 +310,14 @@ namespace Debugger
@@ -343,14 +310,14 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void UnloadClass(ICorDebugAppDomain pAppDomain, ICorDebugClass c) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("UnloadClass", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "UnloadClass", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void UnloadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("UnloadModule", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "UnloadModule", pAppDomain); |
|
|
|
|
|
|
|
|
|
debugger.RemoveModule(pModule); |
|
|
|
|
|
|
|
|
@ -359,14 +326,14 @@ namespace Debugger
@@ -359,14 +326,14 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void UnloadAssembly(ICorDebugAppDomain pAppDomain, ICorDebugAssembly pAssembly) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("UnloadAssembly", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "UnloadAssembly", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ExitThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("ExitThread", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "ExitThread", pThread); |
|
|
|
|
|
|
|
|
|
Thread thread = debugger.GetThread(pThread); |
|
|
|
|
|
|
|
|
@ -381,14 +348,14 @@ namespace Debugger
@@ -381,14 +348,14 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void ExitAppDomain(ICorDebugProcess pProcess, ICorDebugAppDomain pAppDomain) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("ExitAppDomain", pAppDomain); |
|
|
|
|
EnterCallback(PausedReason.Other, "ExitAppDomain", pAppDomain); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ExitProcess(ICorDebugProcess pProcess) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("ExitProcess", pProcess); |
|
|
|
|
EnterCallback(PausedReason.Other, "ExitProcess", pProcess); |
|
|
|
|
|
|
|
|
|
Process process = debugger.GetProcess(pProcess); |
|
|
|
|
|
|
|
|
@ -406,54 +373,54 @@ namespace Debugger
@@ -406,54 +373,54 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void ChangeConnection(ICorDebugProcess pProcess, uint dwConnectionId) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("ChangeConnection", pProcess); |
|
|
|
|
EnterCallback(PausedReason.Other, "ChangeConnection", pProcess); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void CreateConnection(ICorDebugProcess pProcess, uint dwConnectionId, IntPtr pConnName) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("CreateConnection", pProcess); |
|
|
|
|
EnterCallback(PausedReason.Other, "CreateConnection", pProcess); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void DestroyConnection(ICorDebugProcess pProcess, uint dwConnectionId) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("DestroyConnection", pProcess); |
|
|
|
|
EnterCallback(PausedReason.Other, "DestroyConnection", pProcess); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType exceptionType, uint dwFlags) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("Exception2", pThread); |
|
|
|
|
EnterCallback(PausedReason.Exception, "Exception2", pThread); |
|
|
|
|
|
|
|
|
|
// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
|
|
|
|
|
// Whatch out for the zeros and null!
|
|
|
|
|
// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
|
|
|
|
|
|
|
|
|
|
callingThread.CurrentExceptionType = (ExceptionType)exceptionType; |
|
|
|
|
debugger.CurrentThread.CurrentExceptionType = (ExceptionType)exceptionType; |
|
|
|
|
|
|
|
|
|
if (ExceptionType.DEBUG_EXCEPTION_UNHANDLED != (ExceptionType)exceptionType) { |
|
|
|
|
// Handled exception
|
|
|
|
|
if (debugger.PauseOnHandledException) { |
|
|
|
|
ExitCallback_Paused(PausedReason.Exception); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} else { |
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// Unhandled exception
|
|
|
|
|
ExitCallback_Paused(PausedReason.Exception); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ExceptionUnwind(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, CorDebugExceptionUnwindCallbackType dwEventType, uint dwFlags) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("ExceptionUnwind", pThread); |
|
|
|
|
EnterCallback(PausedReason.ExceptionIntercepted, "ExceptionUnwind", pThread); |
|
|
|
|
|
|
|
|
|
if (dwEventType == CorDebugExceptionUnwindCallbackType.DEBUG_EXCEPTION_INTERCEPTED) { |
|
|
|
|
ExitCallback_Paused(PausedReason.ExceptionIntercepted); |
|
|
|
|
ExitCallback_Paused(); |
|
|
|
|
} else { |
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
@ -461,14 +428,14 @@ namespace Debugger
@@ -461,14 +428,14 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void FunctionRemapComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("FunctionRemapComplete", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "FunctionRemapComplete", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void FunctionRemapOpportunity(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pOldFunction, ICorDebugFunction pNewFunction, uint oldILOffset) |
|
|
|
|
{ |
|
|
|
|
EnterCallback("FunctionRemapOpportunity", pThread); |
|
|
|
|
EnterCallback(PausedReason.Other, "FunctionRemapOpportunity", pThread); |
|
|
|
|
|
|
|
|
|
ExitCallback_Continue(); |
|
|
|
|
} |
|
|
|
@ -476,9 +443,9 @@ namespace Debugger
@@ -476,9 +443,9 @@ namespace Debugger
|
|
|
|
|
public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda) |
|
|
|
|
{ |
|
|
|
|
if (c.Is<ICorDebugAppDomain>()) { |
|
|
|
|
EnterCallback("MDANotification", c.CastTo<ICorDebugAppDomain>()); |
|
|
|
|
EnterCallback(PausedReason.Other, "MDANotification", c.CastTo<ICorDebugAppDomain>()); |
|
|
|
|
} else if (c.Is<ICorDebugProcess>()){ |
|
|
|
|
EnterCallback("MDANotification", c.CastTo<ICorDebugProcess>()); |
|
|
|
|
EnterCallback(PausedReason.Other, "MDANotification", c.CastTo<ICorDebugProcess>()); |
|
|
|
|
} else { |
|
|
|
|
throw new System.Exception("Unknown callback argument"); |
|
|
|
|
} |
|
|
|
|