}
Breakpoints::ManagedBreakpoint::ManagedBreakpoint() :
- id(0), modAddress(0), methodToken(0), ilOffset(0), linenum(0), breakpoint(nullptr), enabled(true), times(0)
+ id(0), modAddress(0), methodToken(0), ilOffset(0), linenum(0), iCorBreakpoint(nullptr), enabled(true), times(0)
{}
Breakpoints::ManagedBreakpoint::~ManagedBreakpoint()
{
- if (breakpoint)
- breakpoint->Activate(0);
+ if (iCorBreakpoint)
+ iCorBreakpoint->Activate(0);
}
void Breakpoints::ManagedBreakpoint::ToBreakpoint(Breakpoint &breakpoint)
bp.methodToken = methodToken;
bp.ilOffset = ilOffset;
bp.fullname = fullname;
- bp.breakpoint = pBreakpoint.Detach();
+ bp.iCorBreakpoint = pBreakpoint.Detach();
return S_OK;
}
bp.methodToken = methodToken;
bp.ilOffset = ilOffset;
bp.fullname = fullname;
- bp.breakpoint = pBreakpoint.Detach();
+ bp.iCorBreakpoint = pBreakpoint.Detach();
return S_OK;
}
while (!classParts.empty())
{
ToRelease<ICorDebugType> pEnclosingType(std::move(pType));
- int nextClassPart = 0;
+ nextClassPart = 0;
if (FAILED(FindType(classParts, nextClassPart, pThread, pModule, &pType)))
break;
IfFailRet(pThread3->CreateStackWalk(&pStackWalk));
std::vector< ToRelease<ICorDebugFrame> > iFrameCache;
+ std::vector<NativeFrame> nFrames;
static const ULONG32 ctxFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
CONTEXT ctxUnmanagedChain;
}
// Check if we have native frames to unwind
- std::vector<NativeFrame> nFrames;
if (ctxUnmanagedChainValid)
IfFailRet(UnwindNativeFrames(pThread, GetSP(&ctxUnmanagedChain), pEndVal, nFrames));
IfFailRet(StitchInternalFrames(pThread, iFrameCache, nFrames, cb));
// If the first frame is either internal or native then we might be in a call to unmanaged code
if (level == 0)
{
- std::vector<NativeFrame> nFrames;
IfFailRet(UnwindNativeFrames(pThread, 0, GetFrameAddr(pFrame), nFrames));
IfFailRet(StitchInternalFrames(pThread, {}, nFrames, cb));
+ nFrames.clear();
}
IfFailRet(cb(frameType, pFrame, nullptr, nullptr));
}
// We may have native frames at the end of the stack
uint64_t pEndVal = std::numeric_limits<uint64_t>::max();
- std::vector<NativeFrame> nFrames;
if (ctxUnmanagedChainValid)
IfFailRet(UnwindNativeFrames(pThread, GetSP(&ctxUnmanagedChain), pEndVal, nFrames));
IfFailRet(StitchInternalFrames(pThread, iFrameCache, nFrames, cb));
{
ToRelease<ICorDebugInternalFrame> pInternalFrame;
IfFailRet(pFrame->QueryInterface(IID_ICorDebugInternalFrame, (LPVOID*) &pInternalFrame));
- CorDebugInternalFrameType frameType;
- IfFailRet(pInternalFrame->GetFrameType(&frameType));
+ CorDebugInternalFrameType corFrameType;
+ IfFailRet(pInternalFrame->GetFrameType(&corFrameType));
std::string name = "[";
- name += GetInternalTypeName(frameType);
+ name += GetInternalTypeName(corFrameType);
name += "]";
stackFrames.emplace_back(threadId, currentFrame, name);
stackFrames.back().addr = GetFrameAddr(pFrame);
if (evalThreadId == currentThreadId) {
m_debugger.m_evaluator.pop_eval_queue();
- DWORD evalThreadId = m_debugger.m_evaluator.front_eval_queue();
+ evalThreadId = m_debugger.m_evaluator.front_eval_queue();
ToRelease<ICorDebugThread> pThreadEval;
IfFailRet(m_debugger.m_pProcess->GetThread(evalThreadId, &pThreadEval));
IfFailRet(pAppDomain->SetAllThreadsDebugState(THREAD_SUSPEND, nullptr));
if (evalThreadId == currentThreadId) {
m_debugger.m_evaluator.pop_eval_queue();
- DWORD evalThreadId = m_debugger.m_evaluator.front_eval_queue();
+ evalThreadId = m_debugger.m_evaluator.front_eval_queue();
ToRelease<ICorDebugThread> pThreadEval;
IfFailRet(m_debugger.m_pProcess->GetThread(evalThreadId, &pThreadEval));
IfFailRet(pAppDomain->SetAllThreadsDebugState(THREAD_SUSPEND, nullptr));
ULONG32 ilOffset;
std::string fullname;
int linenum;
- ToRelease<ICorDebugBreakpoint> breakpoint;
+ ToRelease<ICorDebugBreakpoint> iCorBreakpoint;
bool enabled;
ULONG32 times;
std::string condition;
case ELEMENT_TYPE_GENERICINST :
{
//typePtr = NameForTypeSig(typePtr, args, pImport, out, appendix);
- mdTypeDef tk;
CorElementType underlyingType;
typePtr += CorSigUncompressElementType(typePtr, &underlyingType);
typePtr += CorSigUncompressToken(typePtr, &tk);
IfFailRet(pMDUnknown->QueryInterface(IID_IMetaDataImport, (LPVOID*) &pMD));
ULONG numMethods = 0;
- HCORENUM fEnum = NULL;
+ HCORENUM hEnum = NULL;
mdMethodDef methodDef = mdMethodDefNil;
- pMD->EnumMethodsWithName(&fEnum, currentTypeDef, methodName, &methodDef, 1, &numMethods);
- pMD->CloseEnum(fEnum);
+ pMD->EnumMethodsWithName(&hEnum, currentTypeDef, methodName, &methodDef, 1, &numMethods);
+ pMD->CloseEnum(hEnum);
if (numMethods == 1)
return pModule->GetFunctionFromToken(methodDef, ppFunc);
std::unordered_set<string> backedProperties;
ULONG numFields = 0;
- HCORENUM fEnum = NULL;
+ HCORENUM hEnum = NULL;
mdFieldDef fieldDef;
- while(SUCCEEDED(pMD->EnumFields(&fEnum, currentTypeDef, &fieldDef, 1, &numFields)) && numFields != 0)
+ while(SUCCEEDED(pMD->EnumFields(&hEnum, currentTypeDef, &fieldDef, 1, &numFields)) && numFields != 0)
{
ULONG nameLen = 0;
DWORD fieldAttr = 0;
if(fieldAttr & fdLiteral)
{
- IfFailRet(GetLiteralValue(
- pThread, pType, pModule, pSignatureBlob, sigBlobLength, pRawValue, rawValueLength, &pFieldVal));
+ Status = GetLiteralValue(pThread, pType, pModule, pSignatureBlob, sigBlobLength, pRawValue, rawValueLength, &pFieldVal);
+ if (FAILED(Status))
+ {
+ pMD->CloseEnum(hEnum);
+ return Status;
+ }
}
else if (fieldAttr & fdStatic)
{
if (isNull && !is_static)
continue;
- IfFailRet(cb(mdMethodDefNil, pModule, pType, pFieldVal, is_static, name));
+ Status = cb(mdMethodDefNil, pModule, pType, pFieldVal, is_static, name);
+ if (FAILED(Status))
+ {
+ pMD->CloseEnum(hEnum);
+ return Status;
+ }
}
}
- pMD->CloseEnum(fEnum);
+ pMD->CloseEnum(hEnum);
mdProperty propertyDef;
ULONG numProperties = 0;
bool debuggerBrowsableState_Never = false;
ULONG numAttributes = 0;
- HCORENUM fEnum = NULL;
+ hEnum = NULL;
mdCustomAttribute attr;
- while(SUCCEEDED(pMD->EnumCustomAttributes(&fEnum, propertyDef, 0, &attr, 1, &numAttributes)) && numAttributes != 0)
+ while(SUCCEEDED(pMD->EnumCustomAttributes(&hEnum, propertyDef, 0, &attr, 1, &numAttributes)) && numAttributes != 0)
{
mdToken ptkObj = mdTokenNil;
mdToken ptkType = mdTokenNil;
break;
}
}
- pMD->CloseEnum(fEnum);
+ pMD->CloseEnum(hEnum);
if (debuggerBrowsableState_Never)
continue;