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);
SOSCOMMAND:GCRoot <PREVPOUT>
VERIFY:.*Thread <HEXVAL>:
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+33\]\s+
+VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+34\]\s+
SOSCOMMAND:GCRoot -all <PREVPOUT>
VERIFY:.*Thread <HEXVAL>:
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+33\]\s+
+VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+34\]\s+
SOSCOMMAND:DumpObj <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
SOSCOMMAND:GCRoot <PREVPOUT>
VERIFY:.*Thread <HEXVAL>:
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+35\]\s+
+VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+37\]\s+
SOSCOMMAND:GCRoot -all <PREVPOUT>
VERIFY:.*Thread <HEXVAL>:
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+35\]\s+
+VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[Gg][Cc][Ww]here\.cs\s+@\s+37\]\s+
SOSCOMMAND:DumpObj <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:Break instruction exception - code 80000003
ENDIF:CDB
+SOSCOMMAND:EEHeap -gc
SOSCOMMAND:DumpStackObjects
SOSCOMMAND:GCWhere <POUT>\w+\s+(<HEXVAL>)\s+([Gg][Cc]where!\$0_)*GCWhere\s+<POUT>
# we care that the Gen is 2
SOSCOMMAND:GCRoot <PREVPOUT>
VERIFY:.*Thread <HEXVAL>:
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+37\]\s+
+VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+40\]\s+
# Continue to the next DebugBreak
CONTINUE
VERIFY:Break instruction exception - code 80000003
ENDIF:CDB
+SOSCOMMAND:EEHeap -gc
SOSCOMMAND:DumpStackObjects
SOSCOMMAND:GCWhere <POUT>\w+\s+(<HEXVAL>)\s+([Gg][Cc]where!\$0_)*GCWhere\s+<POUT>
-# we care that the Gen is still 2
-VERIFY:<HEXVAL>\s+2\s+\d\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+0x<HEXVAL>\s*\(\d+\)
+# we care that the Gen is still 2 or 0 on Windows 3.x
+VERIFY:<HEXVAL>\s+[02]\s+\d\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+0x<HEXVAL>\s*\(\d+\)
SOSCOMMAND:GCRoot <PREVPOUT>
VERIFY:.*Thread <HEXVAL>:
-VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+39\]\s+
+VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+GCWhere\.Main\(\)\s+\[.*[/|\\][Gg][Cc][Ww]here\.cs\s+@\s+44\]\s+
# Continue to the next DebugBreak
CONTINUE
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