|
|
|
@ -65,9 +65,7 @@ namespace Debugger
@@ -65,9 +65,7 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
internal ICorDebugClass ContaingClass { |
|
|
|
|
get { |
|
|
|
|
ICorDebugClass corClass; |
|
|
|
|
corFunction.GetClass(out corClass); |
|
|
|
|
return corClass; |
|
|
|
|
return corFunction.Class; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -88,9 +86,7 @@ namespace Debugger
@@ -88,9 +86,7 @@ namespace Debugger
|
|
|
|
|
if (this.HasExpired) { |
|
|
|
|
return new UnavailableValue(debugger, "Function has expired"); |
|
|
|
|
} else { |
|
|
|
|
ICorDebugValue argThis = null; |
|
|
|
|
CorILFrame.GetArgument(0, out argThis); |
|
|
|
|
return new ObjectValue(debugger, argThis, ContaingClass); |
|
|
|
|
return new ObjectValue(debugger, CorILFrame.GetArgument(0), ContaingClass); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -104,14 +100,10 @@ namespace Debugger
@@ -104,14 +100,10 @@ namespace Debugger
|
|
|
|
|
this.frameIndex = frameIndex; |
|
|
|
|
this.corILFrame = corILFrame; |
|
|
|
|
this.corILFrameDebuggerSessionID = debugger.SessionID; |
|
|
|
|
corILFrame.GetFunction(out corFunction); |
|
|
|
|
uint functionToken; |
|
|
|
|
corFunction.GetToken(out functionToken); |
|
|
|
|
ICorDebugModule corModule; |
|
|
|
|
corFunction.GetModule(out corModule); |
|
|
|
|
module = debugger.GetModule(corModule); |
|
|
|
|
corFunction = corILFrame.Function; |
|
|
|
|
module = debugger.GetModule(corFunction.Module); |
|
|
|
|
|
|
|
|
|
methodProps = module.MetaData.GetMethodProps(functionToken); |
|
|
|
|
methodProps = module.MetaData.GetMethodProps(corFunction.Token); |
|
|
|
|
|
|
|
|
|
// Expiry the function when it is finished
|
|
|
|
|
Stepper tracingStepper = thread.CreateStepper(); |
|
|
|
@ -136,8 +128,7 @@ namespace Debugger
@@ -136,8 +128,7 @@ namespace Debugger
|
|
|
|
|
internal uint corInstructionPtr { |
|
|
|
|
get { |
|
|
|
|
uint corInstructionPtr; |
|
|
|
|
CorDebugMappingResult MappingResult; |
|
|
|
|
CorILFrame.GetIP(out corInstructionPtr,out MappingResult); |
|
|
|
|
CorILFrame.GetIP(out corInstructionPtr); |
|
|
|
|
return corInstructionPtr; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -176,12 +167,11 @@ namespace Debugger
@@ -176,12 +167,11 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public void StepOut() |
|
|
|
|
{ |
|
|
|
|
ICorDebugStepper stepper; |
|
|
|
|
CorILFrame.CreateStepper(out stepper); |
|
|
|
|
ICorDebugStepper stepper = CorILFrame.CreateStepper(); |
|
|
|
|
stepper.StepOut(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debugger.CurrentThread.AddActiveStepper(stepper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debugger.Continue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -201,7 +191,7 @@ namespace Debugger
@@ -201,7 +191,7 @@ namespace Debugger
|
|
|
|
|
ICorDebugStepper stepper; |
|
|
|
|
|
|
|
|
|
if (stepIn) { |
|
|
|
|
CorILFrame.CreateStepper(out stepper); |
|
|
|
|
stepper = CorILFrame.CreateStepper(); |
|
|
|
|
|
|
|
|
|
if (stepper.Is<ICorDebugStepper2>()) { // Is the debuggee .NET 2.0?
|
|
|
|
|
stepper.SetUnmappedStopMask(CorDebugUnmappedStop.STOP_NONE); |
|
|
|
@ -218,7 +208,7 @@ namespace Debugger
@@ -218,7 +208,7 @@ namespace Debugger
|
|
|
|
|
// Mind that step in which ends in code without symblols is cotinued
|
|
|
|
|
// so the next step over ensures that we atleast do step over
|
|
|
|
|
|
|
|
|
|
CorILFrame.CreateStepper(out stepper); |
|
|
|
|
stepper = CorILFrame.CreateStepper(); |
|
|
|
|
|
|
|
|
|
if (stepper.Is<ICorDebugStepper2>()) { // Is the debuggee .NET 2.0?
|
|
|
|
|
stepper.SetUnmappedStopMask(CorDebugUnmappedStop.STOP_NONE); |
|
|
|
@ -286,14 +276,11 @@ namespace Debugger
@@ -286,14 +276,11 @@ namespace Debugger
|
|
|
|
|
for (int i = sequencePointCount - 1; i >= 0; i--) // backwards
|
|
|
|
|
if (offsets[i] <= offset || i == 0) { |
|
|
|
|
// Set inforamtion about current IL range
|
|
|
|
|
ICorDebugCode code; |
|
|
|
|
corFunction.GetILCode(out code); |
|
|
|
|
uint codeSize; |
|
|
|
|
code.GetSize(out codeSize); |
|
|
|
|
int codeSize = (int)corFunction.ILCode.Size; |
|
|
|
|
|
|
|
|
|
retVal.ILOffset = (int)offset; |
|
|
|
|
retVal.ILStart = offsets[i]; |
|
|
|
|
retVal.ILEnd = (i + 1 < sequencePointCount) ? offsets[i + 1] : (int)codeSize; |
|
|
|
|
retVal.ILEnd = (i + 1 < sequencePointCount) ? offsets[i + 1] : codeSize; |
|
|
|
|
|
|
|
|
|
// 0xFeeFee means "code generated by compiler"
|
|
|
|
|
// If we are in generated sequence use to closest real one instead,
|
|
|
|
@ -302,7 +289,7 @@ namespace Debugger
@@ -302,7 +289,7 @@ namespace Debugger
|
|
|
|
|
// Look ahead for 'real' sequence
|
|
|
|
|
while (i + 1 < sequencePointCount && startLine[i] == 0xFeeFee) { |
|
|
|
|
i++; |
|
|
|
|
retVal.ILEnd = (i + 1 < sequencePointCount) ? offsets[i + 1] : (int)codeSize; |
|
|
|
|
retVal.ILEnd = (i + 1 < sequencePointCount) ? offsets[i + 1] : codeSize; |
|
|
|
|
} |
|
|
|
|
// Look back for 'real' sequence
|
|
|
|
|
while (i - 1 >= 0 && startLine[i] == 0xFeeFee) { |
|
|
|
@ -339,7 +326,7 @@ namespace Debugger
@@ -339,7 +326,7 @@ namespace Debugger
|
|
|
|
|
if (j + 1 < sequencePointCount) { |
|
|
|
|
stepRanges.Add(offsets[j + 1]); |
|
|
|
|
} else { |
|
|
|
|
stepRanges.Add((int)codeSize); |
|
|
|
|
stepRanges.Add(codeSize); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -371,9 +358,7 @@ namespace Debugger
@@ -371,9 +358,7 @@ namespace Debugger
|
|
|
|
|
if (!suggestion.GetFunctionAndOffset(debugger, false, out corFunction, out ilOffset)) { |
|
|
|
|
return null; |
|
|
|
|
} else { |
|
|
|
|
uint token; |
|
|
|
|
corFunction.GetToken(out token); |
|
|
|
|
if (token != methodProps.Token) { |
|
|
|
|
if (corFunction.Token != methodProps.Token) { |
|
|
|
|
return null; |
|
|
|
|
} else { |
|
|
|
|
try { |
|
|
|
@ -428,10 +413,8 @@ namespace Debugger
@@ -428,10 +413,8 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
public int ArgumentCount { |
|
|
|
|
get { |
|
|
|
|
ICorDebugValueEnum argumentEnum; |
|
|
|
|
CorILFrame.EnumerateArguments(out argumentEnum); |
|
|
|
|
uint argCount; |
|
|
|
|
argumentEnum.GetCount(out argCount); |
|
|
|
|
ICorDebugValueEnum argumentEnum = CorILFrame.EnumerateArguments(); |
|
|
|
|
uint argCount = argumentEnum.Count; |
|
|
|
|
if (!IsStatic) { |
|
|
|
|
argCount--; // Remove 'this' from count
|
|
|
|
|
} |
|
|
|
@ -441,10 +424,8 @@ namespace Debugger
@@ -441,10 +424,8 @@ namespace Debugger
|
|
|
|
|
|
|
|
|
|
internal ICorDebugValue GetArgumentValue(int index) |
|
|
|
|
{ |
|
|
|
|
ICorDebugValue arg; |
|
|
|
|
// Non-static functions include 'this' as first argument
|
|
|
|
|
CorILFrame.GetArgument((uint)(IsStatic? index : (index + 1)), out arg); |
|
|
|
|
return arg; |
|
|
|
|
return CorILFrame.GetArgument((uint)(IsStatic? index : (index + 1))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Variable GetArgumentVariable(int index) |
|
|
|
@ -508,7 +489,7 @@ namespace Debugger
@@ -508,7 +489,7 @@ namespace Debugger
|
|
|
|
|
} else { |
|
|
|
|
ICorDebugValue corValue; |
|
|
|
|
try { |
|
|
|
|
CorILFrame.GetLocalVariable((uint)symVar.AddressField1, out corValue); |
|
|
|
|
corValue = CorILFrame.GetLocalVariable((uint)symVar.AddressField1); |
|
|
|
|
} catch (COMException e) { |
|
|
|
|
if ((uint)e.ErrorCode == 0x80131304) return new UnavailableValue(debugger, "Unavailable in optimized code"); |
|
|
|
|
throw; |
|
|
|
|