Fix VS4Mac crash report and core dump generation perf problems (#60319)
This is a VS4Mac show stopper. The performance (4 min or so) of taking a core dump
when VS4Mac crashes or hangs is unacceptable.
Backport of #60205
Refactor the DAC enumerate memory region phase out of gather crash info
This is so the crash report json is written and available before the core
dump which for VS4Mac currently takes 4 minutes.
Since on both Linux and MacOS all the RW regions have been already added
by createdump itself for heap dumps, then the sometimes slow (4 minutes for
VS4Mac) heap enum memory region is changed to the faster normal one. It adds
necessary DAC globals, etc. without the costly assembly, module, class, type
runtime data structure enumeration.
This fast heap dumps is opt'ed in with COMPlus_DbgEnableFastHeapDumps=1 env var to mitigate the
risk of something missing from these dumps.
Tested creating a crash report/core dump against VS4Mac process. Ran all the SOS tests on MacOS and Linux against this change.
Low since there is an opt-in env var that enables the most risk part.