JIT: add hash and tiering name to assert message (#66107)
authorAndy Ayers <andya@microsoft.com>
Thu, 3 Mar 2022 01:11:01 +0000 (17:11 -0800)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 01:11:01 +0000 (17:11 -0800)
Now that methods may be jitted multiple times and may have complex names, it is
useful to know their hashes and tiering names as part of asserts.

src/coreclr/jit/error.cpp

index dfb5a85..b5af431 100644 (file)
@@ -280,8 +280,10 @@ extern "C" void __cdecl assertAbort(const char* why, const char* file, unsigned
     if (env->compiler)
     {
         phaseName = PhaseNames[env->compiler->mostRecentlyActivePhase];
-        _snprintf_s(buff, BUFF_SIZE, _TRUNCATE, "Assertion failed '%s' in '%s' during '%s' (IL size %d)\n", why,
-                    env->compiler->info.compFullName, phaseName, env->compiler->info.compILCodeSize);
+        _snprintf_s(buff, BUFF_SIZE, _TRUNCATE,
+                    "Assertion failed '%s' in '%s' during '%s' (IL size %d; hash 0x%08x; %s)\n", why,
+                    env->compiler->info.compFullName, phaseName, env->compiler->info.compILCodeSize,
+                    env->compiler->info.compMethodHash(), env->compiler->compGetTieringName(/* short name */ true));
         msg = buff;
     }
     printf(""); // null string means flush