Skip to content

Instantly share code, notes, and snippets.

@krk
Created June 27, 2017 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krk/d7ae9fbb962f1c03b3bbd0e764542f76 to your computer and use it in GitHub Desktop.
Save krk/d7ae9fbb962f1c03b3bbd0e764542f76 to your computer and use it in GitHub Desktop.
private void ReadCustomMetadata(BitAccess bits) {
int savedPosition = bits.Position;
byte version;
bits.ReadUInt8(out version);
if (version != 4) {
throw new PdbDebugException("Unknown custom metadata item version: {0}", version);
}
byte kind;
bits.ReadUInt8(out kind);
bits.Align(4);
uint numberOfBytesInItem;
bits.ReadUInt32(out numberOfBytesInItem);
switch (kind) {
case 0: this.ReadUsingInfo(bits); break;
case 1: this.ReadForwardInfo(bits); break;
case 2: break; // this.ReadForwardedToModuleInfo(bits); break;
case 3: this.ReadIteratorLocals(bits); break;
case 4: this.ReadForwardIterator(bits); break;
default: throw new PdbDebugException("Unknown custom metadata item kind: {0}", kind);
}
bits.Position = savedPosition+(int)numberOfBytesInItem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment