Skip to content

Commit 260a306

Browse files
Improve SuperPMI error message for JIT asserts (dotnet#63229)
Currently, the method context numbers are output for each failure, but the assert message is output separately, so if there are multiple asserts that fire, and you want to investigate a particular one, it's hard to figure out which method context number to use. Add the method context number to the assert message, so the relationship between the method context number and the assert is obvious. E.g., you always get messages like the following (both before this change and after): ``` ERROR: Exception thrown: DebugBreak or AV Exception 123 ERROR: main method 16501 of size 286 failed to load and compile correctly. ``` Before you might see an assert like: ``` ISSUE: <ASSERT> C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286) ``` Now, it will look like: ``` ISSUE: <ASSERT> dotnet#16501 C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286) ```
1 parent a78ad5e commit 260a306

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/ToolBox/superpmi/superpmi/icorjitinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1782,7 +1782,7 @@ int MyICJI::doAssert(const char* szFile, int iLine, const char* szExpr)
17821782
char buff[16 * 1024];
17831783
sprintf_s(buff, sizeof(buff), "%s (%d) - %s", szFile, iLine, szExpr);
17841784

1785-
LogIssue(ISSUE_ASSERT, "%s", buff);
1785+
LogIssue(ISSUE_ASSERT, "#%d %s", jitInstance->mc->index, buff);
17861786
jitInstance->mc->cr->recMessageLog(buff);
17871787

17881788
// Under "/boa", ask the user if they want to attach a debugger. If they do, the debugger will be attached,

0 commit comments

Comments
 (0)