From: Mike McLaughlin Date: Tue, 5 Feb 2019 23:52:12 +0000 (-0800) Subject: GCWhere failure diagnostics. X-Git-Tag: submit/tizen/20190813.035844~58^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72f26023763a1fb9386756f66e0ff0443e2ea0e1;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git GCWhere failure diagnostics. --- diff --git a/src/SOS/SOS.UnitTests/Debuggees/GCWhere/GCWhere.cs b/src/SOS/SOS.UnitTests/Debuggees/GCWhere/GCWhere.cs index dadbcadc0..37997e5cf 100644 --- a/src/SOS/SOS.UnitTests/Debuggees/GCWhere/GCWhere.cs +++ b/src/SOS/SOS.UnitTests/Debuggees/GCWhere/GCWhere.cs @@ -30,12 +30,17 @@ class GCWhere static int Main() { GCWhere temp = new GCWhere("This is a string!!"); + int genFirstTime = GC.GetGeneration(temp); Debugger.Break(); // GCWhere should temp in Gen0 GC.Collect(); + int genSecondTime = GC.GetGeneration(temp); Debugger.Break(); // GCWhere should temp in Gen1 GC.Collect(); + int genThirdTime = GC.GetGeneration(temp); Debugger.Break(); // GCWhere should temp in Gen2 GC.Collect(); + int genFourthTime = GC.GetGeneration(temp); + Console.WriteLine("1st: {0} 2nd: {1}, 3rd: {2} 4th: {3}", genFirstTime, genSecondTime, genThirdTime, genFourthTime); Debugger.Break(); // GCWhere should temp in Gen2 PrintIt(temp); GC.KeepAlive(temp); diff --git a/src/SOS/SOS.UnitTests/Scripts/GCTests.script b/src/SOS/SOS.UnitTests/Scripts/GCTests.script index b4d620655..bb42e3377 100644 --- a/src/SOS/SOS.UnitTests/Scripts/GCTests.script +++ b/src/SOS/SOS.UnitTests/Scripts/GCTests.script @@ -32,11 +32,11 @@ VERIFY:\s+0\s+\d\s+\s+\s+\s+0x\s*\(\d+\) SOSCOMMAND:GCRoot VERIFY:.*Thread : -VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+33\]\s+ +VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+34\]\s+ SOSCOMMAND:GCRoot -all VERIFY:.*Thread : -VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+33\]\s+ +VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+34\]\s+ SOSCOMMAND:DumpObj VERIFY:\s*Name:\s+GCWhere\s+ @@ -103,11 +103,11 @@ VERIFY:\s+1\s+\d\s+\s+\s+\s+0x\s*\(\d+\) SOSCOMMAND:GCRoot VERIFY:.*Thread : -VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+35\]\s+ +VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+37\]\s+ SOSCOMMAND:GCRoot -all VERIFY:.*Thread : -VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+35\]\s+ +VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+37\]\s+ SOSCOMMAND:DumpObj VERIFY:\s*Name:\s+GCWhere\s+ @@ -137,6 +137,7 @@ IFDEF:CDB VERIFY:Break instruction exception - code 80000003 ENDIF:CDB +SOSCOMMAND:EEHeap -gc SOSCOMMAND:DumpStackObjects SOSCOMMAND:GCWhere \w+\s+()\s+([Gg][Cc]where!\$0_)*GCWhere\s+ # we care that the Gen is 2 @@ -144,7 +145,7 @@ VERIFY:\s+2\s+\d\s+\s+\s+\s+0x\s*\(\d+\) SOSCOMMAND:GCRoot VERIFY:.*Thread : -VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+37\]\s+ +VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+40\]\s+ # Continue to the next DebugBreak CONTINUE @@ -152,14 +153,15 @@ IFDEF:CDB VERIFY:Break instruction exception - code 80000003 ENDIF:CDB +SOSCOMMAND:EEHeap -gc SOSCOMMAND:DumpStackObjects SOSCOMMAND:GCWhere \w+\s+()\s+([Gg][Cc]where!\$0_)*GCWhere\s+ -# we care that the Gen is still 2 -VERIFY:\s+2\s+\d\s+\s+\s+\s+0x\s*\(\d+\) +# we care that the Gen is still 2 or 0 on Windows 3.x +VERIFY:\s+[02]\s+\d\s+\s+\s+\s+0x\s*\(\d+\) SOSCOMMAND:GCRoot VERIFY:.*Thread : -VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+39\]\s+ +VERIFY:\s+\s+\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+44\]\s+ # Continue to the next DebugBreak CONTINUE diff --git a/src/SOS/Strike/util.h b/src/SOS/Strike/util.h index 9660e009a..625a02298 100644 --- a/src/SOS/Strike/util.h +++ b/src/SOS/Strike/util.h @@ -46,15 +46,15 @@ DECLARE_HANDLE(OBJECTHANDLE); struct IMDInternalImport; #if defined(_TARGET_WIN64_) -#define WIN64_8SPACES "" -#define WIN86_8SPACES " " +#define WIN64_8SPACES " " +#define WIN86_8SPACES "" #define POINTERSIZE "16" #define POINTERSIZE_HEX 16 #define POINTERSIZE_BYTES 8 #define POINTERSIZE_TYPE "I64" #else -#define WIN64_8SPACES " " -#define WIN86_8SPACES "" +#define WIN64_8SPACES "" +#define WIN86_8SPACES " " #define POINTERSIZE "8" #define POINTERSIZE_HEX 8 #define POINTERSIZE_BYTES 4