Skip to content

Instantly share code, notes, and snippets.

@Criteo-dotnet-blog
Created May 29, 2017 11:05
Show Gist options
  • Select an option

  • Save Criteo-dotnet-blog/b4615ab796cd40ed6e873e192518ae56 to your computer and use it in GitHub Desktop.

Select an option

Save Criteo-dotnet-blog/b4615ab796cd40ed6e873e192518ae56 to your computer and use it in GitHub Desktop.
// decypher the callback details
val = GetFieldValue(heap, currentTimerQueueTimerRef, "m_timerCallback");
if (val != null)
{
ulong elementAddress = (ulong)val;
if (elementAddress == 0)
continue;
var elementType = _heap.GetObjectType(elementAddress);
if (elementType != null)
{
if (elementType.Name == "System.Threading.TimerCallback")
{
ti.MethodName = BuildTimerCallbackMethodName(runtime, elementAddress);
}
else
{
ti.MethodName = "<" + elementType.Name + ">";
}
}
else
{
ti.MethodName = "{no callback type?}";
}
}
else
{
ti.MethodName = "???";
}
yield return ti;
currentPointer = GetFieldValue(heap, currentTimerQueueTimerRef, "m_next");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment