I think i have found a bug in GDBJIT feature: function NotifyGdb::MethodPrepared not always called. Sometimes methods of managed code might be compiled without notifying GDB of that.
GDB is notified about method compilation in MethodDesc::PrepareInitialCode (prestub.cpp:325):
324 #if defined(FEATURE_GDBJIT) && defined(TARGET_UNIX) && !defined(CROSSGEN_COMPILE)
325 NotifyGdb::MethodPrepared(this);
326 #endif
But in a few cases MethodDesc::PrepareCode is called directly (without call to PrepareInitialCode), so GDB stay not notified about the changes. Such cases are following:
TieredCompilationManager::CompileCodeVersion (tieredcompilation.cpp:780) directly callse PrepareCode;
JitPatchpointWorker (jithelpers.cpp:5055);
CodeVersionManager::PublishVersionableCodeIfNecessary (codeversion.cpp:1702);
MulticoreJitProfilePlayer::CompileMethodDesc (multicorejitplayer.cpp:548).
So, I think there is a bug exists: call to NotifyGdb::MethodPrepared() should be moved from function MethodDesc::PrepareInitialCode to the function ``MethodDesc::PrepareCode`.
I think i have found a bug in GDBJIT feature: function
NotifyGdb::MethodPreparednot always called. Sometimes methods of managed code might be compiled without notifying GDB of that.GDB is notified about method compilation in
MethodDesc::PrepareInitialCode(prestub.cpp:325):But in a few cases
MethodDesc::PrepareCodeis called directly (without call toPrepareInitialCode), so GDB stay not notified about the changes. Such cases are following:TieredCompilationManager::CompileCodeVersion(tieredcompilation.cpp:780) directly callsePrepareCode;JitPatchpointWorker(jithelpers.cpp:5055);CodeVersionManager::PublishVersionableCodeIfNecessary(codeversion.cpp:1702);MulticoreJitProfilePlayer::CompileMethodDesc(multicorejitplayer.cpp:548).So, I think there is a bug exists: call to
NotifyGdb::MethodPrepared()should be moved from functionMethodDesc::PrepareInitialCodeto the function ``MethodDesc::PrepareCode`.