Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit fdd684e

Browse files
committed
Dump in xml format, added public to classes and set accessor to properties needed for serialization
1 parent d162bd7 commit fdd684e

File tree

10 files changed

+403
-173
lines changed

10 files changed

+403
-173
lines changed

src/tools/r2rdump/GCInfo.cs

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace R2RDump
1111
{
12-
class GcInfo
12+
public class GcInfo
1313
{
1414
private enum GcInfoHeaderFlags
1515
{
@@ -33,8 +33,8 @@ private enum GcInfoHeaderFlags
3333

3434
public struct InterruptibleRange
3535
{
36-
public uint StartOffset { get; }
37-
public uint StopOffset { get; }
36+
public uint StartOffset { get; set; }
37+
public uint StopOffset { get; set; }
3838
public InterruptibleRange(uint start, uint stop)
3939
{
4040
StartOffset = start;
@@ -55,26 +55,28 @@ public InterruptibleRange(uint start, uint stop)
5555
private bool _hasSizeOfEditAndContinuePreservedArea;
5656
private bool _hasReversePInvokeFrame;
5757

58-
public int Version { get; }
59-
public int CodeLength { get; }
60-
public ReturnKinds ReturnKind { get; }
61-
public uint ValidRangeStart { get; }
62-
public uint ValidRangeEnd { get; }
63-
public int SecurityObjectStackSlot { get; }
64-
public int GSCookieStackSlot { get; }
65-
public int PSPSymStackSlot { get; }
66-
public int GenericsInstContextStackSlot { get; }
67-
public uint StackBaseRegister { get; }
68-
public uint SizeOfEditAndContinuePreservedArea { get; }
69-
public int ReversePInvokeFrameStackSlot { get; }
70-
public uint SizeOfStackOutgoingAndScratchArea { get; }
71-
public uint NumSafePoints { get; }
72-
public uint NumInterruptibleRanges { get; }
73-
public IEnumerable<uint> SafePointOffsets { get; }
74-
public IEnumerable<InterruptibleRange> InterruptibleRanges { get; }
75-
public GcSlotTable SlotTable { get; }
76-
public int Size { get; }
77-
public int Offset { get; }
58+
public int Version { get; set; }
59+
public int CodeLength { get; set; }
60+
public ReturnKinds ReturnKind { get; set; }
61+
public uint ValidRangeStart { get; set; }
62+
public uint ValidRangeEnd { get; set; }
63+
public int SecurityObjectStackSlot { get; set; }
64+
public int GSCookieStackSlot { get; set; }
65+
public int PSPSymStackSlot { get; set; }
66+
public int GenericsInstContextStackSlot { get; set; }
67+
public uint StackBaseRegister { get; set; }
68+
public uint SizeOfEditAndContinuePreservedArea { get; set; }
69+
public int ReversePInvokeFrameStackSlot { get; set; }
70+
public uint SizeOfStackOutgoingAndScratchArea { get; set; }
71+
public uint NumSafePoints { get; set; }
72+
public uint NumInterruptibleRanges { get; set; }
73+
public List<uint> SafePointOffsets { get; set; }
74+
public List<InterruptibleRange> InterruptibleRanges { get; set; }
75+
public GcSlotTable SlotTable { get; set; }
76+
public int Size { get; set; }
77+
public int Offset { get; set; }
78+
79+
public GcInfo() { }
7880

7981
public GcInfo(byte[] image, int offset, Machine machine, ushort majorVersion)
8082
{
@@ -249,7 +251,7 @@ private void ParseHeaderFlags(byte[] image, ref int bitOffset)
249251
}
250252
}
251253

252-
private IEnumerable<uint> EnumerateSafePoints(byte[] image, ref int bitOffset)
254+
private List<uint> EnumerateSafePoints(byte[] image, ref int bitOffset)
253255
{
254256
List<uint> safePoints = new List<uint>();
255257
uint numBitsPerOffset = GcInfoTypes.CeilOfLog2(CodeLength);
@@ -261,7 +263,7 @@ private IEnumerable<uint> EnumerateSafePoints(byte[] image, ref int bitOffset)
261263
return safePoints;
262264
}
263265

264-
private IEnumerable<InterruptibleRange> EnumerateInterruptibleRanges(byte[] image, int interruptibleRangeDelta1EncBase, int interruptibleRangeDelta2EncBase, ref int bitOffset)
266+
private List<InterruptibleRange> EnumerateInterruptibleRanges(byte[] image, int interruptibleRangeDelta1EncBase, int interruptibleRangeDelta2EncBase, ref int bitOffset)
265267
{
266268
List<InterruptibleRange> ranges = new List<InterruptibleRange>();
267269
uint lastinterruptibleRangeStopOffset = 0;

src/tools/r2rdump/GCInfoTypes.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace R2RDump
1010
{
11-
class GcInfoTypes
11+
public class GcInfoTypes
1212
{
1313
private Machine _target;
1414

@@ -195,8 +195,11 @@ public enum GcStackSlotBase
195195

196196
public class GcStackSlot
197197
{
198-
public int SpOffset { get; }
199-
public GcStackSlotBase Base { get; }
198+
public int SpOffset { get; set; }
199+
public GcStackSlotBase Base { get; set; }
200+
201+
public GcStackSlot() { }
202+
200203
public GcStackSlot(int spOffset, GcStackSlotBase stackSlotBase)
201204
{
202205
SpOffset = spOffset;

src/tools/r2rdump/GCSlotTable.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
namespace R2RDump
1111
{
12-
class GcSlotTable
12+
public class GcSlotTable
1313
{
1414
public struct GcSlot
1515
{
16-
public int RegisterNumber { get; }
17-
public GcStackSlot StackSlot { get; }
18-
public GcSlotFlags Flags { get; }
16+
public int RegisterNumber { get; set; }
17+
public GcStackSlot StackSlot { get; set; }
18+
public GcSlotFlags Flags { get; set; }
1919

2020
public GcSlot(int registerNumber, GcStackSlot stack, GcSlotFlags flags)
2121
{
@@ -44,11 +44,13 @@ public override string ToString()
4444
}
4545
}
4646

47-
public uint NumRegisters { get; }
48-
public uint NumStackSlots { get; }
49-
public uint NumUntracked { get; }
50-
public uint NumSlots { get; }
51-
public List<GcSlot> GcSlots { get; }
47+
public uint NumRegisters { get; set; }
48+
public uint NumStackSlots { get; set; }
49+
public uint NumUntracked { get; set; }
50+
public uint NumSlots { get; set; }
51+
public List<GcSlot> GcSlots { get; set; }
52+
53+
public GcSlotTable() { }
5254

5355
public GcSlotTable(byte[] image, Machine machine, GcInfoTypes gcInfoTypes, ref int bitOffset)
5456
{

0 commit comments

Comments
 (0)