LOG((LF_CORDB,LL_EVERYTHING, "DJI::~DJI : deleted at 0x%p\n", this));
}
-
// Lazy initialize the Debugger-Jit-Info
void DebuggerJitInfo::LazyInitBounds()
{
PRECONDITION(!g_pDebugger->HasDebuggerDataLock());
} CONTRACTL_END;
- //@todo: this method is not synchronized. Mei-chin's recent work should cover this one
+ LOG((LF_CORDB, LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x m_fAttemptInit %s\n", this, m_fAttemptInit == true ? "true": "false"));
+
// Only attempt lazy-init once
- // new LOG message
- LOG((LF_CORDB,LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x m_fAttemptInit %s\n", this, m_fAttemptInit == true? "true": "false"));
if (m_fAttemptInit)
{
return;
}
- m_fAttemptInit = true;
EX_TRY
{
- LOG((LF_CORDB,LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x Initing\n", this));
+ LOG((LF_CORDB, LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x Initing\n", this));
+
// Should have already been jitted
_ASSERTE(this->m_jitComplete);
MethodDesc * mdesc = this->m_fd;
-
DebugInfoRequest request;
_ASSERTE(this->m_addrOfCode != NULL); // must have address to disambguate the Enc cases.
// Note the MethodDesc may not yet have the jitted info, so we'll also use the starting address we got in the jit complete callback.
request.InitFromStartingAddr(mdesc, (PCODE)this->m_addrOfCode);
-
// Bounds info.
ULONG32 cMap = 0;
ICorDebugInfo::OffsetMapping *pMap = NULL;
InteropSafeNew, NULL, // allocator
&cMap, &pMap,
&cVars, &pVars);
+
LOG((LF_CORDB,LL_EVERYTHING, "DJI::LazyInitBounds: this=0x%x GetBoundariesAndVars success=0x%x\n", this, fSuccess));
- if (fSuccess)
+
+ Debugger::DebuggerDataLockHolder debuggerDataLockHolder(g_pDebugger);
+
+ if (!m_fAttemptInit)
{
- this->SetBoundaries(cMap, pMap);
- this->SetVars(cVars, pVars);
+ if (fSuccess)
+ {
+ this->SetBoundaries(cMap, pMap);
+ this->SetVars(cVars, pVars);
+ }
+ m_fAttemptInit = true;
}
+ else
+ {
+ DeleteInteropSafe(pMap);
+ DeleteInteropSafe(pVars);
+ }
+ // DebuggerDataLockHolder out of scope - release implied
}
EX_CATCH
{
{
LIMITED_METHOD_CONTRACT;
- if (m_varNativeInfo)
- {
- return;
- }
+ _ASSERTE(m_varNativeInfo == NULL);
m_varNativeInfo = pVars;
m_varNativeInfoCount = cVars;
LOG((LF_CORDB,LL_EVERYTHING, "DJI::SetBoundaries: this=0x%x cMap=0x%x pMap=0x%x\n", this, cMap, pMap));
_ASSERTE((cMap == 0) == (pMap == NULL));
+ _ASSERTE(m_sequenceMap == NULL);
if (cMap == 0)
return;
- if (m_sequenceMap)
- {
- return;
- }
-
ULONG ilLast = 0;
#ifdef _DEBUG
// We assume that the map is sorted by native offset