1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 /*****************************************************************************
7 * Defines functions to display the GCInfo as defined by the GC-encoding
8 * spec. The GC information may be either dynamically created by a
9 * Just-In-Time compiler conforming to the standard code-manager spec,
10 * or may be persisted by a managed native code compiler conforming
11 * to the standard code-manager spec.
15 #include "utilcode.h" // For _ASSERTE()
19 /*****************************************************************************/
23 GCDump::GCDump(UINT32 gcInfoVer, bool encBytes, unsigned maxEncBytes, bool dumpCodeOffs)
24 : gcInfoVersion (gcInfoVer),
25 fDumpEncBytes (encBytes ),
26 cMaxEncBytes (maxEncBytes ),
27 fDumpCodeOffsets(dumpCodeOffs)
29 // By default, use the standard printf function to dump
30 GCDump::gcPrintf = (printfFtn) ::printf;
33 /*****************************************************************************
35 * Display the byte encodings for the given range of the GC tables.
38 PTR_CBYTE GCDump::DumpEncoding(PTR_CBYTE gcInfoBlock, int cDumpBytes)
40 _ASSERTE((cDumpBytes >= 0) && (cMaxEncBytes < 256));
48 for (count = cMaxEncBytes, cBytesLeft = cDumpBytes, pCurPos = gcInfoBlock;
50 count--, pCurPos++, cBytesLeft--)
54 if (cBytesLeft > 1 && count == 1)
57 gcPrintf("%02X ", *pCurPos);
66 return gcInfoBlock + cDumpBytes;
69 /*****************************************************************************/
71 void GCDump::DumpOffset(unsigned o)
76 void GCDump::DumpOffsetEx(unsigned o)
82 /*****************************************************************************/