Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -97,16 +97,20 @@ namespace Pdb2Mdb {
void ConvertScope (PdbScope scope)
{
ConvertSlots (scope.slots);
ConvertSlots (scope, scope.slots);
foreach (var s in scope.scopes)
ConvertScope (s);
}
void ConvertSlots (IEnumerable<PdbSlot> slots)
void ConvertSlots (PdbScope scope, IEnumerable<PdbSlot> slots)
{
foreach (var slot in slots)
int scope_idx = mdb.OpenScope ((int)scope.address);
foreach (var slot in slots) {
mdb.DefineLocalVariable ((int) slot.slot, slot.name);
mdb.DefineScopeVariable (scope_idx, (int)slot.slot);
}
mdb.CloseScope ((int)(scope.address + scope.length));
}
SourceFile GetSourceFile (MonoSymbolWriter mdb, PdbFunction function)

View File

@@ -266,12 +266,13 @@ namespace Microsoft.Cci.Pdb {
bits.ReadUInt32(out block.parent);
bits.ReadUInt32(out block.end);
bits.ReadUInt32(out block.len);
bits.ReadUInt32(out this.address);
bits.ReadUInt32(out block.off);
bits.ReadUInt16(out block.seg);
bits.SkipCString(out block.name);
bits.Position = stop;
this.address = block.off;
scopes[scope] = new PdbScope(block, bits, out slotToken);
scopes[scope] = new PdbScope(this.address, block, bits, out slotToken);
bits.Position = (int)block.end;
break;
}
@@ -324,7 +325,6 @@ namespace Microsoft.Cci.Pdb {
case 2: 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;
}

View File

@@ -16,9 +16,9 @@ namespace Microsoft.Cci.Pdb {
internal uint address;
internal uint length;
internal PdbScope(BlockSym32 block, BitAccess bits, out uint typind) {
internal PdbScope(uint funcAddress, BlockSym32 block, BitAccess bits, out uint typind) {
this.segment = block.seg;
this.address = block.off;
this.address = block.off - funcAddress;
this.length = block.len;
typind = 0;
@@ -58,7 +58,7 @@ namespace Microsoft.Cci.Pdb {
bits.SkipCString(out sub.name);
bits.Position = stop;
scopes[scope++] = new PdbScope(sub, bits, out typind);
scopes[scope++] = new PdbScope(funcAddress, sub, bits, out typind);
break;
}