Skip to content

Commit 0b17ff8

Browse files
author
DESKTOP-UBV38B7\codingworks
committed
增加pdb,不然会丢失ILRuntime的部分组件
1 parent d26816a commit 0b17ff8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6364
-2
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ ExportedObj/
1818
*.pidb
1919
*.booproj
2020
*.svd
21-
*.pdb
2221
*.opendb
2322

2423
# Unity3D generated meta files
2524
*.pidb.meta
26-
*.pdb.meta
2725

2826
# Unity3D Generated File On Crash Reports
2927
sysinfo.txt

Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb.meta

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb/pdb.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb/pdb/Microsoft.Cci.Pdb.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
//-----------------------------------------------------------------------------
2+
//
3+
// Copyright (c) Microsoft. All rights reserved.
4+
// This code is licensed under the Microsoft Public License.
5+
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
6+
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
7+
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
8+
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
9+
//
10+
//-----------------------------------------------------------------------------
11+
using System;
12+
using System.IO;
13+
using System.Text;
14+
15+
namespace Microsoft.Cci.Pdb {
16+
internal class BitAccess {
17+
18+
internal BitAccess(int capacity) {
19+
this.buffer = new byte[capacity];
20+
}
21+
22+
internal byte[] Buffer {
23+
get { return buffer; }
24+
}
25+
private byte[] buffer;
26+
27+
internal void FillBuffer(Stream stream, int capacity) {
28+
MinCapacity(capacity);
29+
stream.Read(buffer, 0, capacity);
30+
offset = 0;
31+
}
32+
33+
internal void Append(Stream stream, int count) {
34+
int newCapacity = offset + count;
35+
if (buffer.Length < newCapacity) {
36+
byte[] newBuffer = new byte[newCapacity];
37+
Array.Copy(buffer, newBuffer, buffer.Length);
38+
buffer = newBuffer;
39+
}
40+
stream.Read(buffer, offset, count);
41+
offset += count;
42+
}
43+
44+
internal int Position {
45+
get { return offset; }
46+
set { offset = value; }
47+
}
48+
private int offset;
49+
50+
//internal void WriteBuffer(Stream stream, int count) {
51+
// stream.Write(buffer, 0, count);
52+
//}
53+
54+
internal void MinCapacity(int capacity) {
55+
if (buffer.Length < capacity) {
56+
buffer = new byte[capacity];
57+
}
58+
offset = 0;
59+
}
60+
61+
internal void Align(int alignment) {
62+
while ((offset % alignment) != 0) {
63+
offset++;
64+
}
65+
}
66+
67+
//internal void WriteInt32(int value) {
68+
// buffer[offset + 0] = (byte)value;
69+
// buffer[offset + 1] = (byte)(value >> 8);
70+
// buffer[offset + 2] = (byte)(value >> 16);
71+
// buffer[offset + 3] = (byte)(value >> 24);
72+
// offset += 4;
73+
//}
74+
75+
//internal void WriteInt32(int[] values) {
76+
// for (int i = 0; i < values.Length; i++) {
77+
// WriteInt32(values[i]);
78+
// }
79+
//}
80+
81+
//internal void WriteBytes(byte[] bytes) {
82+
// for (int i = 0; i < bytes.Length; i++) {
83+
// buffer[offset++] = bytes[i];
84+
// }
85+
//}
86+
87+
internal void ReadInt16(out short value) {
88+
value = (short)((buffer[offset + 0] & 0xFF) |
89+
(buffer[offset + 1] << 8));
90+
offset += 2;
91+
}
92+
93+
internal void ReadInt8(out sbyte value) {
94+
value = (sbyte)buffer[offset];
95+
offset += 1;
96+
}
97+
98+
internal void ReadInt32(out int value) {
99+
value = (int)((buffer[offset + 0] & 0xFF) |
100+
(buffer[offset + 1] << 8) |
101+
(buffer[offset + 2] << 16) |
102+
(buffer[offset + 3] << 24));
103+
offset += 4;
104+
}
105+
106+
internal void ReadInt64(out long value) {
107+
value = (long)(((ulong)buffer[offset + 0] & 0xFF) |
108+
((ulong)buffer[offset + 1] << 8) |
109+
((ulong)buffer[offset + 2] << 16) |
110+
((ulong)buffer[offset + 3] << 24) |
111+
((ulong)buffer[offset + 4] << 32) |
112+
((ulong)buffer[offset + 5] << 40) |
113+
((ulong)buffer[offset + 6] << 48) |
114+
((ulong)buffer[offset + 7] << 56));
115+
offset += 8;
116+
}
117+
118+
internal void ReadUInt16(out ushort value) {
119+
value = (ushort)((buffer[offset + 0] & 0xFF) |
120+
(buffer[offset + 1] << 8));
121+
offset += 2;
122+
}
123+
124+
internal void ReadUInt8(out byte value) {
125+
value = (byte)((buffer[offset + 0] & 0xFF));
126+
offset += 1;
127+
}
128+
129+
internal void ReadUInt32(out uint value) {
130+
value = (uint)((buffer[offset + 0] & 0xFF) |
131+
(buffer[offset + 1] << 8) |
132+
(buffer[offset + 2] << 16) |
133+
(buffer[offset + 3] << 24));
134+
offset += 4;
135+
}
136+
137+
internal void ReadUInt64(out ulong value) {
138+
value = (ulong)(((ulong)buffer[offset + 0] & 0xFF) |
139+
((ulong)buffer[offset + 1] << 8) |
140+
((ulong)buffer[offset + 2] << 16) |
141+
((ulong)buffer[offset + 3] << 24) |
142+
((ulong)buffer[offset + 4] << 32) |
143+
((ulong)buffer[offset + 5] << 40) |
144+
((ulong)buffer[offset + 6] << 48) |
145+
((ulong)buffer[offset + 7] << 56));
146+
offset += 8;
147+
}
148+
149+
internal void ReadInt32(int[] values) {
150+
for (int i = 0; i < values.Length; i++) {
151+
ReadInt32(out values[i]);
152+
}
153+
}
154+
155+
internal void ReadUInt32(uint[] values) {
156+
for (int i = 0; i < values.Length; i++) {
157+
ReadUInt32(out values[i]);
158+
}
159+
}
160+
161+
internal void ReadBytes(byte[] bytes) {
162+
for (int i = 0; i < bytes.Length; i++) {
163+
bytes[i] = buffer[offset++];
164+
}
165+
}
166+
167+
internal float ReadFloat() {
168+
float result = BitConverter.ToSingle(buffer, offset);
169+
offset += 4;
170+
return result;
171+
}
172+
173+
internal double ReadDouble() {
174+
double result = BitConverter.ToDouble(buffer, offset);
175+
offset += 8;
176+
return result;
177+
}
178+
179+
internal decimal ReadDecimal() {
180+
int[] bits = new int[4];
181+
this.ReadInt32(bits);
182+
return new decimal(bits[2], bits[3], bits[1], bits[0] < 0, (byte)((bits[0] & 0x00FF0000) >> 16));
183+
}
184+
185+
internal void ReadBString(out string value) {
186+
ushort len;
187+
this.ReadUInt16(out len);
188+
value = Encoding.UTF8.GetString(buffer, offset, len);
189+
offset += len;
190+
}
191+
192+
internal void ReadCString(out string value) {
193+
int len = 0;
194+
while (offset + len < buffer.Length && buffer[offset + len] != 0) {
195+
len++;
196+
}
197+
value = Encoding.UTF8.GetString(buffer, offset, len);
198+
offset += len + 1;
199+
}
200+
201+
internal void SkipCString(out string value) {
202+
int len = 0;
203+
while (offset + len < buffer.Length && buffer[offset + len] != 0) {
204+
len++;
205+
}
206+
offset += len + 1;
207+
value= null;
208+
}
209+
210+
internal void ReadGuid(out Guid guid) {
211+
uint a;
212+
ushort b;
213+
ushort c;
214+
byte d;
215+
byte e;
216+
byte f;
217+
byte g;
218+
byte h;
219+
byte i;
220+
byte j;
221+
byte k;
222+
223+
ReadUInt32(out a);
224+
ReadUInt16(out b);
225+
ReadUInt16(out c);
226+
ReadUInt8(out d);
227+
ReadUInt8(out e);
228+
ReadUInt8(out f);
229+
ReadUInt8(out g);
230+
ReadUInt8(out h);
231+
ReadUInt8(out i);
232+
ReadUInt8(out j);
233+
ReadUInt8(out k);
234+
235+
guid = new Guid(a, b, c, d, e, f, g, h, i, j, k);
236+
}
237+
238+
internal string ReadString() {
239+
int len = 0;
240+
while (offset + len < buffer.Length && buffer[offset + len] != 0) {
241+
len+=2;
242+
}
243+
string result = Encoding.Unicode.GetString(buffer, offset, len);
244+
offset += len + 2;
245+
return result;
246+
}
247+
248+
}
249+
}

Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb/pdb/Microsoft.Cci.Pdb/BitAccess.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
//-----------------------------------------------------------------------------
2+
//
3+
// Copyright (c) Microsoft. All rights reserved.
4+
// This code is licensed under the Microsoft Public License.
5+
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
6+
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
7+
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
8+
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
9+
//
10+
//-----------------------------------------------------------------------------
11+
using System;
12+
13+
namespace Microsoft.Cci.Pdb {
14+
internal struct BitSet {
15+
internal BitSet(BitAccess bits) {
16+
bits.ReadInt32(out size); // 0..3 : Number of words
17+
words = new uint[size];
18+
bits.ReadUInt32(words);
19+
}
20+
21+
//internal BitSet(int size) {
22+
// this.size = size;
23+
// words = new uint[size];
24+
//}
25+
26+
internal bool IsSet(int index) {
27+
int word = index / 32;
28+
if (word >= this.size) return false;
29+
return ((words[word] & GetBit(index)) != 0);
30+
}
31+
32+
//internal void Set(int index) {
33+
// int word = index / 32;
34+
// if (word >= this.size) return;
35+
// words[word] |= GetBit(index);
36+
//}
37+
38+
//internal void Clear(int index) {
39+
// int word = index / 32;
40+
// if (word >= this.size) return;
41+
// words[word] &= ~GetBit(index);
42+
//}
43+
44+
private static uint GetBit(int index) {
45+
return ((uint)1 << (index % 32));
46+
}
47+
48+
//private static uint ReverseBits(uint value) {
49+
// uint o = 0;
50+
// for (int i = 0; i < 32; i++) {
51+
// o = (o << 1) | (value & 1);
52+
// value >>= 1;
53+
// }
54+
// return o;
55+
//}
56+
57+
internal bool IsEmpty {
58+
get { return size == 0; }
59+
}
60+
61+
//internal bool GetWord(int index, out uint word) {
62+
// if (index < size) {
63+
// word = ReverseBits(words[index]);
64+
// return true;
65+
// }
66+
// word = 0;
67+
// return false;
68+
//}
69+
70+
private int size;
71+
private uint[] words;
72+
}
73+
74+
}

Assets/ThirdParty/ILRuntime/Mono.Cecil.Pdb/pdb/Microsoft.Cci.Pdb/BitSet.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)