mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 19:10:23 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2060885a61 | ||
|
|
454dcdbf14 | ||
|
|
f1e2dea617 | ||
|
|
aeb0f402b0 | ||
|
|
a9c99094e5 | ||
|
|
07dadd18e6 | ||
|
|
dfacc317bb | ||
|
|
50d954e407 | ||
|
|
d3654afcba | ||
|
|
055226227b | ||
|
|
4df4036832 | ||
|
|
0e54ff0114 | ||
|
|
fdac2e4440 | ||
|
|
de5d618bba | ||
|
|
f5895c6858 | ||
|
|
b927f644a1 | ||
|
|
eea28c3d23 | ||
|
|
8574ac82b3 | ||
|
|
391cd6613a | ||
|
|
3dfe241caa | ||
|
|
8be3df2b99 | ||
|
|
1c4c28a73b | ||
|
|
367d52afe7 | ||
|
|
10fbbd6de6 | ||
|
|
783ac37230 | ||
|
|
cf85b96e59 | ||
|
|
bb5893fd12 | ||
|
|
f2e90236bb | ||
|
|
7a2d262277 | ||
|
|
2cf49db82d | ||
|
|
12b25d25c1 | ||
|
|
bb16b9c077 | ||
|
|
8edca8c7e4 | ||
|
|
c01ccfa6f9 | ||
|
|
139aad4a64 | ||
|
|
bf97c0f83d | ||
|
|
2ef83b66ab | ||
|
|
604542bea7 | ||
|
|
71178114f2 | ||
|
|
e000f7dd39 | ||
|
|
dd1e6a5c10 | ||
|
|
2203f51858 | ||
|
|
0037b58a94 | ||
|
|
d481bfdf60 | ||
|
|
4bb37638b2 | ||
|
|
e04dfe9f14 | ||
|
|
5f0e61d090 | ||
|
|
0eb502a6bd | ||
|
|
7487ebe7dc | ||
|
|
519d06df66 | ||
|
|
a1f03ed082 | ||
|
|
110f012a21 | ||
|
|
ad25b25d96 | ||
|
|
ee5cee70b6 | ||
|
|
61ed992ec2 | ||
|
|
eb89850b2e | ||
|
|
e80c1f995b | ||
|
|
643cb4cece | ||
|
|
c04e247ac7 | ||
|
|
a71b02136a | ||
|
|
2e92d252d3 | ||
|
|
73094fe20a | ||
|
|
f3cf15ac50 | ||
|
|
e90b829c52 | ||
|
|
ad95a40a96 | ||
|
|
5fef166878 | ||
|
|
ebcbb5fca0 | ||
|
|
8403be52d1 | ||
|
|
a657e86da3 | ||
|
|
e94b7baef0 | ||
|
|
b3aabafaa5 | ||
|
|
e0063d14b3 | ||
|
|
a1e50dc4c2 | ||
|
|
e742eb5e0e | ||
|
|
6034ab0b3e | ||
|
|
da6130fc83 | ||
|
|
2de418a43d | ||
|
|
2386cc7881 | ||
|
|
9056983301 | ||
|
|
78cefb0f7b | ||
|
|
6a89f19c0d | ||
|
|
4e22c5b894 | ||
|
|
6c03dfc7f7 | ||
|
|
dbb66e9867 | ||
|
|
62cc2c3017 | ||
|
|
fb12a3e446 | ||
|
|
2021462e95 | ||
|
|
86d6940fac | ||
|
|
4e1aed55c0 | ||
|
|
688cde0904 | ||
|
|
ffa9b1f8a4 | ||
|
|
e135755a10 | ||
|
|
e976db7f29 | ||
|
|
7c83de8e4b | ||
|
|
5d8eab5ec8 | ||
|
|
0032d48b02 | ||
|
|
734d904e3e | ||
|
|
06c96bb5d1 | ||
|
|
b8bdaccfda | ||
|
|
3e7f3ae17c | ||
|
|
c1595a2d68 | ||
|
|
3ee422999e | ||
|
|
a2a8d1547f | ||
|
|
e2440e9757 | ||
|
|
4ba3ae74aa | ||
|
|
b5f0912fcd | ||
|
|
c94963533c | ||
|
|
72e36542ad | ||
|
|
02253ae5cd | ||
|
|
7997efba36 | ||
|
|
68e9564374 | ||
|
|
7ef9bfb6a3 | ||
|
|
a20fc7fc78 | ||
|
|
89b878c5df | ||
|
|
e751b881bf | ||
|
|
31d8c204a5 | ||
|
|
49efecf987 | ||
|
|
73b75c4bef | ||
|
|
6c3be28a21 | ||
|
|
0544e9c682 | ||
|
|
23bb65c7a5 | ||
|
|
4372c15832 | ||
|
|
a724359910 | ||
|
|
ff4ec3d133 | ||
|
|
26c28da391 | ||
|
|
b55c75b6e8 | ||
|
|
469bc8f420 | ||
|
|
5877256e30 | ||
|
|
b2d22b5280 | ||
|
|
f9b5964873 | ||
|
|
8423c62e96 | ||
|
|
64dc6f0c67 | ||
|
|
2399ceea61 | ||
|
|
7b6b950e75 | ||
|
|
b3c0ac9e01 | ||
|
|
59d02c87d9 | ||
|
|
593854090b | ||
|
|
1a166dda7f | ||
|
|
26e16e4f03 | ||
|
|
cc02964701 | ||
|
|
279b42114e | ||
|
|
149657947f | ||
|
|
357528fd8f | ||
|
|
5e66030ed3 | ||
|
|
0860aa1384 | ||
|
|
281f0d64b0 | ||
|
|
447eb0ca67 | ||
|
|
e335c3c1a5 | ||
|
|
062b365f91 | ||
|
|
e3df4e4f28 | ||
|
|
e05854d185 | ||
|
|
6500bbb03b | ||
|
|
6f85fc7bd9 | ||
|
|
3c63374b42 | ||
|
|
afcfff04a2 | ||
|
|
07aae53fac | ||
|
|
73692dfb45 | ||
|
|
ff90b8ddf9 | ||
|
|
711cd36714 | ||
|
|
7e5aeaec40 | ||
|
|
8db33b5870 | ||
|
|
848e0d00ed | ||
|
|
80e1821593 | ||
|
|
e9d574a279 | ||
|
|
6b24be88df | ||
|
|
72e148a30f | ||
|
|
b5f6dcaa76 | ||
|
|
b6688165af | ||
|
|
ba422481d9 | ||
|
|
dda30d78db | ||
|
|
0d05c3f3ad | ||
|
|
12f74ca39f | ||
|
|
6a7f5875ba | ||
|
|
afd46500d4 | ||
|
|
8e90ead220 | ||
|
|
6706e60bd6 | ||
|
|
62f353dcb1 | ||
|
|
9a47cec765 | ||
|
|
162bc3d1f5 | ||
|
|
bd17401c0b | ||
|
|
079e9ba377 | ||
|
|
7b119ca3dd | ||
|
|
7b72546da7 | ||
|
|
14043542c4 | ||
|
|
99dc6fbb98 | ||
|
|
0d5c1c0dd8 | ||
|
|
ae4a470206 | ||
|
|
ec02f3a0bc | ||
|
|
6947f0572d | ||
|
|
eb13c3c328 | ||
|
|
38cee46306 | ||
|
|
b007341324 | ||
|
|
045eaf1f77 | ||
|
|
14d6027ca5 | ||
|
|
3ce9a0001a | ||
|
|
79f8741a6f | ||
|
|
df0838678e | ||
|
|
dba32d8363 | ||
|
|
e9e273a33b | ||
|
|
3eedd84b18 | ||
|
|
0a7663f9d5 | ||
|
|
999104f3d0 | ||
|
|
9736241ce6 | ||
|
|
0bcab3f27c | ||
|
|
c556617566 | ||
|
|
6d07086de5 | ||
|
|
e9f6f3b943 | ||
|
|
d8b7637801 | ||
|
|
c55b3d8237 | ||
|
|
7b527404dd | ||
|
|
f9fcc1d75e | ||
|
|
7faec3f1be | ||
|
|
f6e3aaa0b1 | ||
|
|
e1a0fb9915 | ||
|
|
7a11028c33 | ||
|
|
4d00f22660 | ||
|
|
021524678e | ||
|
|
f22633ce5f | ||
|
|
e58b64a8f7 | ||
|
|
c1728ca2d8 | ||
|
|
31891eac8e | ||
|
|
709edea6bc | ||
|
|
f7fa3e9881 | ||
|
|
8125abef6b | ||
|
|
0c2ce64528 | ||
|
|
4786e2ce84 | ||
|
|
aa0acdf4b2 | ||
|
|
b8f3703cd2 | ||
|
|
9f4c5d1676 | ||
|
|
f13b9706bf | ||
|
|
6918735598 | ||
|
|
a98017c882 | ||
|
|
68f4f02905 | ||
|
|
16e0c171f6 | ||
|
|
ca050ddc0d | ||
|
|
da120aecba | ||
|
|
ffe1660a03 | ||
|
|
23b3aa1be5 | ||
|
|
8928220dab | ||
|
|
76f71ea43b | ||
|
|
9f997ad5cd | ||
|
|
7e6e368b3f | ||
|
|
abcf740ff1 | ||
|
|
bebcc60989 | ||
|
|
c1b04d89b3 | ||
|
|
93ed6ca92a | ||
|
|
d17799bf9a | ||
|
|
8421f2e98c | ||
|
|
e4667928cb | ||
|
|
7d9658d15a | ||
|
|
f8a4aeba3f | ||
|
|
bbec6a7fb9 | ||
|
|
695ddcd816 | ||
|
|
03d3f9b784 | ||
|
|
74467c031a | ||
|
|
3eeddbd69d | ||
|
|
3b8e6c5823 | ||
|
|
db76d32644 | ||
|
|
9b1aad2b6f | ||
|
|
501655c80d | ||
|
|
be956b47ec | ||
|
|
6407333030 | ||
|
|
ffb41f4845 | ||
|
|
25f808006a | ||
|
|
16e839a58d | ||
|
|
c9d6bbeb43 | ||
|
|
1e60974b30 | ||
|
|
0bc22702d7 | ||
|
|
b5cd8474f8 | ||
|
|
c50d7b5903 | ||
|
|
2d9580e265 | ||
|
|
685ae9720b | ||
|
|
f6d17c09aa | ||
|
|
59a19aba9a | ||
|
|
6914d4218b | ||
|
|
9749a97dc5 | ||
|
|
132cd42b52 | ||
|
|
2bfd7fce53 | ||
|
|
1fb1efbead | ||
|
|
52dfba4436 | ||
|
|
392d8a86c0 | ||
|
|
a1af8aab94 | ||
|
|
d44b07c77a | ||
|
|
ec10d849ad | ||
|
|
1328a6f481 | ||
|
|
3df5349721 | ||
|
|
5d9454bbbd | ||
|
|
aa086e723d | ||
|
|
4c4187ac70 | ||
|
|
18bcfe421b | ||
|
|
01e83c57f2 | ||
|
|
115a1bc919 | ||
|
|
e8824ac3e4 | ||
|
|
ca3c45f076 | ||
|
|
f2bce6f4ce | ||
|
|
e3a5c81cda | ||
|
|
5b96bba155 | ||
|
|
36cbf13e9b | ||
|
|
2ef5ab765d | ||
|
|
1d5f157767 | ||
|
|
b358c5c6ba | ||
|
|
826216fc0a | ||
|
|
999e715866 | ||
|
|
eba68d5a04 | ||
|
|
a7586e9345 | ||
|
|
8099daa3f3 | ||
|
|
2569eb1b80 | ||
|
|
d1eb94eb67 | ||
|
|
d554416afa | ||
|
|
8cfefa5129 | ||
|
|
9819ad6367 | ||
|
|
e148821cdd | ||
|
|
3fcb6699a2 | ||
|
|
d45d3ca5cd | ||
|
|
ec9cd9342d | ||
|
|
f77e88e224 | ||
|
|
2e6da6116b | ||
|
|
7ee74a2c67 | ||
|
|
5f2723750f | ||
|
|
901e27abde | ||
|
|
096cca20dc | ||
|
|
94280409f0 | ||
|
|
ef71ae0b4c | ||
|
|
e4db77f4fb | ||
|
|
b50d9debff | ||
|
|
e95210cc26 | ||
|
|
7a50edd0f8 | ||
|
|
73ef4bfacc | ||
|
|
2db249b6c6 | ||
|
|
f0a3f6ff0c | ||
|
|
dc405bc445 | ||
|
|
432d688ab2 | ||
|
|
56e0f5c928 | ||
|
|
0bfa6eba80 | ||
|
|
8d6c1867c0 | ||
|
|
e3f4037161 | ||
|
|
e53b062a80 | ||
|
|
d5725f2ff1 | ||
|
|
db16975b2c | ||
|
|
276270710a | ||
|
|
2176ccd445 | ||
|
|
708f7135e8 | ||
|
|
fc844c6c01 | ||
|
|
a52c79cb41 | ||
|
|
5a58a1b09c | ||
|
|
32bd01ec10 | ||
|
|
b407458d97 | ||
|
|
474fe75047 | ||
|
|
a49dae415f | ||
|
|
0d3a9e6aaf | ||
|
|
234ede86c6 | ||
|
|
643a34dd9a | ||
|
|
62f60f8731 | ||
|
|
1b0029d99e | ||
|
|
f03736cdec | ||
|
|
2ff1173034 | ||
|
|
59dc9ab7df | ||
|
|
17813fc84d | ||
|
|
cc1d059ed0 | ||
|
|
6d7b54637f | ||
|
|
a9de18eec9 | ||
|
|
cda70e3aea | ||
|
|
e2ec2cde28 | ||
|
|
057909bc36 | ||
|
|
93aff8c4da | ||
|
|
5f79974ab1 | ||
|
|
0f54d4b16f | ||
|
|
83b8fc6048 | ||
|
|
cc40965131 | ||
|
|
f973f337e3 | ||
|
|
cf42c5be87 | ||
|
|
afdd7b1d16 | ||
|
|
0239aa7828 | ||
|
|
d01a931d9f | ||
|
|
5f1b4c67f5 | ||
|
|
fdcb013b16 | ||
|
|
021c2720cf | ||
|
|
ba88a15e12 | ||
|
|
a03ff8d5ba | ||
|
|
4301d72d8c | ||
|
|
03317f7a4c | ||
|
|
77f0cd8d73 | ||
|
|
c57901837e | ||
|
|
2cb13bd9a8 | ||
|
|
b44bec6c3f | ||
|
|
7837ad922c | ||
|
|
c594caf965 | ||
|
|
85cf5e87a3 | ||
|
|
ef94f0465d | ||
|
|
fe249c988a | ||
|
|
b62468c7ec | ||
|
|
2b48d1c45b | ||
|
|
cbe5c9f1d7 | ||
|
|
9848badf22 | ||
|
|
29b37ee691 | ||
|
|
c991b0d27d | ||
|
|
c77d9a071f | ||
|
|
0160dcc880 | ||
|
|
b88507b22a | ||
|
|
101bcbc576 | ||
|
|
1bc7a5c672 | ||
|
|
affee047b3 | ||
|
|
cf3b279815 | ||
|
|
38435c8147 | ||
|
|
4c015b6312 | ||
|
|
5cff2490a6 | ||
|
|
ff0eb523ec | ||
|
|
02133437a9 | ||
|
|
a1bf6e0ea7 | ||
|
|
41681b5c8d | ||
|
|
5ac4160881 | ||
|
|
51853f78b0 | ||
|
|
b86562e6d7 | ||
|
|
5d84732a2a | ||
|
|
d2960a4b02 | ||
|
|
b736b03814 | ||
|
|
8c35777cb0 | ||
|
|
fe00426683 | ||
|
|
28f233ce52 | ||
|
|
d893e4d96c | ||
|
|
356f13e5b5 | ||
|
|
08e8e1f3ad | ||
|
|
4b4e6c118a | ||
|
|
b2f4a1cccb | ||
|
|
27dd4bbea0 | ||
|
|
9a4b3f5e01 | ||
|
|
ae14ed5b48 | ||
|
|
4936a9cfdd | ||
|
|
56837e12e2 | ||
|
|
8b737a2b3b | ||
|
|
54b164923f | ||
|
|
5c254cb310 | ||
|
|
4a25a54d0d | ||
|
|
40ea2dfb2d | ||
|
|
c4db22ae77 | ||
|
|
12ae4f82e7 | ||
|
|
5011ad5bf8 | ||
|
|
8721448885 | ||
|
|
acb3179a1c | ||
|
|
079a95a1e6 | ||
|
|
5fda660239 | ||
|
|
c816fb79c4 | ||
|
|
b5d4c0ea0b | ||
|
|
a17af36749 | ||
|
|
2eefff50b3 | ||
|
|
8e511e9e31 | ||
|
|
54ac5974b2 | ||
|
|
a8dcc7f06d | ||
|
|
ae841349e3 | ||
|
|
9ed5c36cd3 | ||
|
|
0441b0183a | ||
|
|
785a7ef43b | ||
|
|
b4879492ca | ||
|
|
e7086535fc | ||
|
|
3b0393cb64 | ||
|
|
332d2ced8a | ||
|
|
193e77c5cb | ||
|
|
33c90290aa | ||
|
|
1b4e5d7b3f | ||
|
|
c93b99378c | ||
|
|
9c0368959f | ||
|
|
043305a683 | ||
|
|
464a887dc8 | ||
|
|
68d2c7f12e | ||
|
|
d5aa1a82fd | ||
|
|
07513d7230 | ||
|
|
e65847b3f9 | ||
|
|
aa5d984a6d | ||
|
|
36beb952d2 | ||
|
|
5b684ccab5 | ||
|
|
76ba0a9d7f | ||
|
|
f91791a18d | ||
|
|
f82ceee6bb | ||
|
|
8ba95aa556 | ||
|
|
f6b277b235 | ||
|
|
69c9f2c6b3 | ||
|
|
409920670c | ||
|
|
1184f808fb | ||
|
|
51b30c8d57 | ||
|
|
db50b71b63 | ||
|
|
8a50239ee4 | ||
|
|
d7ae8d619e | ||
|
|
4b2f24ea56 | ||
|
|
ae52b007cf | ||
|
|
5455d3bcc9 | ||
|
|
9e1fdee82e | ||
|
|
9de3cc5947 | ||
|
|
974559cf5c | ||
|
|
f19cfba5e7 | ||
|
|
f4d826a8d4 | ||
|
|
b0a21ed982 | ||
|
|
05d8302025 | ||
|
|
4276594cbb | ||
|
|
0968f763a3 | ||
|
|
abdd012125 | ||
|
|
281e05c862 | ||
|
|
e5c4e36a5e | ||
|
|
c7a35e4544 | ||
|
|
5c623e61ff | ||
|
|
54890e5fa4 | ||
|
|
3ee223464a | ||
|
|
c1512698fd | ||
|
|
1859baf1d3 | ||
|
|
7a858ef3f1 | ||
|
|
081119cf87 | ||
|
|
37e118ce90 | ||
|
|
1a0547470d | ||
|
|
b1313d9e7f | ||
|
|
26cf616714 | ||
|
|
8d3599ce6d | ||
|
|
d6933f0cac | ||
|
|
b997879ae9 | ||
|
|
31d6d573f9 | ||
|
|
3583837ad7 | ||
|
|
fce1655a31 | ||
|
|
5e37acebe6 | ||
|
|
56b6a6396b | ||
|
|
9fc1f796b0 | ||
|
|
cb4d014f4c | ||
|
|
1734110f45 | ||
|
|
bcc53e7bad | ||
|
|
3dc3dc6f39 | ||
|
|
ea216a1299 | ||
|
|
96005596ea | ||
|
|
3491edf333 | ||
|
|
05fedf2865 | ||
|
|
5ddb5007c9 | ||
|
|
fa72802d3b | ||
|
|
bb667a46b5 | ||
|
|
4c5aafabb4 | ||
|
|
e983072823 | ||
|
|
35474b62da | ||
|
|
d5c20ef5e1 | ||
|
|
32ffb354c1 | ||
|
|
c48238d24e | ||
|
|
ba419c4ef8 | ||
|
|
271f6b2dc8 | ||
|
|
ef113c8323 | ||
|
|
2e2f30bd0c | ||
|
|
239886689a | ||
|
|
a97a5e5831 | ||
|
|
09754dbb8d | ||
|
|
5489fc358e | ||
|
|
e1bfc82707 | ||
|
|
4d1b3ab9d5 | ||
|
|
3069d9c5c3 | ||
|
|
a810886642 | ||
|
|
fc30c69bcf | ||
|
|
2e4f40e23d | ||
|
|
98fae5bd7f | ||
|
|
1093c32524 | ||
|
|
2b395e4143 | ||
|
|
80f46045ee | ||
|
|
1dbf4ea99d | ||
|
|
7e8c804d86 | ||
|
|
55634e1f2b | ||
|
|
b41bf89278 | ||
|
|
80575b9add | ||
|
|
425cd9f8fe | ||
|
|
3a6c0cbb1d | ||
|
|
ac893ff6f1 | ||
|
|
b0da22d0cc | ||
|
|
42a105053e | ||
|
|
e4cff48d9a | ||
|
|
962db8699b | ||
|
|
f8b7cbf694 | ||
|
|
c25efc9f92 | ||
|
|
2b31a83b28 | ||
|
|
b1d4839dd3 | ||
|
|
63da177af1 | ||
|
|
5e3f295d55 | ||
|
|
b65b32946f | ||
|
|
5bf2383288 | ||
|
|
3e02dca4b6 | ||
|
|
6563dbd72c | ||
|
|
230c0d7d06 | ||
|
|
b8204cc351 | ||
|
|
0c06e20cc0 | ||
|
|
5305f826e0 | ||
|
|
6718c8a85d | ||
|
|
f2008bcb4a | ||
|
|
f3c7da05e3 | ||
|
|
db6e307c86 | ||
|
|
a16a51c225 | ||
|
|
7818abc420 | ||
|
|
a0e8b42612 | ||
|
|
3923c5163d | ||
|
|
258276203c | ||
|
|
0b315c47ee | ||
|
|
b4244586e2 | ||
|
|
740dee6302 | ||
|
|
ab1d8f9b91 | ||
|
|
0673413dec | ||
|
|
22b9f047d9 | ||
|
|
a266b5dd42 | ||
|
|
a3bba04e9c | ||
|
|
8d9dd544ae | ||
|
|
1ff926d1d3 | ||
|
|
48cabf2578 | ||
|
|
5dc2a03871 | ||
|
|
416a22b786 | ||
|
|
f80004b19f | ||
|
|
b1c3e6b4bc | ||
|
|
9e679a80e4 | ||
|
|
c87c2fda2b | ||
|
|
d2bb06c6f2 | ||
|
|
05ee953635 | ||
|
|
97542158b6 | ||
|
|
d201881f93 | ||
|
|
ff19f0aa42 | ||
|
|
e09e903225 | ||
|
|
06a84330ee | ||
|
|
e4e5331199 | ||
|
|
22239e7634 | ||
|
|
5d82d5ca9f | ||
|
|
4358d78a0e | ||
|
|
6ec3005613 | ||
|
|
6c10f94827 | ||
|
|
e60e67f9be | ||
|
|
71ed9a2dd0 | ||
|
|
b83d3bf2ad | ||
|
|
7ab3214054 | ||
|
|
49f4f066e8 | ||
|
|
a3d9d0e4d5 | ||
|
|
d1062e5f1d | ||
|
|
eeb019ede8 | ||
|
|
b4f60eb86b | ||
|
|
a524dfbda7 | ||
|
|
7912776803 | ||
|
|
75ab78e4bb | ||
|
|
ad41847caa | ||
|
|
9443a98307 | ||
|
|
f5d4a50a8e | ||
|
|
a47aca07c9 | ||
|
|
feb82bd617 | ||
|
|
66c54d45e3 | ||
|
|
92f445d92c | ||
|
|
61be84f5d6 | ||
|
|
d46fda6d71 | ||
|
|
6231adbb70 | ||
|
|
80105b4782 | ||
|
|
f7cd19e933 | ||
|
|
d0497fcc46 | ||
|
|
ecf4ffdc4f | ||
|
|
474fba8120 | ||
|
|
416f94ed9b | ||
|
|
a58ff9d3c1 | ||
|
|
21c8194c65 | ||
|
|
a72919388c | ||
|
|
e8d3094b31 | ||
|
|
df590f5519 | ||
|
|
4c38a8392d | ||
|
|
851bbb86ad | ||
|
|
8df6fef700 | ||
|
|
56d9f7cfdc | ||
|
|
955251d0a3 | ||
|
|
67576cf33d | ||
|
|
e822f0183a | ||
|
|
296030ce22 | ||
|
|
4924193d17 | ||
|
|
589c754cf8 | ||
|
|
0ab5f8b4da | ||
|
|
0f999df09c | ||
|
|
2634b55731 | ||
|
|
2255211cb9 | ||
|
|
60f5e9158d | ||
|
|
affbd09104 | ||
|
|
736b3c4147 | ||
|
|
c3bad0708e | ||
|
|
73651b5b2a | ||
|
|
b30b11435b | ||
|
|
4e4824afab | ||
|
|
7f0542b133 | ||
|
|
9f187b5dd0 |
No files matched your search
@@ -1,3 +1,103 @@
|
||||
2002-10-01 Duncan Mak <[email protected]>
|
||||
|
||||
* mono/os/Makefile.am: Add gc_wrapper.h.
|
||||
|
||||
* runtime/Makefile.am: Fix the path for monoresgen.exe.
|
||||
|
||||
2002-09-27 Dick Porter <[email protected]>
|
||||
|
||||
* configure.in: Check for semaphore.h. Patch for BSD from
|
||||
[email protected] (Julio Merino).
|
||||
|
||||
2002-09-20 Duncan Mak <[email protected]>
|
||||
|
||||
* data/config.in: Added reference to libxslt.
|
||||
|
||||
2002-09-20 Mark Crichton <[email protected]>
|
||||
|
||||
* configure.in: added NEED_LINK_UNLINK to make io-layer more portable.
|
||||
Linux has a "virtual fs" for UNIX sockets, Solaris and BSD don't.
|
||||
For systems that do not have such a virtual FS, define
|
||||
NEED_LINK_UNLINK.
|
||||
|
||||
* acconfig.h: added NEED_LINK_UNLINK
|
||||
|
||||
Wed Sep 4 18:09:58 CEST 2002 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: add some needed defines to fix support of
|
||||
threads in the GC.
|
||||
|
||||
2002-09-19 Mark Crichton <[email protected]>
|
||||
|
||||
* configure.in: Added checks for Solaris to use X/Open functionality.
|
||||
Really needed for the io-layer code.
|
||||
|
||||
2002-09-15 Andrew Birkett <[email protected]>
|
||||
|
||||
* man/mcs.1: --probe is now --expect-error.
|
||||
|
||||
2002-09-09 Dick Porter <[email protected]>
|
||||
|
||||
* acconfig.h:
|
||||
* configure.in: Simplify thread checks, by using canned rules for
|
||||
particular systems (based on the sleepycat db configure.in).
|
||||
Tested on linux/x86, freebsd and w32. Solaris also added, but I
|
||||
don't have a solaris machine to try it on.
|
||||
|
||||
2002-09-04 Juli Mallett <[email protected]>
|
||||
|
||||
* configure.in: Include <sys/types.h> when checking <sys/un.h> stuff.
|
||||
|
||||
2002-09-02 Diego Sevilla Ruiz <[email protected]>
|
||||
|
||||
* doc/ccvs: Added how to convert SSH keys (from SSH Communications
|
||||
Security) to the OpenSSH keys required by mono CVS
|
||||
access.
|
||||
|
||||
2002-09-01 Juli Mallett <[email protected]>
|
||||
|
||||
* configure.in, mono/interpreter/interp.c,
|
||||
mono/io-layer/handles.c, mono/io-layer/processes.c,
|
||||
mono/io-layer/threads.c, mono/io-layer/timed-thread.c,
|
||||
mono/io-layer/wait.c, mono/jit/helpers.c, mono/jit/jit.c,
|
||||
mono/metadata/appdomain.c, mono/metadata/class.c,
|
||||
mono/metadata/domain.c, mono/metadata/gc.c,
|
||||
mono/metadata/object.c, mono/metadata/reflection.c,
|
||||
mono/metadata/threads.c, mono/os/gc_wrapper.h,
|
||||
mono/utils/mono-hash.c: Add a new header, gc_wrapper.h, to
|
||||
wrap inclusion of gc.h for boehm, since from FreeBSD and
|
||||
OpenBSD ports, gc.h is <gc.h>, but on GNU it seems to be
|
||||
in <gc/gc.h>. This will reduce the diffs FreeBSD ports has
|
||||
to apply, and also makes it possible for me to build with
|
||||
GC on OpenBSD/macppc built by hand.
|
||||
|
||||
2002-09-01 Juli Mallett <[email protected]>
|
||||
|
||||
* configure.in: On BSD don't try to use -ldl, we simply don't use it.
|
||||
|
||||
2002-09-01 Juli Mallett <[email protected]>
|
||||
|
||||
* mono/dis/dis-cil.c:
|
||||
* configure.in: Check for <wchar.h> via autoconf, don't use it if
|
||||
it isn't there, as it seems to work fine without it on OpenBSD.
|
||||
|
||||
2002-08-28 Dick Porter <[email protected]>
|
||||
|
||||
* mono/os/win32/util.c:
|
||||
* mono/os/unix/util.c:
|
||||
* mono/os/util.h: mono_set_rootdir() doesnt take any args now.
|
||||
(It doesn't do anything on unix builds, and the w32 version no
|
||||
longer needs an arg.)
|
||||
|
||||
* configure.in: Add HOST_CC for w32 builds
|
||||
|
||||
Tue Aug 27 18:17:43 CEST 2002 Paolo Molaro <[email protected]>
|
||||
|
||||
* configure.in: remove iconv checks.
|
||||
|
||||
2002-08-24 Juli Mallett <[email protected]>
|
||||
|
||||
* configure.in: Recognise OpenBSD/macppc as PowerPC.
|
||||
|
||||
Tue Aug 20 15:15:52 CEST 2002 Paolo Molaro <[email protected]>
|
||||
|
||||
|
||||
@@ -1,3 +1,84 @@
|
||||
Hello!
|
||||
|
||||
Version 0.16 of Mono has been released! This is mostly a bug
|
||||
fix release, a lot of work has been going on to make existing
|
||||
features more robust and less buggy. Also, contributions are
|
||||
too varied, so it is hard to classify them in groups.
|
||||
|
||||
* Stats
|
||||
|
||||
795 commits to mono and mcs since August 23rd.
|
||||
|
||||
* News
|
||||
|
||||
The changes that got in this releases are mostly
|
||||
bugfixes. Miguel, Martin and Ravi attacked lots of bugs in the
|
||||
compiler, Dick fixed a bunch of bugs related to processes and
|
||||
threads. Mark Crichton resumed his work on the SPARC port and
|
||||
made lots of progress there. Juli Mallett has been working on
|
||||
making sure Mono also builds on BSD systems. As usual, Dietmar
|
||||
and Paolo supplied their continuous stream of fixes to the
|
||||
runtime.
|
||||
|
||||
Dietmar has completed the work on the runtime side for
|
||||
remoting support and we ship now with a sample channel, the
|
||||
System.Runtime.Remoting.Sample. This can be used as a
|
||||
reference implementation for anyone interested in implementing
|
||||
other channels (like a CORBA channel).
|
||||
|
||||
Duncan got preliminary XSLT support done by using
|
||||
libxslt.
|
||||
|
||||
Gonzalo (with some help from Patrik) has been working hard
|
||||
making our ASP.NET implementation work on both Mono and MS by
|
||||
migrating the existing xsp code to the class library. Gaurav
|
||||
started working on the classes in System.Design.dll and Chris
|
||||
Toshok checked in Mono.Directory.LDAP, which will be the
|
||||
foundation to implement the System.DirectoryServices assembly.
|
||||
|
||||
Various fixes from Kral, Jason, Piers and Gonzalo were
|
||||
committed to System.Xml; Martin Algiers reports that the
|
||||
upcoming NAnt release will be fully compatible with Mono.
|
||||
|
||||
Miguel imported Sergey Chaban's Mono.PEToolkit and ilasm code
|
||||
to CVS. Nick, as always, continues to refine our testing
|
||||
framework by improving our tests. Andrew Birkett continues to
|
||||
improve the implementation of our security/cryptographic
|
||||
classes. Jonathan Pryor contributed type-reflector the our
|
||||
list of tools.
|
||||
|
||||
* Other News From Behind de Curtain.
|
||||
|
||||
While the above is pretty impressive on its own, various other
|
||||
non-released portions of Mono have been undergoing: Adam Treat
|
||||
has been leading the effort to document our class libraries
|
||||
and produce the tools required for it.
|
||||
|
||||
Martin Baulig has been working on the Mono Debugger which is
|
||||
not being released yet. This debugger allows both native
|
||||
Linux application as well as CIL applications to be debugged
|
||||
at the same time (and in fact, you can use this to debug the
|
||||
JIT engine). The debugger is written in C# with some C glue
|
||||
|
||||
In the meant A new JIT engine is under development, focused on
|
||||
adding more of the high-end optimizations which will be
|
||||
integrated on an ahead-of-time-compiler. Dietmar and Paolo
|
||||
have been working on this.
|
||||
|
||||
* Contributors to this release
|
||||
|
||||
* Non-Ximian developers: Adam Treat, Andrew Birkett, Dennis
|
||||
Hayes, Diego Sevilla, Franklin Wise, Gaurav Vaish ,Jason
|
||||
Diamond, Johannes Roith, John Sohn, Jonathan Pryor, Juli
|
||||
Mallett, Kral Ferch, Mike Crichton, Nick Drochak, Nick
|
||||
Zigarovich, Piers Haken, Rafael Teixeira, Ricardo Fernandez
|
||||
Pascual, Sergey Chaban, Tim Coleman.
|
||||
|
||||
* Ximian developers: Dietmar, Paolo, Dick, Duncan, Ravi,
|
||||
Miguel, Martin, Chris, Joe, Gonzalo, Rodrigo.
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
* Sergey Chaban added thread-safe support to
|
||||
System.Collections.SortedList.
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,6 @@
|
||||
#undef HAVE_SOL_TCP
|
||||
#undef HAVE_IP_PKTINFO
|
||||
#undef HAVE_STRUCT_IP_MREQN
|
||||
#undef HAVE_PTHREAD
|
||||
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
#undef USE_MONO_MUTEX
|
||||
#undef HAVE_LARGE_FILE_SUPPORT
|
||||
@@ -18,3 +17,4 @@
|
||||
#undef HAVE_TIMEZONE
|
||||
#undef HAVE_TM_GMTOFF
|
||||
#undef MONO_SIZEOF_SUNPATH
|
||||
#undef NEED_LINK_UNLINK
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
#undef HAVE_INET_PTON
|
||||
#undef HAVE_INET_ATON
|
||||
#undef HAVE_SOL_IP
|
||||
#undef HAVE_SOL_TCP
|
||||
#undef HAVE_IP_PKTINFO
|
||||
#undef HAVE_STRUCT_IP_MREQN
|
||||
#undef HAVE_PTHREAD
|
||||
#undef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
#undef USE_MONO_MUTEX
|
||||
#undef HAVE_LARGE_FILE_SUPPORT
|
||||
#undef PLATFORM_WIN32
|
||||
#undef HAVE_NEW_ICONV
|
||||
#undef NAME_DEV_RANDOM
|
||||
#undef HAVE_CRYPT_RNG
|
||||
#undef HAVE_BOEHM_GC
|
||||
|
||||
/* The number of bytes in a void *. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
||||
/* Define if you have the inet_aton function. */
|
||||
#undef HAVE_INET_ATON
|
||||
|
||||
/* Define if you have the inet_pton function. */
|
||||
#undef HAVE_INET_PTON
|
||||
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define if you have the <netdb.h> header file. */
|
||||
#undef HAVE_NETDB_H
|
||||
|
||||
/* Define if you have the <sys/filio.h> header file. */
|
||||
#undef HAVE_SYS_FILIO_H
|
||||
|
||||
/* Define if you have the <sys/sockio.h> header file. */
|
||||
#undef HAVE_SYS_SOCKIO_H
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#undef HAVE_UTIME_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
+67
-118
@@ -1,26 +1,44 @@
|
||||
AC_INIT(README)
|
||||
AC_CANONICAL_SYSTEM
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(mono, 0.14)
|
||||
AM_INIT_AUTOMAKE(mono, 0.16)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
dnl ****************************************
|
||||
dnl *** Check if we're building on win32 ***
|
||||
dnl ****************************************
|
||||
AC_MSG_CHECKING([if building for some Win32 platform])
|
||||
# Thread configuration inspired by sleepycat's db
|
||||
AC_MSG_CHECKING([host platform characteristics])
|
||||
case "$host" in
|
||||
*-*-mingw*|*-*-cygwin*)
|
||||
platform_win32=yes
|
||||
AC_DEFINE(PLATFORM_WIN32)
|
||||
CC="gcc -mno-cygwin"
|
||||
HOST_CC="gcc"
|
||||
CPPFLAGS="$CPPFLAGS -DGC_WIN32_THREADS"
|
||||
libdl=
|
||||
;;
|
||||
*-*-*bsd*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
|
||||
LDFLAGS="$LDFLAGS -pthread"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
libdl=
|
||||
;;
|
||||
*-*-linux*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT"
|
||||
libdl="-ldl"
|
||||
;;
|
||||
*-*-solaris*)
|
||||
platform_win32=no
|
||||
CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT"
|
||||
AC_DEFINE(NEED_LINK_UNLINK)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN([*** Please add $host to configure.in checks!])
|
||||
platform_win32=no
|
||||
libdl="-ldl"
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($platform_win32)
|
||||
AC_MSG_RESULT(ok)
|
||||
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
|
||||
|
||||
AC_CHECK_TOOL(CC, gcc, gcc)
|
||||
@@ -52,14 +70,14 @@ AC_HEADER_STDC
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h)
|
||||
|
||||
AC_CHECK_HEADERS(iconv.h)
|
||||
AC_CHECK_HEADERS(giconv.h)
|
||||
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h semaphore.h)
|
||||
|
||||
# for mono/metadata/debug-symfile.c
|
||||
AC_CHECK_HEADERS(elf.h)
|
||||
|
||||
# for mono/dis
|
||||
AC_CHECK_HEADERS(wchar.h)
|
||||
|
||||
# not 64 bit clean in cross-compile
|
||||
AC_CHECK_SIZEOF(void *, 4)
|
||||
|
||||
@@ -105,6 +123,7 @@ AC_SUBST(GLIB_LIBS)
|
||||
AC_SUBST(GMODULE_CFLAGS)
|
||||
AC_SUBST(GMODULE_LIBS)
|
||||
|
||||
AC_CHECK_HEADERS(gc.h gc/gc.h)
|
||||
AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
|
||||
gc=auto
|
||||
AC_ARG_WITH(gc, [ --with-gc=boehm,none],[gc=$with_gc])
|
||||
@@ -123,8 +142,7 @@ case "x$gc" in
|
||||
AC_MSG_WARN("Compiling mono without GC.")
|
||||
;;
|
||||
*)
|
||||
dnl When the JIT works with libgc, use this chunk.
|
||||
dnl # If libgc was found, use it. Otherwise just warn.
|
||||
# If libgc was found, use it. Otherwise just warn.
|
||||
if test "x$found_boehm" != "xyes"; then
|
||||
AC_MSG_WARN("Compiling mono without GC.")
|
||||
else
|
||||
@@ -133,7 +151,6 @@ dnl # If libgc was found, use it. Otherwise just warn.
|
||||
LIBS="$LIBS -lgc $libdl"
|
||||
gc="boehm"
|
||||
fi
|
||||
dnl AC_MSG_WARN("Compiling mono without GC.")
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -279,6 +296,7 @@ if test x$platform_win32 = xno; then
|
||||
AC_MSG_CHECKING(size of sockaddr_un.sun_path)
|
||||
AC_CACHE_VAL(cv_mono_sizeof_sunpath,
|
||||
[AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/un.h>
|
||||
|
||||
@@ -295,87 +313,43 @@ if test x$platform_win32 = xno; then
|
||||
AC_MSG_RESULT($cv_mono_sizeof_sunpath)
|
||||
AC_DEFINE_UNQUOTED(MONO_SIZEOF_SUNPATH, $cv_mono_sizeof_sunpath)
|
||||
|
||||
dnl *****************************
|
||||
dnl *** Checks for libxnet ***
|
||||
dnl *****************************
|
||||
case "${host}" in
|
||||
*solaris* )
|
||||
AC_MSG_CHECKING(for Solaris XPG4 support)
|
||||
if test -f /usr/lib/libxnet.so; then
|
||||
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
|
||||
CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
|
||||
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
|
||||
LIBS="$LIBS -lxnet"
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
if test "$GCC" = "yes"; then
|
||||
CFLAGS="$CFLAGS -Wno-char-subscripts"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl *****************************
|
||||
dnl *** Checks for libpthread ***
|
||||
dnl *****************************
|
||||
AC_SEARCH_LIBS(pthread_create, pthread c_r, [
|
||||
AM_CONDITIONAL(THREADS_PTHREAD, true)
|
||||
AC_DEFINE(HAVE_PTHREAD)
|
||||
|
||||
# Need pthread_mutex_timedlock
|
||||
pthread_CFLAGS=""
|
||||
orig_CPPFLAGS=$CPPFLAGS
|
||||
# This is a gcc-specific error, but we already set
|
||||
# gcc-specific options in CFLAGS
|
||||
CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
|
||||
AC_MSG_CHECKING(for pthread_mutex_timedlock)
|
||||
AC_TRY_COMPILE([ #include <pthread.h>], [
|
||||
pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_mutex_timedlock(&mut, NULL);
|
||||
], [
|
||||
# Works!
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
# glibc requires -D_GNU_SOURCE before it will declare
|
||||
# this function
|
||||
AC_MSG_CHECKING(whether _GNU_SOURCE is needed for pthread_mutex_timedlock)
|
||||
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
||||
AC_TRY_COMPILE([ #include <pthread.h>], [
|
||||
pthread_mutex_t mut=PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_mutex_timedlock(&mut, NULL);
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
pthread_CFLAGS="-D_GNU_SOURCE"
|
||||
AC_DEFINE(HAVE_PTHREAD_MUTEX_TIMEDLOCK)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
dnl Add other variants here
|
||||
AC_MSG_WARN(Working around pthread_mutex_timedlock)
|
||||
])
|
||||
])
|
||||
CPPFLAGS=$orig_CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS $pthread_CFLAGS"
|
||||
|
||||
# Need PTHREAD_MUTEX_RECURSIVE
|
||||
pthread_CFLAGS=""
|
||||
orig_CPPFLAGS=$CPPFLAGS
|
||||
# This is a gcc-specific error, but we already set
|
||||
# gcc-specific options in CFLAGS
|
||||
CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
|
||||
AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
|
||||
AC_TRY_COMPILE([ #include <pthread.h>], [
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
], [
|
||||
# Works!
|
||||
AC_MSG_RESULT(ok)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
# glibc requires -D_GNU_SOURCE before it will declare
|
||||
# this macro
|
||||
AC_MSG_CHECKING(whether _GNU_SOURCE is needed for PTHREAD_MUTEX_RECURSIVE)
|
||||
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
|
||||
AC_TRY_COMPILE([ #include <pthread.h>], [
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
], [
|
||||
AC_MSG_RESULT(ok)
|
||||
pthread_CFLAGS="-D_GNU_SOURCE"
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
dnl Add other variants here
|
||||
AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
|
||||
AC_DEFINE(USE_MONO_MUTEX)
|
||||
])
|
||||
])
|
||||
CPPFLAGS=$orig_CPPFLAGS
|
||||
CPPFLAGS="$CPPFLAGS -D_REENTRANT $pthread_CFLAGS"
|
||||
AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
|
||||
AC_CHECK_FUNCS(pthread_mutex_timedlock)
|
||||
AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
|
||||
AC_TRY_COMPILE([ #include <pthread.h>], [
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
], [
|
||||
AC_MSG_ERROR([libpthread is required on non-win32 hosts])
|
||||
AC_MSG_RESULT(ok)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
|
||||
AC_DEFINE(USE_MONO_MUTEX)
|
||||
])
|
||||
|
||||
dnl ********************************
|
||||
@@ -409,12 +383,8 @@ if test x$platform_win32 = xno; then
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AM_CONDITIONAL(THREADS_PTHREAD, false)
|
||||
# This is a kludge, we really ought to test for libws2_32, but
|
||||
# I can't make AC_CHECK_LIB link (the symbols seem to be mangled
|
||||
# with @num suffixes)
|
||||
LIBS="$LIBS -lws2_32"
|
||||
CFLAGS="$CFLAGS -mno-cygwin"
|
||||
AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
|
||||
AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
|
||||
fi
|
||||
|
||||
dnl ****************************
|
||||
@@ -482,27 +452,6 @@ if test "x$ac_cv_have_dev_random" = "xno" \
|
||||
***]])
|
||||
fi
|
||||
|
||||
if test "x$cross_compiling" = "xno"; then
|
||||
# check for new iconv version
|
||||
AC_MSG_CHECKING(for new iconv)
|
||||
AC_CACHE_VAL(new_iconv,[
|
||||
AC_TRY_RUN([#include <stdio.h>
|
||||
#include <iconv.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
exit (iconv_open ("UTF-16le", "UTF-8") == (iconv_t)-1);
|
||||
}
|
||||
],
|
||||
new_iconv=yes,new_iconv=)])
|
||||
if test -n "$new_iconv"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_NEW_ICONV)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if inter-process shared handles are requested])
|
||||
AC_ARG_ENABLE(shared-handles, [ --disable-shared-handles disable inter-process shared handles], try_shared_handles=$enableval, try_shared_handles=yes)
|
||||
AC_MSG_RESULT($try_shared_handles)
|
||||
@@ -520,7 +469,7 @@ i*86-*-*) TARGET=X86; arch_target=x86;;
|
||||
sparc*-*-*) TARGET=SPARC; arch_target=sparc; ACCESS_UNALIGNED="no";;
|
||||
#alpha*-*-linux* | alpha*-*-osf*) TARGET=ALPHA; ACCESS_UNALIGNED="no";;
|
||||
#m68k-*-linux*) TARGET=M68K;;
|
||||
powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
|
||||
macppc-*-openbsd* | powerpc-*-linux* | powerpc-*-openbsd* | powerpc-*-sysv*) TARGET=POWERPC; arch_target=ppc;;
|
||||
arm-*-linux-* | armv4l-*-linux-*) TARGET=ARM; arch_target=arm; ACCESS_UNALIGNED="no";;
|
||||
esac
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<configuration>
|
||||
<dllmap dll="cygwin1.dll" target="@LIBC@" />
|
||||
<dllmap dll="libc" target="@LIBC@" />
|
||||
<dllmap dll="libxslt.dll" target="libxslt.so" />
|
||||
</configuration>
|
||||
@@ -6,10 +6,11 @@
|
||||
If you are not a developer, but want to track the development, please
|
||||
see the <a href="anoncvs.html">AnonCVS</a> instructions.
|
||||
|
||||
Send an e-mail to miguel with your public SSH key for this
|
||||
purpose. Please specify if the key was generated with SSH1 or SSH2.
|
||||
Send an e-mail to miguel with your public OpenSSH key for this
|
||||
purpose. Please specify if the key was generated with SSH version 1
|
||||
or version 2.
|
||||
|
||||
If you are using SSH2, please generate your key using:
|
||||
If you are using SSH version 2, please generate your key using:
|
||||
|
||||
<pre>
|
||||
ssh-keygen -t rsa
|
||||
@@ -17,13 +18,32 @@
|
||||
|
||||
And mail me the id_rsa.pub file.
|
||||
|
||||
If you are using SSH1, run:
|
||||
If you are using SSH version 1, run:
|
||||
<pre>
|
||||
ssh-keygen
|
||||
</pre>
|
||||
|
||||
And mail me your identity.pub file.
|
||||
|
||||
If you are using SSH from SSH Communications Security (they offer
|
||||
a free SSH client for personal use), you have to use OpenSSH to
|
||||
convert your public key to the required format. You have to use
|
||||
OpenSSH's ssh-keygen program and write the following:
|
||||
|
||||
<pre>
|
||||
ssh-keygen -i -f id_XXX.pub > my_public_key.pub
|
||||
</pre>
|
||||
|
||||
where the file <pre>id_XXX.pub</pre> is your public key file,
|
||||
normally located under <pre>~/.ssh/</pre> or <pre>~/.ssh2/</pre>.
|
||||
Send to miguel the <pre>my_public_key.pub</pre> file.
|
||||
|
||||
The *exact* format for this file must be:
|
||||
|
||||
<pre>
|
||||
ssh-rsa XXXXX....
|
||||
</pre>
|
||||
|
||||
You will need CVS and SSH. Windows users can get both by
|
||||
installing Cygwin (<a
|
||||
href="http://www.cygwin.com">http://www.cygwin.com</a>)
|
||||
|
||||
+32
-70
@@ -14,87 +14,49 @@
|
||||
and updating class library documentation, including:
|
||||
|
||||
<ul>
|
||||
<li><a href="#docstub">docstub</a></li>
|
||||
<li><a href="#docverify">docverify</a></li>
|
||||
<li><a href="#docconv">docconv</a></li>
|
||||
<li><a href="#docgen">docgen</a></li>
|
||||
<li><a href="#monodoc">monodoc</a></li>
|
||||
<li><a href="#monodoc">MonoDoc - A graphical documentation editor and viewer.</a></li>
|
||||
<li><a href="#mkmaster">MkMaster - A command line tool to feed stub information to MonoDoc.</a></li>
|
||||
<li><a href="#aspnet">An ASP.NET documentation editor.</a></li>
|
||||
<li><a href="#xsltool">An xsl tool to convert monodoc xml to html documentation.</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
** XML Documentation Files and Formats
|
||||
|
||||
|
||||
|
||||
*** Monodoc XML
|
||||
This XML is similar to the XML documentation described in the
|
||||
C# standard, with added tags for internationalization and a
|
||||
slightly different structure. Documentation and a DTD/Schema
|
||||
for Monodoc XML is forthcoming.
|
||||
|
||||
Monodoc XML does not contain any definitive type information,
|
||||
and is only useful in conjunction with the Type definition for
|
||||
whatever is being documented.
|
||||
|
||||
This XML could be generated by hand, by monostub, or by monodoc.
|
||||
|
||||
*** Assembly XML
|
||||
This XML is generated by combining runtime type information for
|
||||
an Assembly with a collection of Monodoc XML files. The resultant
|
||||
XML (in the best of cases) contains both complete type and
|
||||
documentary information for each type in the assembly.
|
||||
|
||||
This XML contains enough information to be transformed into
|
||||
user-accessible documentation. It is likely that scripts
|
||||
will be created to generate reference docs as HTML and other
|
||||
formats.
|
||||
|
||||
Documentation and a DTD/Schema for Assembly XML is forthcoming.
|
||||
|
||||
This XML is Mono's documentation format. Documentation and a DTD/Schema
|
||||
for Monodoc XML is located in cvs and can be found <a href="http://go-mono.org/monodoc.dtd">here</a>.
|
||||
|
||||
This XML could be generated by MonoDoc or the ASP.NET client.
|
||||
|
||||
More about the XML format <a href="http://go-mono.org/monodoc-xml.html">here</a>.
|
||||
** Documentation Tools
|
||||
|
||||
*** <a name="docstub">docstub</a>
|
||||
Given a type name and an assembly, generates stub Monodoc XML
|
||||
documentation for the type. Optionally, docstub can attempt to
|
||||
populate initial documentation from an XML file in the format
|
||||
published along with the ECMA standard.
|
||||
|
||||
*** <a name="docverify">docverify</a>
|
||||
Given a Monodoc XML file and an assembly, verifies that the
|
||||
documentation matches the compiled type. Checks signatures,
|
||||
parameters, et cetera.
|
||||
|
||||
*** <a name="docconv">docconv</a>
|
||||
Converts from Monodoc XML to the standard C# compiler-emitted
|
||||
XML format and vice versa.
|
||||
|
||||
*** <a name="docgen">docgen</a>
|
||||
Given an assembly and a collection of Monodoc XML files, creates
|
||||
an Assembly XML file containing all documentation and type information
|
||||
available. This output is suitable for transforming into user
|
||||
documentation.
|
||||
|
||||
*** <a name="monodoc">monodoc</a>
|
||||
A GUI tool for documentation and translation, this encapsulates
|
||||
the capabilities of docstub, docverify, docconv, and docgen in
|
||||
a friendly user interface. In addition, monodoc provides features
|
||||
to ease translation, such as side-by-side editing and coverage
|
||||
statistics.
|
||||
|
||||
*** <a name="monodoc">MonoDoc</a>
|
||||
A graphical documentation editor and viewer. Currently, MonoDoc
|
||||
consists of a Qt# application and is in heavy development.
|
||||
|
||||
*** <a name="mkmaster">MkMaster</a>
|
||||
This tool creates the Master.xml file that MonoDoc uses as a reference
|
||||
for documentation generation. This is a reflection engine that is used
|
||||
to gather metadata from assemblies and create an xml representation.
|
||||
|
||||
*** <a name="aspnet">ASP.NET</a>
|
||||
This tool is planned.
|
||||
|
||||
*** <a name="xsltool">An XSL converter</a>
|
||||
This tool is planned. If someone wants to step forward and adopt this
|
||||
project, it would be very helpful ;)
|
||||
|
||||
** Status and Roadmap
|
||||
|
||||
*** 2 January 2002
|
||||
*** 16, September 2002
|
||||
|
||||
As I write the initial version of this document, very little has been
|
||||
implemented. Currently, there is a:
|
||||
|
||||
<ul>
|
||||
<li>Preliminary version of the Monodoc XML format</li>
|
||||
<li>Preliminary version of the docstub utility</li>
|
||||
</ul>
|
||||
|
||||
Here's hoping for frequent, productive updates.
|
||||
A preliminary version of MonoDoc is in Mono's cvs. It is under heavy development.
|
||||
Once this is complete we will start documenting the API!
|
||||
|
||||
** Get Involved
|
||||
|
||||
Help us define Mono's documentation structure! Subscribe to
|
||||
Help us develop Mono's documentation tools! Subscribe to
|
||||
<a href="http://lists.ximian.com/mailman/listinfo/mono-docs-list">mono-docs-list</a>
|
||||
and wade right in.
|
||||
+1
-1
@@ -9,5 +9,5 @@
|
||||
href="http://primates.ximian.com/~miguel">http://primates.ximian.com/~miguel"</a>
|
||||
|
||||
You can also <a
|
||||
href="http://www.ximian.com/about/contact.php3">reach Ximian.</a>
|
||||
href="http://www.ximian.com/about_us/contact/">reach Ximian.</a>
|
||||
|
||||
+192
-220
@@ -6,70 +6,158 @@
|
||||
href="runtime.html">Runtime</a> description for more details
|
||||
on this part of the project.
|
||||
|
||||
The code for the C# compiler as well as the language error
|
||||
test suite and the class library are in the `mcs' package, we
|
||||
will move this later into `mono' itself.
|
||||
Some useful links: <a
|
||||
href="http://www.go-mono.org/mono-beginning.html">Resources/Beginning
|
||||
section</a>, the <a
|
||||
href="http://www.go-mono.org/faq.html">FAQ</a> and the <a
|
||||
href="http://geneura.ugr.es/~jaime/deploy/mono-common-problems.html">
|
||||
Mono Common Problems</a>.
|
||||
|
||||
<b>Note: (Beginners read!)</b> There are a couple of documents you
|
||||
should read before going ahead. You can reach them in the
|
||||
<a href="http://www.go-mono.org/mono-beginning.html">Resources/Beginning section</a>. And the <a href="http://www.go-mono.org/faq.html">FAQ</a>
|
||||
and the <a href="http://geneura.ugr.es/~jaime/deploy/mono-common-problems.html">
|
||||
Mono Common Problems</a>. Might be useful too. Take the Mono Beginners
|
||||
HOWTO for your system and proceed as it's described there.
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="#DDDDDD">
|
||||
<td>
|
||||
<b>Release 0.15</b><br>
|
||||
<a href="archive/mono-0.15">Release notes</a><br>
|
||||
Aug 23rd, 2002.
|
||||
</td>
|
||||
<td>
|
||||
<table cellspacing="1" cellpadding="3">
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source Code</b>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/mcs-0.15.tar.gz">Mono Class Libraries and C# Compiler.</a>
|
||||
<li><a href="archive/mono-0.15.tar.gz">Mono Runtime</a>
|
||||
<li><a href="archive/gc6.1alpha5.tar.gz">Boehm GC 6.1alpha5</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="#BBBBBB">
|
||||
<td>
|
||||
<b>Source RPMs</b>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li><a href="archive/libgc-6.1alpha5-1.src.rpm">libgc-6.1alpha5-1.src.rpm</a>
|
||||
<li><a href="archive/mono-0.15-1.src.rpm">mono-0.15-1.src.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.3/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-73-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-73-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat 7.1/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-71-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-71-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#999999">
|
||||
<b>Mandrake 8.2/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-6.1alpha5-1.i586.rpm">libgc-6.1alpha5-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/libgc-devel-6.1alpha5-1.i586.rpm">libgc-devel-6.1alpha5-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-0.15-1.i586.rpm">mono-0.15-1.i586.rpm</a>
|
||||
<li><a href="archive/mandrake-82-i386/mono-devel-0.15-1.i586.rpm">mono-devel-0.15-1.i586.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>SuSE 8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/suse-80-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>
|
||||
<li><a href="archive/suse-80-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr bgcolor="#999999">
|
||||
<td>
|
||||
<b>Windows (win95 friendly)</b>
|
||||
<ul>
|
||||
<li><a href="archive/mono-w32-Aug_28_2002.zip">Mono-w32</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
<b>Windows Setup Wizard (NT/2000/XP)</b>
|
||||
<ul>
|
||||
<li><a href="http://www.sport-huettn.de/mono/mono-0.15-stable.exe">Mono-Setup</a>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr bgcolor="#999999">
|
||||
<td bgcolor="#999999">
|
||||
<b>Red Hat null-8.0/x86</b>
|
||||
<ul>
|
||||
<li><a href="archive/redhat-null-i386/libgc-6.1alpha5-1.i386.rpm">libgc-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-null-i386/libgc-devel-6.1alpha5-1.i386.rpm">libgc-devel-6.1alpha5-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-null-i386/mono-0.15-1.i386.rpm">mono-0.15-1.i386.rpm</a>
|
||||
<li><a href="archive/redhat-null-i386/mono-devel-0.15-1.i386.rpm">mono-devel-0.15-1.i386.rpm</a>
|
||||
</ul>
|
||||
</td>
|
||||
<td bgcolor="#999999">
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr bgcolor="#CCCCC">
|
||||
<td>
|
||||
<b>Regression Tests</b><br>
|
||||
</td>
|
||||
<td>
|
||||
You can get binaries for the Mono Regression Test
|
||||
Suite <a href="archive/mono-tests.tar.gz">here</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<a name="sources">
|
||||
*** Sources
|
||||
|
||||
Stay up to date on the Mono team's development using the
|
||||
<a href="http://lists.ximian.com/mailman/listinfo/mono-cvs-list">
|
||||
mono-cvs-list</a> mailing list. The CVS source code can also
|
||||
be browsed <a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/?cvsroot=Mono#dirlist">here</a>
|
||||
|
||||
<a name="jun-7">
|
||||
<b>Mono 0.13</b>
|
||||
|
||||
New packaged versions of the Mono C# compiler and Mono runtime
|
||||
are now available. The latest version is 0.13.
|
||||
|
||||
<ul>
|
||||
* <a href="archive/mono-0.13">Mono 0.13 release notes</a>
|
||||
|
||||
* <a href="archive/mcs-0.13.tar.gz">mcs-0.13.tar.gz</a>
|
||||
Mono C# compiler with class library source code.
|
||||
|
||||
* <a href="archive/mono-0.13.tar.gz">mono-0.13.tar.gz</a>
|
||||
Mono runtime.
|
||||
</ul>
|
||||
|
||||
* Snapshots
|
||||
** Binaries for other platforms.
|
||||
|
||||
Already daily volunteer's made binaries:
|
||||
|
||||
<ul>
|
||||
* <a href="http://www.atoker.com/mono">Debian Linux</a>
|
||||
|
||||
* <a href="http://noa.tm/mono/">Red Hat (and RPM based systems)</a>
|
||||
* <a href="http://www.debianplanet.org/mono/">DebianPlanet</a>
|
||||
* <a href="http://www.superin.formativ.net/mono/mono.htm">Windows</a> (works without cygwin!)
|
||||
</ul>
|
||||
|
||||
<b>Note1:</b> Don't look for the Mono BaseLabs RPMs; they are not providing it
|
||||
anymore.<br>
|
||||
<b>Note2:</b> You will find that you can get binaries for the gtk-sharp
|
||||
package too.
|
||||
* Snapshots
|
||||
|
||||
<a name="snapshots">
|
||||
For up to date sources, it is recommended that you use the Mono
|
||||
source code from either the
|
||||
<a href="http://www.go-mono.com/snapshots">nightly snapshots</a> or
|
||||
the <a href="anoncvs.html">Anonymous CVS</a>. The nightly
|
||||
snapshots are done every night at 10pm EST (Boston Time).
|
||||
The anoncvs mirrors provided by Hispalinux are updated every six
|
||||
hours.
|
||||
|
||||
The nightly snapshots are not guaranteed to build, but most of the
|
||||
time they should. They should give you a window to see what we are
|
||||
up to.
|
||||
<a href="http://www.go-mono.com/snapshots">Nightly snapshots</a> of
|
||||
the CVS repository are made every day at 10pm EST (Boston
|
||||
Time). These are not guaranteed to build, they are just a
|
||||
snapshot of the tree.
|
||||
|
||||
The <a href="anoncvs.html">anoncvs</a> mirrors provided by
|
||||
Hispalinux are updated every six hours.
|
||||
|
||||
* Compiling with scripts
|
||||
|
||||
There are scripts to help build mono for both Unix and Windows. Get
|
||||
<a href="mono-build.sh">mono-build.sh</a> for Unix, or <a
|
||||
@@ -100,51 +188,53 @@
|
||||
set your CVSROOT environment variable before running the script to
|
||||
select a particular cvs server.
|
||||
|
||||
** Mono Regression Test Suite
|
||||
|
||||
You can get binaries for the Mono Regression Test Suite <a
|
||||
href="archive/mono-tests.tar.gz">here</a>
|
||||
|
||||
<a name="install">
|
||||
** Building the software manually
|
||||
|
||||
You will need to obtain the Mono dependencies first: <a
|
||||
href="http://www.gtk.org">glib 2.x</a> and
|
||||
<a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a>.
|
||||
|
||||
*** Building on Linux
|
||||
|
||||
<ul>
|
||||
Unpack the Mono runtime distribution:
|
||||
<pre>
|
||||
tar xzvf mono-X.XX.tar.gz
|
||||
cd mono-X.XX
|
||||
|
||||
</pre>
|
||||
<p>
|
||||
|
||||
You can build mono and mcs in Linux but to do that be
|
||||
sure to obtain the corlib.dll and install it before
|
||||
trying to compile.
|
||||
|
||||
In linux be sure you get <a href="http://www.gtk.org">glib2.0</a>
|
||||
(>= 2.0.4, 2.0.6
|
||||
recomended) and <a href="http://www.freedesktop.org/software/pkgconfig">pkg-config</a> 0.80.
|
||||
Also the corresponding development packages for those as
|
||||
well as the GNU Build Tools (make, autoconf...).
|
||||
Then download the mono packages and compile them.
|
||||
You must start compiling mcs and then mono.
|
||||
Be sure you set all the environment variables before
|
||||
compiling. You can use pkg-config --list-all to see
|
||||
if you forgot to set some of them.
|
||||
|
||||
Normally you should enter:
|
||||
export ACLOCAL_FLAGS="-I /usr/local/share/aclocal"
|
||||
if your install prefix is /usr/local.
|
||||
|
||||
If you downloaded the Mono nightly snapshots, untar the
|
||||
snapshot.
|
||||
|
||||
Change directories to "<strong>mcs</strong>".
|
||||
|
||||
Configure, compile and install:
|
||||
Then configure, compile and install:
|
||||
|
||||
<pre>
|
||||
<strong>./configure
|
||||
|
||||
./configure --prefix=/usr/local
|
||||
make
|
||||
make install</strong></pre>
|
||||
make install</pre>
|
||||
|
||||
Do the same in the "<strong>mono</strong>" directory.
|
||||
This will give you a runtime, C# compiler and runtime
|
||||
libraries.
|
||||
|
||||
If you want to recompile the runtime and the compiler,
|
||||
follow these steps, first unpack the MCS package:
|
||||
|
||||
<pre>
|
||||
tar xzvf mcs-X.XX.tar.gz
|
||||
|
||||
cd mcs-X.XX
|
||||
</pre>
|
||||
|
||||
Then use the following command to compile and install:
|
||||
|
||||
<pre>
|
||||
|
||||
make -f makefile.gnu install prefix=/usr/local
|
||||
</pre>
|
||||
|
||||
You can change /usr/local to something else if you want.
|
||||
</ul>
|
||||
|
||||
*** On Windows, to install and work on the compiler and the class libraries:
|
||||
|
||||
@@ -157,7 +247,7 @@
|
||||
* Install <a href="http://msdn.microsoft.com/downloads">
|
||||
Microsoft .NET Framework SDK</a>.
|
||||
|
||||
* Change to the <strong>/usr/local</strong> directory
|
||||
* Change to the /usr/local directory
|
||||
of your Cygwin installation.<br>
|
||||
Unzip the precompiled packages listed above.
|
||||
|
||||
@@ -168,13 +258,14 @@
|
||||
<a href="http://www.go-mono.com/snapshots">nightly snapshot
|
||||
</a>, untar the snapshot.
|
||||
|
||||
* Change directories to <strong>"mcs"</strong>.
|
||||
* Change directories to "mcs".
|
||||
|
||||
* Compile:
|
||||
|
||||
<pre>
|
||||
<strong>make windows</strong>
|
||||
make
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
*** On Windows, to compile the mono runtime:
|
||||
|
||||
@@ -184,18 +275,18 @@
|
||||
<a href="http://www.go-mono.com/snapshots">nightly snapshot
|
||||
</a>, untar the snapshot.
|
||||
|
||||
* Change directories to <strong>"mono"</strong>.
|
||||
* Change directories to "mono".
|
||||
|
||||
* Configure, compile and install:
|
||||
<pre><strong>
|
||||
<pre>
|
||||
./configure --prefix=c:/mono
|
||||
make
|
||||
make install
|
||||
</strong></pre>
|
||||
</pre>
|
||||
|
||||
</ul>
|
||||
|
||||
* Software resources, notes and old releases:
|
||||
* Software resources and notes
|
||||
|
||||
The required and additional software can be downloaded here:
|
||||
|
||||
@@ -210,12 +301,13 @@
|
||||
|
||||
* Precompiled GLIB 2.0 and pkg-config packages (and
|
||||
their dependencies) by the <a href="http://www.gimp.org/~tml/gimp/win32//index.html">GIMP for Windows</a> project from
|
||||
<a href="http://www.go-mono.com/archive/pkgconfig-0.80-tml-20020101.zip">http://www.go-mono.com/archive/pkgconfig-0.80-tml-20020101.zip</a>
|
||||
<a href="http://www.go-mono.com/archive/glib-1.3.12-20020101.zip">http://www.go-mono.com/archive/glib-1.3.12-20020101.zip</a>
|
||||
<a href="http://www.go-mono.com/archive/glib-dev-1.3.12-20020101.zip">http://www.go-mono.com/archive/glib-dev-1.3.12-20020101.zip</a>
|
||||
<a href="http://www.go-mono.com/archive/libiconv-1.7.zip">http://www.go-mono.com/archive/libiconv-1.7.zip</a>
|
||||
<a href="http://www.go-mono.com/archive/libiconv-dev-1.7.zip">http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip</a>
|
||||
<a href="http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip">http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip</a>
|
||||
<a href="http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip">http://www.go-mono.com/archive/pkgconfig-0.11-20020310.zip</a><br>
|
||||
<a href="http://www.go-mono.com/archive/glib-2.0.4-20020703.zip">http://www.go-mono.com/archive/glib-2.0.4-20020703.zip</a> <br>
|
||||
<a href="http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip">http://www.go-mono.com/archive/glib-dev-2.0.4-20020703.zip</a> <br>
|
||||
<a href="http://www.go-mono.com/archive/libiconv-1.7.zip">http://www.go-mono.com/archive/libiconv-1.7.zip</a> <br>
|
||||
<a href="http://www.go-mono.com/archive/libiconv-dev-1.7.zip">http://www.go-mono.com/archive/libiconv-dev-1.7-20020101.zip</a> <br>
|
||||
<a href="http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip">http://www.go-mono.com/archive/libintl-0.10.40-20020101.zip</a><br>
|
||||
|
||||
|
||||
* Download the Mono source code from the
|
||||
<a href="#feb-11">packaged versions</a> or
|
||||
@@ -244,12 +336,12 @@
|
||||
<nobr><tt>extern char *strsignal (int sig);</tt></nobr> to
|
||||
<nobr><tt>extern const char *strsignal (int sig);</tt></nobr>.
|
||||
|
||||
<pre><strong>
|
||||
<pre>
|
||||
tar xzvf pkg-config-0.8.0.tar.gz
|
||||
cd pkg-config-0.8.0
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
make install</strong>
|
||||
make install
|
||||
</pre>
|
||||
|
||||
* Download, compile and install <a href="ftp://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.7.tar.gz">libiconv</a> from source.<br>
|
||||
@@ -265,123 +357,3 @@ make install</strong>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="oldreleases">
|
||||
|
||||
*** Old releases.
|
||||
|
||||
<ul>
|
||||
|
||||
<ul>
|
||||
<a name="apr-24">
|
||||
<b>Mono 0.11; April 24, 2002</b>
|
||||
* <a href="archive/mono-0.11">Mono 0.11 release notes</a>
|
||||
|
||||
* <a href="archive/mcs-0.11.tar.gz">mcs-0.11.tar.gz</a>
|
||||
Mono C# compiler
|
||||
* <a href="archive/mono-0.11.tar.gz">mono-0.11.tar.gz</a>
|
||||
Mono runtime
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<a name="mar-27">
|
||||
<b>Mono 0.10; March 27, 2002</b>
|
||||
* <a href="archive/mono-0.10">Mono 0.10 release notes</a>
|
||||
* <a href="archive/mcs-0.10.tar.gz">mcs-0.10.tar.gz</a>
|
||||
Mono C# compiler
|
||||
* <a href="archive/mono-0.10.tar.gz">mono-0.10.tar.gz</a>
|
||||
Mono runtime
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<a name="feb-22">
|
||||
<b>Mono 0.9; February 22, 2002</b>
|
||||
* <a href="archive/mono-0.9">Mono 0.9 release notes</a>
|
||||
|
||||
* <a href="archive/mcs-0.9.tar.gz">mcs-0.9.tar.gz</a>
|
||||
Mono C# compiler
|
||||
* <a href="archive/mono-0.9.tar.gz">mono-0.9.tar.gz</a>
|
||||
Mono runtime
|
||||
</ul>
|
||||
|
||||
<a name="feb-11">
|
||||
<b>February 11, 2002</b>
|
||||
* <a href="archive/mcs-0.8.tar.gz">mcs-0.8.tar.gz</a>
|
||||
Mono C# compiler
|
||||
* <a href="archive/mono-0.8.tar.gz">mono-0.8.tar.gz</a>
|
||||
Mono runtime
|
||||
</ul>
|
||||
|
||||
<a name="sep-18">
|
||||
<b>September 18, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mono-0.7.tar.gz">mono-0.7.tar.gz</a>: Mono Runtime 0.7 release.
|
||||
* <a href="archive/mcs-0.7.tar.gz">mcs-0.7.tar.gz</a>: Mono Compiler and Classes 0.7 release.
|
||||
* <a href="archive/mono-0.7">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
<a name="august-22">
|
||||
<b>August 22, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mono-0.6.tar.gz">mono-0.6.tar.gz</a>: Mono Runtime 0.6 release.
|
||||
* <a href="archive/mono-compiler-classes-0.6.tar.gz">mono-compiler-classes-0.6.tar.gz</a>: Mono Compiler and Classes 0.6 release.
|
||||
* <a href="archive/mono-0.6">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="july-29">
|
||||
<b>July 29, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mono-0.5.tar.gz">mono-0.5.tar.gz</a>: Mono Runtime 0.5 release.
|
||||
* <a href="archive/mono-0.5">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="july-22">
|
||||
<b>July 22, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-22-Jul-2001.tar.gz">mcs-22-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-Jul-22-Jul-19-2001.tar.gz">Differences since 19</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-22">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-19">
|
||||
<b>July 19th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-19-Jul-2001.tar.gz">mcs-19-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-Jul-17-Jul-19-2001.tar.gz">Differences since 17</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-19">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-17">
|
||||
<b>July 17th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-17-Jul-2001.tar.gz">mcs-17-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-Jul-15-Jul-17-2001.tar.gz">Differences since 15</a>: CVS snapshot.
|
||||
* <a href="archive/mcs-17">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-15">
|
||||
<b>July 15th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-15-Jul-2001.tar.gz">mcs-15-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mono-0.4.tar.gz">mono-0.4.tar.gz</a>: Packaged Source Code.
|
||||
* <a href="archive/mono-0.4">Release Notes.</a>
|
||||
</ul>
|
||||
|
||||
<a name="july-14">
|
||||
<b>July 14th, 2001</b>
|
||||
<ul>
|
||||
* <a href="archive/mcs-12-Jul-2001.tar.gz">mcs-12-Jul-2001.tar.gz</a>: CVS snapshot.
|
||||
* <a href="archive/mono-0.3.tar.gz">mono-0.3.tar.gz</a>: Packaged Source Code.
|
||||
</ul>
|
||||
|
||||
<a name="july-8">
|
||||
<b>July 8th, 2001</b>
|
||||
|
||||
<ul>
|
||||
* <a href="archive/mcs-08-Jul-2001.tar.gz">mcs-08-Jul-2001.tar.gz</a>: CVS Snapshot
|
||||
* <a href="archive/mono-08-Jul-2001.tar.gz">mono-08-Jul-2001.tar.gz</a>: CVS Snapshot
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<a href="#ximian">The Ximian Role in the Mono project</a><br>
|
||||
<a href="#gnome">Mono and GNOME</a><br>
|
||||
<a href="#gui">Building GUI applications with Mono</a><br>
|
||||
<a href="#winforms">Mono and WinForms</a><br>
|
||||
<a href="#msft">Mono and Microsoft</a><br>
|
||||
<a href="#pnpproject">Mono and the Portable.NET Project</a><br>
|
||||
<a href="#webservices">Web Services</a><br>
|
||||
@@ -21,7 +20,7 @@
|
||||
<a href="#problems">Mono Common Problems</a><br>
|
||||
|
||||
A <a
|
||||
href="http://www.es.gnome.org/documentacion/articulos/MONO-PUF/MONO-PUF/">spanish
|
||||
href="http://www.es.gnome.org/documentacion/articulos/mono-puf/mono-puf/">Spanish
|
||||
translation</a> is also available
|
||||
|
||||
<a name="basics"></a>
|
||||
@@ -44,7 +43,7 @@ A: The ".NET Initiative" is a somewhat nebulous company-wide effort by
|
||||
framework. Mono is an implementation of the development framework,
|
||||
but not an implementation of anything else related to the .NET
|
||||
Initiative, such as Passport, software-as-a-service, or
|
||||
corporate rebranding.
|
||||
corporate re-branding.
|
||||
|
||||
Q: What technologies are included in Mono?
|
||||
|
||||
@@ -97,7 +96,7 @@ A: Yes, we will be implementing the APIs of the .NET Framework SDK
|
||||
|
||||
Q: Will you offer an ECMA-compliant set of class libraries?
|
||||
|
||||
A: Eventually we will. Our current focus is on interoperating
|
||||
A: Eventually we will. Our current focus is on inter-operating
|
||||
with the Microsoft SDK, but we will also offer an ECMA compliant
|
||||
set of libraries.
|
||||
|
||||
@@ -196,7 +195,7 @@ A: Mono will ship on various stages as they mature. Some people
|
||||
require only a subset of the technologies, those will ship first.
|
||||
|
||||
More advanced features will take more time to develop. A support
|
||||
timeline will be available in June 2002.
|
||||
time line will be available in June 2002.
|
||||
|
||||
<a name="gnome"></a>
|
||||
** Mono and GNOME
|
||||
@@ -225,7 +224,7 @@ A: It is still far to early for discussions of "switching over." No
|
||||
|
||||
We encourage GNOME developers to continue using the existing tools,
|
||||
libraries and components. Improvements made to GNOME will have an
|
||||
impact on Mono, as they would be the "backend" for various classes.
|
||||
impact on Mono, as they would be the "back-end" for various classes.
|
||||
|
||||
Q: Will Mono include compatibility with Bonobo components? What is the
|
||||
relationship between Mono and Bonobo?
|
||||
@@ -273,7 +272,7 @@ A: As long as your applications are 100% .NET and do not make use
|
||||
of P/Invoke to call Win32 functions, your smart client applications
|
||||
will run on Mono platforms.
|
||||
|
||||
Q: Where can I learn mora about Gtk#?
|
||||
Q: Where can I learn more about Gtk#?
|
||||
|
||||
A: The following <a href="http://gtk-sharp.sourceforge.net>link</a> sends you to the page of the project.
|
||||
|
||||
@@ -300,47 +299,11 @@ A: There is a sample file called `DbClient' in gtk-sharp/samples that you
|
||||
gtk-sharp/sample/DbClient, where there is a GTK# application that uses
|
||||
System.Data. It does not use DataAdapter, but DataReader though.
|
||||
|
||||
<a name="winforms"></a>
|
||||
** Mono and WinForms
|
||||
|
||||
Q: Can you tell me why aren't you implementing WinForms?.
|
||||
|
||||
A: (This is based in an original mail to mono-list written by Miguel de
|
||||
Icaza. You should read it for completion, but the core part is here).
|
||||
|
||||
First, Windows.Forms is packed with quirks and is not that great of a
|
||||
toolkit in the first place. Up to the point of the unconfirmed rumor
|
||||
that Microsoft is working on a replacement for it.
|
||||
|
||||
Once the runtime is done, we will very likely start contributing to
|
||||
the Gtk# project ourselves, and we will likely start doing feasibility
|
||||
work on getting Mono used by Gnome developers: full gnome apps and
|
||||
extending existing applications.
|
||||
|
||||
Those interested in hacking on Windows.Forms are welcome to do so,
|
||||
but Ximian will not likely look at it in the near future; if there is
|
||||
enough demand, or I can be convinced that Windows.Forms is useful for
|
||||
something Ximian might re-evaluate our resource allocation for this
|
||||
task.
|
||||
|
||||
By doing native ports, we could use the same API on all those systems.
|
||||
Also, Gtk is mature enough, we know this because we have built an entire
|
||||
desktop (and all sorts of very window system-specific hacks), and we
|
||||
have built a bunch of productivity applications with it.
|
||||
|
||||
Q: What about VCL?.
|
||||
|
||||
Someone mentioned VCL. The only problem with the VCL is that it can
|
||||
only be used for GPL applications (or I guess you could license it from
|
||||
Borland for your app), and would have to be ported from Delphi to C#
|
||||
(or someone would have to write a CIL compiler for it).
|
||||
|
||||
Q: What about doing something like the eclipse project (www.eclipse.org)?
|
||||
|
||||
A: The Eclipse toolkit is not a general purpose toolkit. It will require a
|
||||
lot of work before it is such a thing. It is a toolkit used to
|
||||
implement a development environment.
|
||||
Q: Do you have an estimate for when Windows.Forms will be released?
|
||||
|
||||
A: We do not know, volunteers are working on this, but there is no set
|
||||
date yet. The current approach is using the Wine Library to implement
|
||||
it.
|
||||
|
||||
<a name="msft"></a>
|
||||
** Mono and Microsoft
|
||||
@@ -365,7 +328,7 @@ Q: Do you fear that Microsoft will change the spec and render Mono
|
||||
|
||||
A: No. Microsoft proved with the CLI and the C# language that it was
|
||||
possible to create a powerful foundation for many languages to
|
||||
interoperate. We will always have that.
|
||||
inter-operate. We will always have that.
|
||||
|
||||
Even if changes happened in the platform which were undocumented,
|
||||
the existing platform would a value on its own.
|
||||
@@ -445,17 +408,17 @@ Q: Will I be able to compile a Microsoft VB.NET application and execute
|
||||
|
||||
A: Once we have a complete VisualBasic runtime, yes.
|
||||
|
||||
Q: Can mono run the WebMatrix ?
|
||||
Q: Can mono run the WebMatrix?
|
||||
|
||||
A: No. That requires winforms (we don't have).
|
||||
A: No. That requires System.Windows.Forms support which is not
|
||||
currently implemented.
|
||||
|
||||
Q: Does mono have something like Passport ? (ie PassportIdentity class,somewhere
|
||||
in System.Web ?) . Will mono have a server side Passport/Similar framework
|
||||
for XSP as well as client classes ?
|
||||
Q: Does mono have something like Passport?
|
||||
Will mono have a server side Passport/Similar framework for XSP as well as client classes?
|
||||
|
||||
A: Not yet, but the client side API for authentication is not the problem.
|
||||
We will likely have a lot of other authentication APIs, like the Liberty
|
||||
Aliance APIs. The problem is people on the web provider end that might use
|
||||
Alliance APIs. The problem is people on the web provider end that might use
|
||||
this for authentication.
|
||||
|
||||
<a name="pnpproject"></a>
|
||||
@@ -474,7 +437,7 @@ A: Most of Mono is being written using C#, with only
|
||||
|
||||
<li> A multi-platform runtime engine: both a JIT engine and an
|
||||
interpreter exist. The JIT engine runs currently on x86
|
||||
systems, while the interpreter works on Sparc, StrongARM and
|
||||
systems, while the interpreter works on SPARC, StrongARM and
|
||||
PowerPC systems.
|
||||
|
||||
<li> Supports Linux, Windows and Solaris at this point.
|
||||
@@ -482,21 +445,21 @@ A: Most of Mono is being written using C#, with only
|
||||
<li> The JIT engine is written using a portable instruction
|
||||
selector which not only generates good code (we are told
|
||||
that we are faster than Rotor, but it is hard to tell) but
|
||||
is also the foundation to retarget the JIT engine to other
|
||||
is also the foundation to re-target the JIT engine to other
|
||||
systems.
|
||||
|
||||
The system employed is described in various compiler
|
||||
books and it is very similar to what is described in the
|
||||
book that covers LCC, the Ansi C retargetable C compiler.
|
||||
book that covers LCC, the ANSI C retargetable C compiler.
|
||||
|
||||
<li> The JIT engine supports inlining, constant folding and propagation,
|
||||
<li> The JIT engine supports in-lining, constant folding and propagation,
|
||||
|
||||
<li> Full support for remoting in the runtime, but the class
|
||||
libraries are still behind.
|
||||
|
||||
<li> The C# compiler, the JIT engine and the class libraries are
|
||||
mature enough that the whole system is self-hosting, ie, that
|
||||
it can be fully developed with itself at this point.
|
||||
mature enough that the whole system is self-hosting. This means that
|
||||
we develop Mono completely with itself at this point.
|
||||
|
||||
<li> We are not yet done, and there is a lot of work left to be
|
||||
done
|
||||
@@ -523,7 +486,7 @@ A: Mono is only related to Web Services in that it will implement the
|
||||
Q: Can I author Web Services with Mono?
|
||||
|
||||
A: You will be able to write Web Services on .NET that run on Mono and
|
||||
viceversa.
|
||||
vice-versa.
|
||||
|
||||
Q: If Mono implements the SDK classes, will I be able to write and
|
||||
execute .NET Web Services with it?
|
||||
@@ -545,9 +508,9 @@ A: Yes. The CLI contains enough information about a class that
|
||||
exposing it to other RPC systems (like CORBA) is really simple, and
|
||||
does not even require support from an object.
|
||||
|
||||
We will be implementing CORBA interoperation as an extension to the
|
||||
We will be implementing CORBA inter-operation as an extension to the
|
||||
Mono classes so that we can integrate with Bonobo, just like
|
||||
Microsoft provides COM interoperation classes and support
|
||||
Microsoft provides COM inter-operation classes and support
|
||||
mechanisms.
|
||||
|
||||
Q: Can I serialize my objects to other things other than XML?
|
||||
@@ -562,13 +525,13 @@ A: No. Mono will be using a new implementation of CORBA that isn't still started
|
||||
<a name="devel"></a>
|
||||
** Development Tools and Issues
|
||||
|
||||
Q: Will it be possible to use the CLI features without using bytecodes
|
||||
Q: Will it be possible to use the CLI features without using byte codes
|
||||
or the JIT?
|
||||
|
||||
A: Yes. The CLI engine will be made available as a shared library.
|
||||
The garbage collection engine, the threading abstraction, the
|
||||
object system, the dynamic type code system and the JIT will be
|
||||
available for C developers to integreate with their applications if
|
||||
available for C developers to integrate with their applications if
|
||||
they wish to do so.
|
||||
|
||||
Q: Will you have new development tools?
|
||||
@@ -609,7 +572,7 @@ Q: What about using something like Jabber instead of the System.Messaging
|
||||
namespace?.
|
||||
|
||||
A: In short, MSMQ is not something like Jabber, but asynchronous messaging
|
||||
through queues. Usefull queues do more than serialize messages, they are
|
||||
through queues. Useful queues do more than serialize messages, they are
|
||||
also platform bridges.
|
||||
|
||||
Q: Are you supporting XMLDocument and relatives?.
|
||||
@@ -620,14 +583,14 @@ A: Currently, we aren't implementing them yet. It would require updates to
|
||||
|
||||
Q: Is there any plan to develop an aspx server for Mono?.
|
||||
|
||||
A: The webserver turned out to be very simple compared to the rest of the
|
||||
A: The web server turned out to be very simple compared to the rest of the
|
||||
work. Gonzalo has got the page generator mostly done (a module called
|
||||
xsp, who has nothing to do with the XSP term used in the Apache Project).
|
||||
Patrik has done a lot of the work to get the ProcessRequest to work.
|
||||
You can try to help in the final touches to the System.Web classes and
|
||||
writing regression tests for the widgets we have.
|
||||
|
||||
Q: Is there any way I can develop the class libraries using linux yet?
|
||||
Q: Is there any way I can develop the class libraries using Linux yet?
|
||||
|
||||
A: Yes. Some class libraries can be developed on Linux. Search for
|
||||
Paolo's post (he lists which classes can be compiled fine now).
|
||||
@@ -635,7 +598,7 @@ A: Yes. Some class libraries can be developed on Linux. Search for
|
||||
Q: Is there any way I can install a known working copy of mono in /usr,
|
||||
and an experimental copy somewhere else, and have both copies use
|
||||
their own libraries? (I'm still not very good at library paths in
|
||||
linux)
|
||||
Linux)
|
||||
|
||||
A: Yes. Just use two installation prefixes.
|
||||
|
||||
@@ -645,52 +608,19 @@ A: If you do a test suite for C#, you might want to keep it
|
||||
independent of the Mono C# compiler, so that other compiler
|
||||
implementations can later use it.
|
||||
|
||||
Q: Is the current stage the implementation of mono_create_trampoline
|
||||
function? Hence the sparc-codegen.h is reasonably complete? Is
|
||||
mono/arch/x86/* the best reference material for this stuff?
|
||||
|
||||
A: sparc-codegen.h is basically complete. We may want to add some
|
||||
convenience macros along the way, but it has all the stuff you need.
|
||||
And yes, or, the ppc/ dir, since the ppc call convention is more similar
|
||||
to the sparc one than the x86 one. The current issues with the sparc
|
||||
code are. roughly:
|
||||
1) it needs to handle overflowing the out registers (the additional
|
||||
arguments need to be put on the stack)
|
||||
2) it needs to flush the icache where the generated code is stored
|
||||
3) it needs to implement mono_create_method_pointer to get delegates
|
||||
working
|
||||
4) it needs a couple of updates (mono_method_pointer_get is no longer
|
||||
needed, for example)
|
||||
|
||||
Q: Would it be too terrible to have another corlib signed as mscorlib?
|
||||
|
||||
A: We rename corlib to mscorlib also when saving the PE files, in fact,
|
||||
the runtime can execute program created by mono just fine.
|
||||
|
||||
Q: How do I build corlib under Linux?
|
||||
|
||||
A: You can build your own (see the web site on how to get the mcs
|
||||
project from cvs), but in order to build them using mcs you need a
|
||||
set of working class libraries. After building the runtime (using
|
||||
mono-build.sh) get them from the nightly build and put them (and
|
||||
mcs.exe) in your mono/install/lib directory. Then you should be able
|
||||
to do: cd mcs, then: make -f makefile.gnu, then: cp mcs/mcs.exe
|
||||
class/lib/*.dll ../install/lib Also, you should know that you can
|
||||
either get your dose of DLLs from MonoCharge, or from
|
||||
http://primates.ximian.com/~miguel/runtime. MonoCharge is updated
|
||||
automatically, while the later is only updated when Miguel is around
|
||||
Once you have the DLLs, you can use `make -f makefile.gnu' as described
|
||||
before to self-host.
|
||||
|
||||
Q: Is there a relatively straightforward way to repeat the steps taken
|
||||
by Paolo to get Mono completely self-hosted on linux?
|
||||
by Paolo to get Mono completely self-hosted on Linux?
|
||||
|
||||
A: To build the compiler and class libraries in Linux, run:
|
||||
<ul><li>make -f makefile.gnu. To install them, run: </li>
|
||||
<li>make -f makefile.gnu install</li>
|
||||
<li>You can also specify a prefix:</li>
|
||||
<li>make -f makefile.gnu install prefix=/opt</li>
|
||||
<li>make -f makefile.gnu install prefix=/opt/mono</li>
|
||||
</ul>
|
||||
|
||||
If you want to produce and distribute a monocharge tarball, run:
|
||||
make -f makefile.gnu dist
|
||||
Of course you have to run these in the top level mcs directory.
|
||||
@@ -708,7 +638,7 @@ A: The remoting infrastructure is in place. Some of the channels and
|
||||
formatters are not.
|
||||
|
||||
Q: I'm wondering if there are any plans to start using nant to build the
|
||||
class lib + test lib. i think that every project neeed/should use an
|
||||
class lib + test lib. i think that every project need/should use an
|
||||
automated build process and nant + a couple of tools enables this. is
|
||||
the problem that the compiler can't run nant yet?
|
||||
|
||||
@@ -733,7 +663,7 @@ Q: Do I need install cygwin to work on ASP.NET in mono or Linux is enough since
|
||||
|
||||
A: Linux is enough.
|
||||
|
||||
Q: Any plan to make ASP.NET in mono works with Apache in linux?.
|
||||
Q: Any plan to make ASP.NET in mono works with Apache in Linux?.
|
||||
|
||||
A: Yes, we have plans to do so, but we need to wait for Patrik's patches to
|
||||
HttpRuntime. Once that is there, writing a mod_mono should be trivial
|
||||
@@ -756,12 +686,9 @@ Q: In developing the data architecture for the application are there and
|
||||
transition (minimum code rewrite) to Mono's ADO.NET implementation? (For
|
||||
example, strongly typed datasets versus untyped datasets, etc...)
|
||||
|
||||
A: we are implementing all the classes in Microsoft .NET's System.Data, so
|
||||
you can be sure that things will work the same in Mono as with the MS's
|
||||
implementation. We'll maybe provide extra classes to fix some things
|
||||
we've found missing while developing ADO.NET in Mono, but if you keep
|
||||
using the MS's System.Data classes, things will work out of the box with
|
||||
no changes (or at least that's the plan :-)
|
||||
A: We are implementing all the classes in Microsoft .NET's System.Data, so
|
||||
you can be sure that things will work the same in Mono as with the Microsoft
|
||||
implementation.
|
||||
|
||||
<a name="java">
|
||||
** Mono and Java
|
||||
@@ -772,7 +699,7 @@ Q: Why don't you use Java? After all, there are many languages that
|
||||
A: You can get very good tools for doing Java development on free
|
||||
systems right now. <a href="http://www.redhat.com">Red Hat</a> has
|
||||
contributed a <a href="http://gcc.gnu.org">GCC</a> <a
|
||||
href="http://gcc.gnu.org/java">frontend for Java</a> that can take
|
||||
href="http://gcc.gnu.org/java">front-end for Java</a> that can take
|
||||
Java sources or Java byte codes and generate native executables; <a
|
||||
href="http://www.transvirtual.com">Transvirtual</a> has implemented
|
||||
<a href="http://www.kaffe.org">Kaffe</a> a JIT engine for Java;
|
||||
@@ -791,10 +718,10 @@ A: Yes, Java could target the CLI. We have details on a <a
|
||||
href="ideas.html#guavac">project</a> that someone could take on to
|
||||
make this happen.
|
||||
|
||||
Microsoft has an implemenation of the Java language called J# that
|
||||
Microsoft has an implementation of the Java language called J# that
|
||||
can target the CIL execution engine.
|
||||
|
||||
Q: Is it possible to write a JVM byte code to CIL convertor?
|
||||
Q: Is it possible to write a JVM byte code to CIL converter?
|
||||
|
||||
A: Yes, it is possible. Here are a few starting point:
|
||||
|
||||
@@ -814,7 +741,7 @@ A: Yes, it is possible. Here are a few starting point:
|
||||
be translated into the equivalent "meaning" in CLR-land.
|
||||
</ul>
|
||||
|
||||
Q: Could mono become a hybrid cil/java platform?
|
||||
Q: Could mono become a hybrid CIL/java platform?
|
||||
|
||||
A: No. It is quite far from the philosophy of the project. The idea of Mono
|
||||
is, to have only _one_ VM, on which all can run. And if there existing a
|
||||
@@ -822,15 +749,15 @@ A: No. It is quite far from the philosophy of the project. The idea of Mono
|
||||
like J-Sharp on Mono, you can write programs in Java, which than can run
|
||||
on Mono. You do not need two bindings (like your example: GTK-Sharp _and_
|
||||
Java-Gnome). You need only _one_ of it (GTK-Sharp). Thats the idea of Mono.
|
||||
An other point is, that there are no people, who use OpenSource-JVMs. They
|
||||
An other point is, that there are no people, who use Open Source-JVMs. They
|
||||
all prefer Suns original. But for Unix there don't exist a .NET-Framework.
|
||||
So it is possible, that in the future Mono is the standard .NET for unixes.
|
||||
So it is possible, that in the future Mono is the standard .NET for Unixes.
|
||||
|
||||
Q: Do you plan to implement a Javascript compiler?
|
||||
|
||||
A: Yes. Eto Demerzal has started a Rhino port to C#.
|
||||
After this is completed, we will begin developing
|
||||
the Javascript compiler.
|
||||
the JavaScript compiler.
|
||||
|
||||
<a name="extending"></a>
|
||||
** Extending Mono
|
||||
@@ -861,7 +788,7 @@ A: Embracing a good technology is good. Extending technologies in
|
||||
encourage you to make those classes operate correctly well in both
|
||||
Mono and .NET.
|
||||
|
||||
Q: Is there any way I can develop the class libraries using linux yet?
|
||||
Q: Is there any way I can develop the class libraries using Linux yet?
|
||||
|
||||
A: Yes. Some class libraries can be developed on Linux. Search for
|
||||
Paolo's post (he lists which classes can be compiled fine now).
|
||||
@@ -869,7 +796,7 @@ A: Yes. Some class libraries can be developed on Linux. Search for
|
||||
Q: Is there any way I can install a known working copy of mono in /usr,
|
||||
and an experimental copy somewhere else, and have both copies use
|
||||
their own libraries? (I'm still not very good at library paths in
|
||||
linux)
|
||||
Linux)
|
||||
|
||||
A: Yes. Just use two installation prefixes.
|
||||
|
||||
@@ -887,7 +814,7 @@ Q: What about Mono on non Linux-based systems?
|
||||
|
||||
A: Our main intention at Ximian is to be able to develop GNOME
|
||||
applications with Mono, but if you are interested in providing a
|
||||
port of the Winform classes to other platforms (frame buffer or
|
||||
port of the Winforms classes to other platforms (frame buffer or
|
||||
MacOS X for example), we would gladly integrate them, as long
|
||||
they are under an open source license.
|
||||
|
||||
@@ -897,21 +824,21 @@ A: Mono currently runs on Linux, Windows, Solaris and FreeBSD.
|
||||
There is a JIT engine available for x86 processors that can
|
||||
generate code and optimizations tailored for a particular CPU.
|
||||
|
||||
Interpreters exist for the SPARC, PowerPC and StrongARM cpus.
|
||||
Interpreters exist for the SPARC, PowerPC and StrongARM CPUs.
|
||||
|
||||
Q: Does Mono run on Windows?
|
||||
|
||||
A: Yes. The Compiler and the runtime both run on Windows.
|
||||
A: Yes. You can get pre-compiled
|
||||
binaries from <a href="http://www.go-mono.com/download.html">http://www.go-mono.com/download.html</a>
|
||||
|
||||
Q: When will mono and mcs compile on Linux?.
|
||||
Q: Does Mono run on Linux?
|
||||
|
||||
A: That happend a long time ago. Know you can download and compile
|
||||
them or even install them from already made binary packages for
|
||||
Windows and for Linux (RPM/DEB).
|
||||
A: Yes. You can get pre-compiled
|
||||
binaries from <a href="http://www.go-mono.com/download.html">http://www.go-mono.com/download.html</a>
|
||||
|
||||
Q: Will I require Cygwin to run mono?
|
||||
|
||||
A: No. While you'll need it to compile it, it runs without cygwin and does not even require cygwin1.dll
|
||||
A: No. Cygwin is only required to build Mono.
|
||||
|
||||
Q: Will Mono depend on GNOME?
|
||||
|
||||
@@ -940,7 +867,7 @@ Q: Has anyone succeeded in building a Mac version of the C# environment.
|
||||
|
||||
A: You could try to check with the Darwin people, or the Fink people.
|
||||
Mono/C# is self hosting on Linux/PPC which is the hard part, so it
|
||||
should be relatively simple to get it to work on macos
|
||||
should be relatively simple to get it to work on MacOS
|
||||
|
||||
<a name="reuse"></a>
|
||||
** Reusing Existing Code
|
||||
@@ -987,7 +914,7 @@ Q: Will built-in reporting be supported for crystal reports? This is a
|
||||
heavily used part of our system.
|
||||
|
||||
A: Probably not. Crystal Reports are propriety. Someone may try to emulate
|
||||
the behaviour, but no-one has yet volunteered.
|
||||
the behavior, but no-one has yet volunteered.
|
||||
|
||||
Q: Who about writing to the registry? As I understand it, Linux does not have
|
||||
a counterpart to the registry. Should I avoid relying on that feature?
|
||||
@@ -1008,7 +935,7 @@ A: if their license is compatible with mono's, yes, we'd think about porting
|
||||
<a name="gcc"></a>
|
||||
** Mono and GCC
|
||||
|
||||
Q: Are you working on a GCC front-end to C#? A GCC backend that will
|
||||
Q: Are you working on a GCC front-end to C#? A GCC back-end that will
|
||||
generate CIL images? What about making a front-end to GCC that
|
||||
takes CIL images and generates native code?
|
||||
|
||||
@@ -1074,6 +1001,14 @@ A: The C# Compiler is released under the terms of the <a
|
||||
href="http://www.opensource.org/licenses/mit-license.html">MIT X11</a>
|
||||
license.
|
||||
|
||||
The Mono runtime and the Mono C# Compiler are also available under
|
||||
a proprietary license for those who can not use the LGPL and the
|
||||
GPL in their code.
|
||||
|
||||
For licensing details, contact <a
|
||||
href="mailto:[email protected]">[email protected]</a>
|
||||
|
||||
|
||||
Q: I would like to contribute code to Mono under a particular
|
||||
license. What licenses will you accept?
|
||||
|
||||
@@ -1081,6 +1016,9 @@ A: We will have to evaluate the licenses for compatibility first,
|
||||
but as a general rule, we will accept the code under the same
|
||||
terms of the "container" module.
|
||||
|
||||
Q: Is the Mono
|
||||
|
||||
|
||||
<a name="patents"></a>
|
||||
** Patents
|
||||
|
||||
@@ -1091,7 +1029,9 @@ Q: Could patents be used to completely disable Mono (either submarine
|
||||
A: No. First, its basic functional capabilities have pre-existed too
|
||||
long to be held up by patents. The basic components of Mono are
|
||||
technologically equivalent to Sun's Java technology, which has been
|
||||
around for years. Mono will also implement multi-language and
|
||||
around for years.
|
||||
|
||||
Mono will also implement multi-language and
|
||||
multi-architecture support, but there are previous technologies
|
||||
such as UCSD p-code and ANDF that also support multiple languages
|
||||
using a common intermediate language. The libraries are similar
|
||||
@@ -1117,11 +1057,11 @@ A: The key difference between CORBA (and COM) and the CLI is that the
|
||||
CLI allows "data-level interoperability" because every
|
||||
language/component uses the same data layout and memory management.
|
||||
|
||||
This means you can operate directly upon the datatypes that someone
|
||||
This means you can operate directly upon the data types that someone
|
||||
else provides, without having to go via their interfaces. It also
|
||||
means you don't have to "marshall" (convert) parameters (data
|
||||
means you don't have to "marshal" (convert) parameters (data
|
||||
layouts are the same, so you can just pass components directly) and
|
||||
you don't have to worry about memory managment, because all
|
||||
you don't have to worry about memory management, because all
|
||||
languages/components share the same garbage collector and address
|
||||
space. This means much less copying and no need for reference
|
||||
counting.
|
||||
@@ -1135,7 +1075,7 @@ Q: Will Ximian offer certifications on Mono or related technologies?.
|
||||
|
||||
A: It's possible. But there is no plan about this. So the short answer is no.
|
||||
|
||||
Q: Are there any Boehm's gc binaries?
|
||||
Q: Are there any Boehm's GC binaries?
|
||||
|
||||
A: Yes. You can find RPMs <a href="http://java.thn.htu.se/~toor/">here</a>, though
|
||||
if your distribution provides the correct packages, you should use those.
|
||||
@@ -1144,12 +1084,13 @@ A: Yes. You can find RPMs <a href="http://java.thn.htu.se/~toor/">here</a>, thou
|
||||
Q: How can I report a bug?
|
||||
|
||||
A: The best thing is to track down the bug and provide a simple test to
|
||||
reproduce the bug. You can then add the bug to
|
||||
<a href="http://bugzilla.ximian.com/enter_bug.cgi">bugzilla</a> or
|
||||
simply send it to [email protected]. Please provide info about
|
||||
what version of mono you're using and any relevant details to be
|
||||
able to repoduce the bug. Note that bugs reported on the mailing-list
|
||||
may be easily forgotten, so it's better to file them in bugzilla.
|
||||
reproduce the bug. You can then add the bug to the
|
||||
<a href="http://bugzilla.ximian.com/enter_bug.cgi">bugtracking system</a>.
|
||||
|
||||
Please provide information about what version of mono you're using
|
||||
and any relevant details to be able to reproduce the bug. Note that
|
||||
bugs reported on the mailing-list may be easily forgotten, so it's
|
||||
better to file them in the <a href="http://bugzilla.ximian.com/enter_bug.cgi">bug tracking system</a>.
|
||||
|
||||
Q: Does mcs support the same command line options as the MS C#
|
||||
compiler?
|
||||
|
||||
@@ -13,6 +13,14 @@ Some of them may start contributing because they want a mention in the
|
||||
|
||||
* Mono Hackers
|
||||
|
||||
** Sergey Chaban
|
||||
|
||||
Sergey has been a long time contributor to the project, from the early
|
||||
work on the class libraries that were critical to Mono's origin: every
|
||||
time you use a Hashtable in Mono, it runs Sergey's code, to the
|
||||
low-level optimizations on the JIT engine and to his work on ILASM and
|
||||
the PEToolkit. And countless other things.
|
||||
|
||||
** Nick Drochak
|
||||
|
||||
The first, deserved, entry in the <b>Mono Hackers Hall Of Fame</b> is for
|
||||
|
||||
@@ -33,9 +33,11 @@
|
||||
<td>
|
||||
<table border=1>
|
||||
<tr>
|
||||
<td>
|
||||
<td colspan="3">
|
||||
<b><center>Mono Status</center></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b><a href="c-sharp.html">C# Compiler</a></b>
|
||||
</td>
|
||||
@@ -84,6 +86,106 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>Events</h3>
|
||||
|
||||
<ul>
|
||||
<li><b><a
|
||||
href="http://www.sigs-datacom.de/sd/kongresse/dotnet_2002/index.htm">.NET
|
||||
ONE 2002:</a></b> Come see Paolo, Mike and Miguel from the Mono team at the .NET ONE conference in Frankfurt.</ul>
|
||||
</ul>
|
||||
|
||||
@item Sep 19th, 2002: Mono Survey.
|
||||
|
||||
Help us plan for the future of Mono by filing out the <a
|
||||
href="http://primates.ximian.com/~miguel/monosurvey">First Mono
|
||||
Survey</a>
|
||||
|
||||
@item Sep 17th, 2002: Mono Hackers Hall of Fame: Sergey Chaban
|
||||
|
||||
The <a href="hackers.html">Mono Hackers Hall Of Fame</a>
|
||||
continues to show our appreciation to the excellent
|
||||
contributors that made <b>mono::</b> a successful free
|
||||
software project.
|
||||
|
||||
This time the Hall of Fame welcomes Sergey Chaban. Sergey has
|
||||
been a long time contributor to the project, from the early
|
||||
work on the class libraries that were critical to Mono's
|
||||
origin: every time you use a Hashtable in Mono, it runs
|
||||
Sergey's code, to the low-level optimizations on the JIT
|
||||
engine and to his work on ILASM and the PEToolkit.
|
||||
|
||||
|
||||
@item Sep 16th, 2002: Documentation Tools, ILASM, Debugger, Mono LDAP, Winforms
|
||||
|
||||
Adam Treat has started moving the documentation universe again. We
|
||||
have a new strategy to document our APIs (given that we have
|
||||
chosen <a href="classlib-doc.html">not to document the code
|
||||
inline</a>). This includes the use of a master reference file
|
||||
that will hold the entry points to document. All master files
|
||||
for our assemblies have been checked into CVS now.
|
||||
|
||||
Sergey Chaban's Mono.PEToolkit and ILASM tools have been
|
||||
checked into CVS. Although ILASM is old and will soon be
|
||||
updated, we wanted to get the build issues sorted out.
|
||||
|
||||
Martin Baulig's Mono Debugger is still on its early stages,
|
||||
but you can run and run step by step your C# code and C code
|
||||
(including the Mono runtime). Dwarf-2 is required to compile
|
||||
your code. The regular step, step-into, and assembly-level
|
||||
step and step-into are supported. And comes with a Gtk#
|
||||
UI. The debugger is written mostly in C# with some C glue
|
||||
code. Most of the work is on the engine, we will be working
|
||||
on making a good UI in the future.
|
||||
|
||||
Chris Toshok of the Hungry Programmer's fame has checked in
|
||||
Mono.Directory.LDAP, a C# wrapper for the LDAP libraries.
|
||||
This is the substrate for implementing the
|
||||
System.DirectoryServices assembly.
|
||||
|
||||
Andrew has also continued with some of the cryptographic
|
||||
classes implemetation.
|
||||
|
||||
After much public debate, we have chosen a new <a
|
||||
href="winforms.html">strategy to implement winforms</a>.
|
||||
Implementing a Gtk, Qt or Aqua based version of Winforms was
|
||||
going to be almost as complex as implementing Wine itself. So
|
||||
the new strategy is to only roll out a WineLib-based
|
||||
implementation.
|
||||
|
||||
@item Sep 4th, 2002: .NET One 2002 Program available
|
||||
|
||||
The <a
|
||||
href="http://www.sigs-datacom.de/sd/kongresse/dotnet_2002/index.htm">.NET
|
||||
ONE 2002</a> conference in Frankfurt is now available. Paolo
|
||||
will be talking about the Mono JIT and embedding the Mono
|
||||
runtime in your Windows and Linux applications. Mike Kestner
|
||||
will talk about <a href="http://gtk-sharp.sf.net">Gtk#</a> and
|
||||
the automatic binding generator used by Gtk# and Miguel will
|
||||
be talking about the Mono project on Monday's keynote and on
|
||||
the Mono C# compiler on Tuesday.
|
||||
|
||||
@item Sep 3rd, 2002: Apache integration
|
||||
|
||||
<a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-September/001862.html">Sterling</a>
|
||||
announced an Apache module that hosts
|
||||
Mono, and allows CIL code to run from within Apache, giving the
|
||||
module access to the Apache runtime. This uses the Mono embedding
|
||||
API.
|
||||
|
||||
@item Aug 24th, 2002: Gtk# 0.4 released
|
||||
|
||||
Shortly after <a href="download.html">Mono 0.15</a> was
|
||||
released a fresh version of <a
|
||||
href="http://gtk-sharp.sf.net">Gtk#</a> was <a
|
||||
href="http://lists.ximian.com/archives/public/mono-list/2002-August/001702.html">announced</a>.
|
||||
|
||||
@item Aug 23rd, 2002: Mono 0.15 released
|
||||
|
||||
Mono 0.15 has been released. Source and RPMs are <a
|
||||
href="download.html">available</a>. The release notes are <a
|
||||
href="archive/mono-0.15">here</a>
|
||||
|
||||
@item Aug 21th, 2002: Portable.NET encodings integrated into Mono.
|
||||
|
||||
Rhys Weatherley has contributed the Portable.NET encoders to
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
* Java
|
||||
|
||||
<b>This is an outline on how to support Java, actual
|
||||
implementations of ideas like this can be found <a href="http://radio.weblogs.com/0109845/">here</a></b>
|
||||
|
||||
|
||||
It would be interesting to support the Java language as part
|
||||
of the Mono project.
|
||||
|
||||
|
||||
+12
-5
@@ -14,7 +14,7 @@
|
||||
|
||||
<ul>
|
||||
* <a href="#JavaScript">Java Script</a>
|
||||
* <a href="java.html">Java</a>
|
||||
* <a href="#java.html">Java</a>
|
||||
* <a href="#c">C</a>
|
||||
</ul>
|
||||
|
||||
@@ -24,6 +24,13 @@
|
||||
* <a href="#Tachy">Tachy</a> (scheme-like)
|
||||
</ul>
|
||||
|
||||
<a name="Java">
|
||||
** Java
|
||||
|
||||
There is a very interesting project to make a JavaVM for .NET
|
||||
<a href="http://radio.weblogs.com/0109845/">here</a>
|
||||
|
||||
|
||||
<a name="MonoLogo">
|
||||
** MonoLogo
|
||||
|
||||
@@ -101,10 +108,10 @@
|
||||
Ideally GCC could be modified to generate CIL, but it is a
|
||||
big task. That would give us various compilers in one pass.
|
||||
|
||||
Rumor is that the next version of the LCC compiler will
|
||||
include an IL backend. We do not know how extensive the support
|
||||
for integration with .NET will be, but it would be an interesting
|
||||
excercise to add an extension to C to call into .NET code.
|
||||
<a href="http://www.cs.princeton.edu/software/lcc">LCC</a> 4.2
|
||||
has been recently released. This release adds support for compiling
|
||||
ANSI C programs to CIL. Note that the CIL support only works on Win32
|
||||
right now, but should be easy to convert to Mono/other architectures.
|
||||
|
||||
LCC is not an open source compiler, but it is free as long as you
|
||||
do not profit from selling it.
|
||||
|
||||
+51
-12
@@ -17,6 +17,12 @@ echo "Building Mono and dependencies in $here, installing to $here/install"
|
||||
|
||||
PATH=$here/install/bin:$here/install/lib:$PATH
|
||||
|
||||
# Make sure cygwin's libiconv is installed, or libtool blows its tiny mind
|
||||
if [ ! -f /usr/lib/libiconv.la ]; then
|
||||
echo "You need to install the cygwin \"libiconv\" package!"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Check mono out first, so we can run aclocal from inside the mono dir (it
|
||||
# needs to see which version of the real aclocal to run)
|
||||
test -z "$CVSROOT" && CVSROOT=:pserver:[email protected]:/mono
|
||||
@@ -42,6 +48,18 @@ fi
|
||||
|
||||
cvs checkout mono || exit -1
|
||||
|
||||
echo "Checking automake version"
|
||||
automake_required="1.6.2"
|
||||
automake_version=`automake --version | head -1 | awk '{print $4}' | tr -d '[a-zA-Z]' | sed 's/-.*$//g'`
|
||||
echo "Found automake version $automake_version"
|
||||
if expr $automake_version \< $automake_required > /dev/null; then
|
||||
echo "Your automake is too old! You need version $automake_required or newer."
|
||||
exit -1
|
||||
else
|
||||
echo "Automake version new enough."
|
||||
fi
|
||||
|
||||
# Select the stable version anyway...
|
||||
if [ ! -z "${AUTO_STABLE}" -o -e /usr/autotool/stable ]; then
|
||||
export AUTO_STABLE=${AUTO_STABLE:-/usr/autotool/stable}
|
||||
export AUTO_DEVEL=${AUTO_STABLE}
|
||||
@@ -49,8 +67,7 @@ fi
|
||||
|
||||
# Need to install pkgconfig and set ACLOCAL_FLAGS if there is not a
|
||||
# pkgconfig installed already. Otherwise set PKG_CONFIG_PATH to the
|
||||
# glib we're about to install in $here/install. This script could
|
||||
# attempt to be clever and see if glib 2 is already installed, too.
|
||||
# glib we're about to install in $here/install.
|
||||
|
||||
|
||||
# --print-ac-dir was added in 1.2h according to the ChangeLog. This
|
||||
@@ -61,15 +78,17 @@ fi
|
||||
# it finds two copies of the m4 macros). The GIMP for Windows
|
||||
# pkgconfig sets its prefix based on the location of its binary, so we
|
||||
# dont need PKG_CONFIG_PATH (the internal pkgconfig config file
|
||||
# $prefix is handled similarly).
|
||||
# $prefix is handled similarly). For the cygwin pkgconfig we do need to
|
||||
# set it, and we need to edit the mingw pc files too.
|
||||
|
||||
function aclocal_scan () {
|
||||
# Quietly ignore the rogue '-I' and other aclocal flags that
|
||||
# aren't actually directories...
|
||||
#
|
||||
# cd into mono/ so that the aclocal wrapper can work out which version
|
||||
# of aclocal to run
|
||||
for i in `(cd mono && aclocal --print-ac-dir)` $ACLOCAL_FLAGS
|
||||
# of aclocal to run, and add /usr/share/aclocal too cos aclocal looks there
|
||||
# too.
|
||||
for i in `(cd mono && aclocal --print-ac-dir)` /usr/share/aclocal $ACLOCAL_FLAGS
|
||||
do
|
||||
if [ -f $i/$1 ]; then
|
||||
return 0
|
||||
@@ -96,10 +115,17 @@ function install_package() {
|
||||
fi
|
||||
}
|
||||
|
||||
if ! aclocal_scan pkg.m4 ; then
|
||||
ACLOCAL_FLAGS="-I $here/install/share/aclocal $ACLOCAL_FLAGS"
|
||||
# pkgconfig is only used during the build, so we can use the cygwin version
|
||||
# if it exists
|
||||
if aclocal_scan pkg.m4 ; then
|
||||
install_pkgconfig=no
|
||||
else
|
||||
install_pkgconfig=yes
|
||||
fi
|
||||
|
||||
# But we still need to use the mingw libs for glib & co
|
||||
ACLOCAL_FLAGS="-I $here/install/share/aclocal $ACLOCAL_FLAGS"
|
||||
|
||||
export PATH
|
||||
export ACLOCAL_FLAGS
|
||||
|
||||
@@ -110,15 +136,28 @@ fi
|
||||
|
||||
# Fetch and install pkg-config, glib, iconv, intl
|
||||
|
||||
install_package pkgconfig-0.80-tml-20020101.zip bin/pkg-config.exe pkgconfig
|
||||
install_package glib-1.3.12-20020101.zip lib/libglib-1.3-12.dll glib
|
||||
install_package glib-dev-1.3.12-20020101.zip lib/glib-1.3.lib glib-dev
|
||||
if [ $install_pkgconfig = "yes" ]; then
|
||||
install_package pkgconfig-0.11-20020310.zip bin/pkg-config.exe pkgconfig
|
||||
else
|
||||
echo "Not installing pkgconfig, you already seem to have it installed"
|
||||
fi
|
||||
install_package glib-2.0.4-20020703.zip lib/libglib-2.0-0.dll glib
|
||||
install_package glib-dev-2.0.4-20020703.zip lib/glib-2.0.lib glib-dev
|
||||
install_package libiconv-1.7.zip lib/iconv.dll iconv
|
||||
install_package libiconv-dev-1.7.zip lib/iconv.lib iconv-dev
|
||||
install_package libintl-0.10.40-20020101.zip lib/libintl-1.dll intl
|
||||
install_package libgc-dev.zip lib/gc.dll gc-dev
|
||||
|
||||
# Needed to find the libiconv bits
|
||||
if [ $install_pkgconfig = "no" ]; then
|
||||
echo "Fixing up the pkgconfig paths"
|
||||
for i in $here/install/lib/pkgconfig/*.pc
|
||||
do
|
||||
mv $i $i.orig
|
||||
sed -e "s@^prefix=/target\$@prefix=$here/install@" < $i.orig > $i
|
||||
done
|
||||
export PKG_CONFIG_PATH=$here/install/lib/pkgconfig
|
||||
fi
|
||||
|
||||
# Needed to find the libgc bits
|
||||
CPPFLAGS="$CPPFLAGS -I$here/install/include"
|
||||
LDFLAGS="$LDFLAGS -L$here/install/lib"
|
||||
export CPPFLAGS
|
||||
|
||||
+61
-12
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Script to automate the building of mono and its dependencies.
|
||||
# Relies on wget being installed (could make it fall back to using
|
||||
@@ -17,6 +17,44 @@ echo "Building Mono and dependencies in $here, installing to $here/install"
|
||||
PATH=$here/install/bin:$PATH
|
||||
LD_LIBRARY_PATH=$here/install/lib:$LD_LIBRARY_PATH
|
||||
|
||||
# Find a tool to fetch files. It must take an HTTP URL on the command line and
|
||||
# save the file in the current directory. (It must also talk HTTP/1.1, which
|
||||
# rules out BSD's ftp(1), at least on FreeBSD 4.4.)
|
||||
viable_downloaders="wget fetch"
|
||||
for i in $viable_downloaders
|
||||
do
|
||||
if which $i > /dev/null; then
|
||||
downloader=`which $i`
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$downloader" ]; then
|
||||
echo "Can't find a commandline download tool (tried: $viable_downloaders)"
|
||||
exit -1
|
||||
else
|
||||
echo "Using $downloader to fetch files"
|
||||
fi
|
||||
|
||||
# We need to prefer GNU make if there's a choice. BSD make falls over in
|
||||
# the glib build if gtk-doc is disabled.
|
||||
viable_makers="gmake make"
|
||||
for i in $viable_makers
|
||||
do
|
||||
if which $i > /dev/null; then
|
||||
MAKE=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$MAKE" ]; then
|
||||
echo "Can't find a make tool (tried: $viable_makers)"
|
||||
exit -1
|
||||
else
|
||||
echo "Using $MAKE"
|
||||
export MAKE
|
||||
fi
|
||||
|
||||
# Need to install pkgconfig and set ACLOCAL_FLAGS if there is not a
|
||||
# pkgconfig installed already. Otherwise set PKG_CONFIG_PATH to the
|
||||
# glib we're about to install in $here/install. This script could
|
||||
@@ -64,14 +102,14 @@ function install_package() {
|
||||
|
||||
echo "Installing $name..."
|
||||
if [ ! -f $here/$tarfile ]; then
|
||||
wget http://www.go-mono.org/archive/$tarfile
|
||||
(cd $here && $downloader http://www.go-mono.com/archive/$tarfile)
|
||||
fi
|
||||
|
||||
# Assume that the package built correctly if the dir is there
|
||||
if [ ! -d $here/$dirname ]; then
|
||||
# Build and install package
|
||||
tar xzf $here/$tarfile || exit -1
|
||||
(cd $here/$dirname; ./configure --prefix=$here/install $configure_options || exit -1; make || exit -1; make install || exit -1)
|
||||
(cd $here && tar xzf $tarfile) || exit -1
|
||||
(cd $here/$dirname; ./configure --prefix=$here/install $configure_options || exit -1; $MAKE || exit -1; $MAKE install || exit -1)
|
||||
success=$?
|
||||
if [ $success -ne 0 ]; then
|
||||
echo "***** $name build failure. Run rm -rf $here/$dirname to have this script attempt to build $name again next time"
|
||||
@@ -113,12 +151,23 @@ export LD_LIBRARY_PATH
|
||||
export ACLOCAL_FLAGS
|
||||
export PKG_CONFIG_PATH
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I$here/install/include"
|
||||
LDFLAGS="$LDFLAGS -L$here/install/lib"
|
||||
# Freebsd puts iconv in /usr/local, so see if we need to add
|
||||
# /usr/local/include and /usr/local/lib to CPPFLAGS and LDFLAGS. We could
|
||||
# skip this if it would add /usr/include and /usr/lib, but leaving it
|
||||
# shouldnt break anything.
|
||||
iconvh=`locate include/iconv.h`
|
||||
iconvh_dir=`dirname $iconvh`
|
||||
iconvlib_dir=`echo $iconvh_dir | sed -e 's/include/lib/'`
|
||||
|
||||
echo "Adding $iconvh_dir to CPPFLAGS"
|
||||
echo "Adding $iconvlib_dir to LDFLAGS"
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I$here/install/include -I$iconvh_dir"
|
||||
LDFLAGS="$LDFLAGS -L$here/install/lib -L$iconvlib_dir"
|
||||
export CPPFLAGS
|
||||
export LDFLAGS
|
||||
|
||||
# Grab pkg-config-0.8, glib-1.3.12 if necessary
|
||||
# Grab pkg-config, glib and libgc if necessary
|
||||
|
||||
if [ $install_pkgconfig = "yes" ]; then
|
||||
install_package pkgconfig-0.8.0.tar.gz pkgconfig-0.8.0 pkgconfig ""
|
||||
@@ -127,16 +176,16 @@ else
|
||||
fi
|
||||
|
||||
if [ $install_glib = "yes" ]; then
|
||||
install_package glib-1.3.13.tar.gz glib-1.3.13 glib ""
|
||||
install_package glib-2.0.6.tar.gz glib-2.0.6 glib ""
|
||||
else
|
||||
echo "Not installing glib, you already seem to have it installed"
|
||||
fi
|
||||
|
||||
if [ $install_libgc = "yes" ]; then
|
||||
LIBS="-ldl" install_package gc6.0.tar.gz gc6.0 libgc "--enable-threads=pthreads"
|
||||
install_package gc6.1alpha5.tar.gz gc6.1alpha5 libgc "--enable-threads=pthreads"
|
||||
# make install didnt do the headers!
|
||||
mkdir -p $here/install/include/gc
|
||||
cp -r $here/gc6.0/include/* $here/install/include/gc
|
||||
cp -r $here/gc6.1alpha5/include/* $here/install/include/gc
|
||||
else
|
||||
echo "Not installing libgc, you already seem to have it installed"
|
||||
fi
|
||||
@@ -166,12 +215,12 @@ elif [ ${CVSROOT:0:9} = ":pserver:" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
cvs checkout mono || exit -1
|
||||
(cd $here && cvs checkout mono) || exit -1
|
||||
|
||||
# Build and install mono
|
||||
echo "Building and installing mono"
|
||||
|
||||
(cd $here/mono; ./autogen.sh --prefix=$here/install || exit -1; make || exit -1; make install || exit -1) || exit -1
|
||||
(cd $here/mono; ./autogen.sh --prefix=$here/install || exit -1; $MAKE || exit -1; $MAKE install || exit -1) || exit -1
|
||||
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
System.Object
|
||||
System.Exception
|
||||
System.ValueType
|
||||
System.Delegate
|
||||
System.MulticastDelegate
|
||||
System.Enum
|
||||
System.Activator
|
||||
System.ArgIterator
|
||||
System.__ComObject
|
||||
System.TypedReference
|
||||
System.Security.AllowPartiallyTrustedCallersAttribute
|
||||
System.Runtime.Serialization.Formatter
|
||||
System.Runtime.Serialization.FormatterConverter
|
||||
System.Runtime.Serialization.FormatterServices
|
||||
System.Runtime.Serialization.ObjectIDGenerator
|
||||
System.Runtime.Serialization.ObjectManager
|
||||
System.Reflection.ModuleResolveEventHandler
|
||||
System.Reflection.Pointer
|
||||
System.Globalization.CompareInfo
|
||||
System.Globalization.HebrewCalendar
|
||||
System.Globalization.HijriCalendar
|
||||
System.Globalization.JapaneseCalendar
|
||||
System.Globalization.KoreanCalendar
|
||||
System.Globalization.SortKey
|
||||
System.Globalization.StringInfo
|
||||
System.Globalization.TaiwanCalendar
|
||||
System.Globalization.TextElementEnumerator
|
||||
System.Globalization.TextInfo
|
||||
System.Globalization.ThaiBuddhistCalendar
|
||||
System.IO.IsolatedStorage.IsolatedStorageFile
|
||||
System.Reflection.Emit.MethodRental
|
||||
System.Runtime.CompilerServices.AccessedThroughPropertyAttribute
|
||||
System.Runtime.CompilerServices.CallConvCdecl
|
||||
System.Runtime.CompilerServices.CallConvStdcall
|
||||
System.Runtime.CompilerServices.CallConvThiscall
|
||||
System.Runtime.CompilerServices.CallConvFastcall
|
||||
System.Runtime.CompilerServices.CustomConstantAttribute
|
||||
System.Runtime.CompilerServices.DateTimeConstantAttribute
|
||||
System.Runtime.CompilerServices.DiscardableAttribute
|
||||
System.Runtime.CompilerServices.DecimalConstantAttribute
|
||||
System.Runtime.CompilerServices.CompilationRelaxationsAttribute
|
||||
System.Runtime.CompilerServices.CompilerGlobalScopeAttribute
|
||||
System.Runtime.CompilerServices.IDispatchConstantAttribute
|
||||
System.Runtime.CompilerServices.IsVolatile
|
||||
System.Runtime.CompilerServices.IUnknownConstantAttribute
|
||||
System.Runtime.CompilerServices.RequiredAttributeAttribute
|
||||
System.Runtime.InteropServices.ArrayWithOffset
|
||||
System.Runtime.InteropServices.DispIdAttribute
|
||||
System.Runtime.InteropServices.ClassInterfaceType
|
||||
System.Runtime.InteropServices.ClassInterfaceAttribute
|
||||
System.Runtime.InteropServices.ComVisibleAttribute
|
||||
System.Runtime.InteropServices.LCIDConversionAttribute
|
||||
System.Runtime.InteropServices.ComRegisterFunctionAttribute
|
||||
System.Runtime.InteropServices.ComUnregisterFunctionAttribute
|
||||
System.Runtime.InteropServices.ProgIdAttribute
|
||||
System.Runtime.InteropServices.ImportedFromTypeLibAttribute
|
||||
System.Runtime.InteropServices.IDispatchImplType
|
||||
System.Runtime.InteropServices.IDispatchImplAttribute
|
||||
System.Runtime.InteropServices.ComSourceInterfacesAttribute
|
||||
System.Runtime.InteropServices.ComConversionLossAttribute
|
||||
System.Runtime.InteropServices.TypeLibTypeFlags
|
||||
System.Runtime.InteropServices.TypeLibFuncFlags
|
||||
System.Runtime.InteropServices.TypeLibVarFlags
|
||||
System.Runtime.InteropServices.TypeLibTypeAttribute
|
||||
System.Runtime.InteropServices.TypeLibFuncAttribute
|
||||
System.Runtime.InteropServices.TypeLibVarAttribute
|
||||
System.Runtime.InteropServices.ComImportAttribute
|
||||
System.Runtime.InteropServices.PreserveSigAttribute
|
||||
System.Runtime.InteropServices.ComAliasNameAttribute
|
||||
System.Runtime.InteropServices.AutomationProxyAttribute
|
||||
System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute
|
||||
System.Runtime.InteropServices.CoClassAttribute
|
||||
System.Runtime.InteropServices.ComEventInterfaceAttribute
|
||||
System.Runtime.InteropServices.COMException
|
||||
System.Runtime.InteropServices.ComMemberType
|
||||
System.Runtime.InteropServices.CurrencyWrapper
|
||||
System.Runtime.InteropServices.DispatchWrapper
|
||||
System.Runtime.InteropServices.ErrorWrapper
|
||||
System.Runtime.InteropServices.ExtensibleClassFactory
|
||||
System.Runtime.InteropServices.HandleRef
|
||||
System.Runtime.InteropServices.InvalidComObjectException
|
||||
System.Runtime.InteropServices.InvalidOleVariantTypeException
|
||||
System.Runtime.InteropServices.TypeLibImporterFlags
|
||||
System.Runtime.InteropServices.ExporterEventKind
|
||||
System.Runtime.InteropServices.ITypeLibExporterNotifySink
|
||||
System.Runtime.InteropServices.ITypeLibConverter
|
||||
System.Runtime.InteropServices.MarshalDirectiveException
|
||||
System.Runtime.InteropServices.ObjectCreationDelegate
|
||||
System.Runtime.InteropServices.RuntimeEnvironment
|
||||
System.Runtime.InteropServices.RegistrationServices
|
||||
System.Runtime.InteropServices.SafeArrayRankMismatchException
|
||||
System.Runtime.InteropServices.SafeArrayTypeMismatchException
|
||||
System.Runtime.InteropServices.SEHException
|
||||
System.Runtime.InteropServices.TypeLibConverter
|
||||
System.Runtime.InteropServices.BIND_OPTS
|
||||
System.Runtime.InteropServices.UCOMIBindCtx
|
||||
System.Runtime.InteropServices.UCOMIConnectionPointContainer
|
||||
System.Runtime.InteropServices.UCOMIConnectionPoint
|
||||
System.Runtime.InteropServices.UCOMIEnumMoniker
|
||||
System.Runtime.InteropServices.CONNECTDATA
|
||||
System.Runtime.InteropServices.UCOMIEnumConnections
|
||||
System.Runtime.InteropServices.UCOMIEnumConnectionPoints
|
||||
System.Runtime.InteropServices.UCOMIEnumString
|
||||
System.Runtime.InteropServices.UCOMIEnumVARIANT
|
||||
System.Runtime.InteropServices.FILETIME
|
||||
System.Runtime.InteropServices.UCOMIMoniker
|
||||
System.Runtime.InteropServices.UCOMIPersistFile
|
||||
System.Runtime.InteropServices.UCOMIRunningObjectTable
|
||||
System.Runtime.InteropServices.STATSTG
|
||||
System.Runtime.InteropServices.UCOMIStream
|
||||
System.Runtime.InteropServices.DESCKIND
|
||||
System.Runtime.InteropServices.BINDPTR
|
||||
System.Runtime.InteropServices.UCOMITypeComp
|
||||
System.Runtime.InteropServices.TYPEKIND
|
||||
System.Runtime.InteropServices.TYPEFLAGS
|
||||
System.Runtime.InteropServices.IMPLTYPEFLAGS
|
||||
System.Runtime.InteropServices.TYPEATTR
|
||||
System.Runtime.InteropServices.FUNCDESC
|
||||
System.Runtime.InteropServices.IDLFLAG
|
||||
System.Runtime.InteropServices.IDLDESC
|
||||
System.Runtime.InteropServices.PARAMFLAG
|
||||
System.Runtime.InteropServices.PARAMDESC
|
||||
System.Runtime.InteropServices.TYPEDESC
|
||||
System.Runtime.InteropServices.ELEMDESC
|
||||
System.Runtime.InteropServices.VARDESC
|
||||
System.Runtime.InteropServices.DISPPARAMS
|
||||
System.Runtime.InteropServices.EXCEPINFO
|
||||
System.Runtime.InteropServices.FUNCKIND
|
||||
System.Runtime.InteropServices.INVOKEKIND
|
||||
System.Runtime.InteropServices.CALLCONV
|
||||
System.Runtime.InteropServices.FUNCFLAGS
|
||||
System.Runtime.InteropServices.VARFLAGS
|
||||
System.Runtime.InteropServices.UCOMITypeInfo
|
||||
System.Runtime.InteropServices.SYSKIND
|
||||
System.Runtime.InteropServices.LIBFLAGS
|
||||
System.Runtime.InteropServices.TYPELIBATTR
|
||||
System.Runtime.InteropServices.UCOMITypeLib
|
||||
System.Runtime.InteropServices.UnknownWrapper
|
||||
System.Runtime.Remoting.IObjectHandle
|
||||
System.Runtime.Remoting.IRemotingTypeInfo
|
||||
System.Runtime.Remoting.IChannelInfo
|
||||
System.Runtime.Remoting.IEnvoyInfo
|
||||
System.Runtime.Remoting.RemotingConfiguration
|
||||
System.Runtime.Remoting.TypeEntry
|
||||
System.Runtime.Remoting.ActivatedClientTypeEntry
|
||||
System.Runtime.Remoting.ActivatedServiceTypeEntry
|
||||
System.Runtime.Remoting.WellKnownClientTypeEntry
|
||||
System.Runtime.Remoting.WellKnownServiceTypeEntry
|
||||
System.Runtime.Remoting.RemotingException
|
||||
System.Runtime.Remoting.ServerException
|
||||
System.Runtime.Remoting.RemotingTimeoutException
|
||||
System.Runtime.Remoting.RemotingServices
|
||||
System.Runtime.Remoting.InternalRemotingServices
|
||||
System.Runtime.Remoting.SoapServices
|
||||
System.Runtime.Remoting.Activation.UrlAttribute
|
||||
System.Runtime.Remoting.Messaging.IMessageSink
|
||||
System.Runtime.Remoting.Messaging.AsyncResult
|
||||
System.Runtime.Remoting.Messaging.CallContext
|
||||
System.Runtime.Remoting.Messaging.ILogicalThreadAffinative
|
||||
System.Runtime.Remoting.Messaging.InternalMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.IMethodCallMessage
|
||||
System.Runtime.Remoting.Messaging.MethodCallMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.HeaderHandler
|
||||
System.Runtime.Remoting.Messaging.IMessageCtrl
|
||||
System.Runtime.Remoting.Messaging.IRemotingFormatter
|
||||
System.Runtime.Remoting.Messaging.ReturnMessage
|
||||
System.Runtime.Remoting.Messaging.MethodCall
|
||||
System.Runtime.Remoting.Messaging.ConstructionCall
|
||||
System.Runtime.Remoting.Messaging.MethodResponse
|
||||
System.Runtime.Remoting.Messaging.ConstructionResponse
|
||||
System.Runtime.Remoting.Messaging.MethodReturnMessageWrapper
|
||||
System.Runtime.Remoting.Messaging.OneWayAttribute
|
||||
System.Runtime.Remoting.Messaging.MessageSurrogateFilter
|
||||
System.Runtime.Remoting.Messaging.RemotingSurrogateSelector
|
||||
System.Runtime.Remoting.Contexts.CrossContextDelegate
|
||||
System.Runtime.Remoting.Contexts.ContextProperty
|
||||
System.Runtime.Remoting.Contexts.IContextPropertyActivator
|
||||
System.Runtime.Remoting.Contexts.IContributeClientContextSink
|
||||
System.Runtime.Remoting.Contexts.IContributeDynamicSink
|
||||
System.Runtime.Remoting.Contexts.IContributeEnvoySink
|
||||
System.Runtime.Remoting.Contexts.IContributeObjectSink
|
||||
System.Runtime.Remoting.Contexts.IContributeServerContextSink
|
||||
System.Runtime.Serialization.Formatters.InternalRM
|
||||
System.Runtime.Serialization.Formatters.InternalST
|
||||
System.Runtime.Serialization.Formatters.SoapMessage
|
||||
System.Runtime.Serialization.Formatters.SoapFault
|
||||
System.Runtime.Serialization.Formatters.ServerFault
|
||||
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
System.Security.Cryptography.CryptoConfig
|
||||
System.Security.Cryptography.KeyedHashAlgorithm
|
||||
System.Security.Cryptography.HMACSHA1
|
||||
System.Security.Cryptography.MACTripleDES
|
||||
System.Security.Cryptography.MaskGenerationMethod
|
||||
System.Security.Cryptography.PasswordDeriveBytes
|
||||
System.Security.Cryptography.PKCS1MaskGenerationMethod
|
||||
System.Security.Cryptography.RC2
|
||||
System.Security.Cryptography.RC2CryptoServiceProvider
|
||||
System.Security.Cryptography.RSACryptoServiceProvider
|
||||
System.Security.Cryptography.RSAOAEPKeyExchangeDeformatter
|
||||
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
|
||||
System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter
|
||||
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter
|
||||
System.Security.Cryptography.RSAPKCS1SignatureDeformatter
|
||||
System.Security.Cryptography.RSAPKCS1SignatureFormatter
|
||||
System.Security.Cryptography.SHA1Managed
|
||||
System.Security.Cryptography.TripleDES
|
||||
System.Security.Cryptography.TripleDESCryptoServiceProvider
|
||||
System.Security.Permissions.EnvironmentPermission
|
||||
System.Security.Permissions.FileDialogPermission
|
||||
System.Security.Permissions.IsolatedStorageFilePermission
|
||||
System.Security.Permissions.PrincipalPermissionAttribute
|
||||
System.Security.Permissions.SecurityPermissionAttribute
|
||||
System.Security.Permissions.PublisherIdentityPermissionAttribute
|
||||
System.Security.Permissions.PublisherIdentityPermission
|
||||
System.Security.Permissions.ReflectionPermission
|
||||
System.Security.Permissions.RegistryPermission
|
||||
System.Security.Permissions.PrincipalPermission
|
||||
System.Security.Permissions.SiteIdentityPermission
|
||||
System.Security.Permissions.StrongNameIdentityPermission
|
||||
System.Security.Permissions.StrongNamePublicKeyBlob
|
||||
System.Security.Permissions.UIPermission
|
||||
System.Security.Permissions.UrlIdentityPermission
|
||||
System.Security.Permissions.ZoneIdentityPermission
|
||||
System.Security.Policy.ApplicationDirectory
|
||||
System.Security.Policy.ApplicationDirectoryMembershipCondition
|
||||
System.Security.Policy.FirstMatchCodeGroup
|
||||
System.Security.Policy.Hash
|
||||
System.Security.Policy.HashMembershipCondition
|
||||
System.Security.Policy.NetCodeGroup
|
||||
System.Security.Policy.PermissionRequestEvidence
|
||||
System.Security.Policy.Publisher
|
||||
System.Security.Policy.PublisherMembershipCondition
|
||||
System.Security.Policy.Site
|
||||
System.Security.Policy.SiteMembershipCondition
|
||||
System.Security.Policy.StrongName
|
||||
System.Security.Policy.StrongNameMembershipCondition
|
||||
System.Security.Policy.UnionCodeGroup
|
||||
System.Security.Policy.Url
|
||||
System.Security.Policy.UrlMembershipCondition
|
||||
System.Security.Policy.Zone
|
||||
System.Security.Policy.ZoneMembershipCondition
|
||||
System.Security.Principal.WindowsIdentity
|
||||
System.Security.Principal.WindowsImpersonationContext
|
||||
System.Security.Principal.WindowsPrincipal
|
||||
System.Threading.CompressedStack
|
||||
|
||||
+8
-5
@@ -7,11 +7,14 @@
|
||||
1,Class Status,class-status.html,class-status.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,corlib,class-status-corlib.html,class-status-corlib.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System,class-status-System.html,class-status-System.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System.Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System.Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System.Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System.Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,System.Web.Services,class-status-System.Web.Services.html,class-status-System.Web.Services.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Xml,class-status-System.Xml.html,class-status-System.Xml.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Data,class-status-System.Data.html,class-status-System.Data.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Drawing,class-status-System.Drawing.html,class-status-System.Drawing.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Web,class-status-System.Web.html,class-status-System.Web.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Web.Services,class-status-System.Web.Services.html,class-status-System.Web.Services.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Microsoft.VisualBasic,class-status-Microsoft.VisualBasic.html,class-status-Microsoft.VisualBasic.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,EnterpriseServices,class-status-System.EnterpriseServices.html,class-status-System.EnterpriseServices.src,cm/cormissing.css,cm/cormissing.js
|
||||
2,Formatters.Soap,class-status-System.Runtime.Serialization.Formatters.Soap.html,class-status-System.Runtime.Serialization.Formatters.Soap.src,cm/cormissing.css,cm/cormissing.js
|
||||
1,C# Compiler,c-sharp.html,c-sharp.src
|
||||
1,Status,status.html,status.src
|
||||
0,Download,download.html,download.src
|
||||
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
+54
-48
@@ -4,57 +4,63 @@ CSC=csc
|
||||
CORCOMPARE=../../../mcs/tools/corcompare
|
||||
|
||||
OBJECTS= \
|
||||
deploy/ado-net.html \
|
||||
deploy/anoncvs.html \
|
||||
deploy/asp-net.html \
|
||||
deploy/books.html \
|
||||
deploy/contributing.html \
|
||||
deploy/class-status.html \
|
||||
deploy/class-status-corlib.html \
|
||||
deploy/class-status-System.html \
|
||||
deploy/class-status-System.Xml.html \
|
||||
deploy/class-status-System.Drawing.html \
|
||||
deploy/class-status-System.Data.html \
|
||||
deploy/class-status-System.Web.html \
|
||||
deploy/class-status-System.Web.Services.html \
|
||||
deploy/class-library.html \
|
||||
deploy/classlib-doc.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/faq.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/hackers.html \
|
||||
deploy/index.html \
|
||||
deploy/ideas.html \
|
||||
deploy/java.html \
|
||||
deploy/jit-debug.html \
|
||||
deploy/jit-debug-sample.html \
|
||||
deploy/jit-debug-sample2.html \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/papers.html \
|
||||
deploy/passport.html \
|
||||
deploy/plans.html \
|
||||
deploy/porting.html \
|
||||
deploy/ppc.html \
|
||||
deploy/rationale.html \
|
||||
deploy/resources.html \
|
||||
deploy/roadmap.html \
|
||||
deploy/runtime.html \
|
||||
deploy/status.html \
|
||||
deploy/testing.html \
|
||||
deploy/tools.html \
|
||||
deploy/ado-net.html \
|
||||
deploy/anoncvs.html \
|
||||
deploy/asp-net.html \
|
||||
deploy/books.html \
|
||||
deploy/contributing.html \
|
||||
deploy/class-status.html \
|
||||
deploy/class-status-corlib.html \
|
||||
deploy/class-status-System.html \
|
||||
deploy/class-status-System.Xml.html \
|
||||
deploy/class-status-System.Drawing.html \
|
||||
deploy/class-status-System.Data.html \
|
||||
deploy/class-status-System.Web.html \
|
||||
deploy/class-status-System.Web.Services.html \
|
||||
deploy/class-status-Microsoft.VisualBasic.html \
|
||||
deploy/class-status-System.EnterpriseServices.html \
|
||||
deploy/class-status-System.Runtime.Serialization.Formatters.Soap.html \
|
||||
deploy/class-library.html \
|
||||
deploy/classlib-doc.html \
|
||||
deploy/contact.html \
|
||||
deploy/c-sharp.html \
|
||||
deploy/ccvs.html \
|
||||
deploy/documentation.html \
|
||||
deploy/download.html \
|
||||
deploy/faq.html \
|
||||
deploy/gcc-frontend.html \
|
||||
deploy/hackers.html \
|
||||
deploy/index.html \
|
||||
deploy/ideas.html \
|
||||
deploy/java.html \
|
||||
deploy/jit-debug.html \
|
||||
deploy/jit-debug-sample.html \
|
||||
deploy/jit-debug-sample2.html \
|
||||
deploy/languages.html \
|
||||
deploy/mailing-lists.html \
|
||||
deploy/mono-beginning.html \
|
||||
deploy/mono-contribution-howto.html \
|
||||
deploy/monodoc-xml.html \
|
||||
deploy/papers.html \
|
||||
deploy/passport.html \
|
||||
deploy/plans.html \
|
||||
deploy/porting.html \
|
||||
deploy/ppc.html \
|
||||
deploy/rationale.html \
|
||||
deploy/resources.html \
|
||||
deploy/roadmap.html \
|
||||
deploy/runtime.html \
|
||||
deploy/status.html \
|
||||
deploy/testing.html \
|
||||
deploy/tools.html \
|
||||
deploy/winforms.html
|
||||
#2,Configuration.Install,class-status-System.Configuration.Install.html,class-status-System.Configuration.Install.src,cm/cormissing.css,cm/cormissing.js
|
||||
#2,Runtime.Remoting,class-status-System.Runtime.Remoting.html,class-status-System.Runtime.Remoting.src,cm/cormissing.css,cm/cormissing.js
|
||||
|
||||
# deploy/class-status-System.html \
|
||||
# deploy/class-status-System.Configuration.Install.html \
|
||||
# deploy/class-status-System.Runtime.Remoting.html \
|
||||
|
||||
NON_HTML_SOURCES= \
|
||||
NON_HTML_SOURCES= \
|
||||
../mono-build.sh \
|
||||
../mono-build-w32.sh
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>#TITLE#</title>
|
||||
<!-- background-image: url("images/bgsquares.gif"); -->
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body { font-family: "trebuchet ms", lucida, verdana, helvetica;
|
||||
background-image: url("images/bgsquares.gif");
|
||||
|
||||
background-attachment: fixed; }
|
||||
body, td, table { font-family: "trebuchet ms", lucida, verdana, helvetica;
|
||||
font-size: 14px; }
|
||||
@@ -27,7 +28,7 @@
|
||||
a.navi2:visited { color: #cccccc; }
|
||||
a.navi2:hover { color: #ee9900; text-decoration: underline; }
|
||||
|
||||
// -->
|
||||
// -->
|
||||
</style>
|
||||
#CSS#
|
||||
#SCRIPT#
|
||||
@@ -38,7 +39,7 @@
|
||||
<tr>
|
||||
<td><img src="images/pixel.gif" alt=""></td><!-- left border -->
|
||||
<td colspan="4">
|
||||
<a href="http://www.go-mono.com"><img src="images/mono.gif"
|
||||
<a href="http://www.go-mono.com"><img src="images/mono-new.gif"
|
||||
alt="mono-logo" border="0"></a></td>
|
||||
<td><img src="images/pixel.gif" alt=""></td><!-- right border -->
|
||||
</tr>
|
||||
|
||||
+25
-17
@@ -1,9 +1,20 @@
|
||||
* System.Windows.Forms
|
||||
|
||||
System.Windows.Forms eventually will support multiple
|
||||
toolkits. Ximian will be delivering a product that will allow
|
||||
for System.Windows.Forms applications to integrate with GNOME
|
||||
through Gtk and MacOS X using Cocoa.
|
||||
System.Windows.Forms is currently being implemented using the
|
||||
Win32 API, we will be using <a
|
||||
href="http://www.winehq.com">WineLib</a> on Unix systems to
|
||||
emulate the Win32 API.
|
||||
|
||||
Although the original plans were to use Gtk on X and Cocoa on
|
||||
MacOS X, it would be very hard to emulate the event model in
|
||||
which some Winforms applications depend, and it would be very
|
||||
hard to implement the Wndproc method.
|
||||
|
||||
In terms of integrating visually with the desktop, we are
|
||||
hoping to contribute to the Wine project an mechanism to make
|
||||
it use the Gtk+ themes on X11 and Cocoa on MacOS to render the
|
||||
widgets, and get the native look and feel on each of these
|
||||
platforms.
|
||||
|
||||
There are no current plans to support embedded devices, but
|
||||
Gtk/FrameBuffer is an option. If you have suggestions or
|
||||
@@ -12,19 +23,15 @@
|
||||
|
||||
* Contributing
|
||||
|
||||
Currently Ximian developers are busy making our JIT engine
|
||||
feature complete, and dealing with the low-level details of
|
||||
the Mono runtime.
|
||||
|
||||
If you are interested in contributing, you can start stubbing
|
||||
out classes and providing enumerations. That will help us
|
||||
significantly when we start working on the actual bindings.
|
||||
|
||||
Christian Meyer is currently organizing this effort.
|
||||
The Winforms effort is being coordinated by <a
|
||||
href="mailto:[email protected]">Dennis Hayes</a>. If you are
|
||||
interested in helping out with this effort, get in touch with
|
||||
him.
|
||||
|
||||
* System.Drawing
|
||||
|
||||
Using existing libraries to implement some of the functionality required
|
||||
Using existing libraries to implement some of the
|
||||
functionality required:
|
||||
|
||||
<ul>
|
||||
* gdk-pixbuf is a generic image loader that loads an image
|
||||
@@ -75,12 +82,13 @@
|
||||
MacOS
|
||||
System.Drawing.Blah
|
||||
MacOS ports of "System.Drawing.Blah"
|
||||
Win32
|
||||
WineLIB
|
||||
System.Drawing.Blah
|
||||
Win32 ports of "System.Drawing.Blah"
|
||||
|
||||
Then we use nant targets to include/exclude the right set of
|
||||
files to create the assembly.
|
||||
Notice that there is a proof of concept Gtk-backend for
|
||||
Windows.Forms, but nobody is working on it, and for the
|
||||
reasons stated before it is not a long term strategy.
|
||||
|
||||
* Open questions:
|
||||
|
||||
|
||||
@@ -44,6 +44,14 @@ the math operations checked (the default is unchecked).
|
||||
Sets the default compilation mode to `unchecked'. This makes all
|
||||
the math operations unchecked (this is the default).
|
||||
.TP
|
||||
.I -codepage:ID
|
||||
Specifies the code page used to process the input files from the
|
||||
point it is specified on. By default files will be processed in the
|
||||
Latin-1 code page. The compiler will also automatically detect
|
||||
Unicode files that have an embedded byte mark at the beginning. The
|
||||
special ID "utf8" can be used to switch to utf8 and the ID "reset"
|
||||
restores the automatic handling of code pages.
|
||||
.TP
|
||||
.I \-define:SYMLIST, -d:SYMLIST
|
||||
Defines the symbol listed by the semi-colon separeted list SYMLIST
|
||||
SYMBOL. This can be tested in the source code by the pre-processor,
|
||||
@@ -56,6 +64,10 @@ Generate debugging information.
|
||||
.I \-debug-
|
||||
Do not generate debugging information.
|
||||
.TP
|
||||
.I \-\-expect-error X L
|
||||
The compiler will expect the code to generate an error
|
||||
named `X' in line `L'. This is only used by the test suite.
|
||||
.TP
|
||||
.I \-\-fatal
|
||||
This is used for debugging the compiler. This makes the error emission
|
||||
generate an exception that can be caught by a debugger.
|
||||
@@ -90,15 +102,14 @@ Names the output file to be generated.
|
||||
.I \-\-parse
|
||||
Used for benchmarking. The compiler will only parse its input files.
|
||||
.TP
|
||||
.I \-\-probe X L
|
||||
Probes for the code to generate an error named `X' in line `L'. This
|
||||
is only used by the test suite.
|
||||
.TP
|
||||
.I /resource:RESOURCE
|
||||
Embeds to the given resource file.
|
||||
.I /resource:RESOURCE[,ID]
|
||||
Embeds to the given resource file. The optional ID can be used to
|
||||
give a different name to the resource. If not specified, the resource
|
||||
name will be the file name.
|
||||
.TP
|
||||
.I /linkresource:RESOURCE
|
||||
Links to the given resource file.
|
||||
.I /linkresource:RESOURCE[,ID]
|
||||
Links to the specified RESOURCE. The optional ID can be used to give
|
||||
a name to the linked resource.
|
||||
.TP
|
||||
.I \-recurse:PATTERN, --recurse PATTERN
|
||||
Does recursive compilation using the specified pattern. In Unix the
|
||||
|
||||
+8
-9
@@ -96,12 +96,9 @@ Writes out stabs debug information.
|
||||
.I "dwarf"
|
||||
Writes out dwarf debug information.
|
||||
.TP
|
||||
.I "dwarf-plus"
|
||||
Uses an extended debugging information file which has been generated
|
||||
by MCS. This extended debugging information will allow you to debug
|
||||
C# source code rather than IL code. To use it, just run the JIT in
|
||||
your debugger and call "mono_debug_make_symbols" each time the program
|
||||
stops.
|
||||
.I "mono"
|
||||
Use a symbol file which has been created by MCS. It can be used to get
|
||||
source lines in stack traces.
|
||||
.PP
|
||||
The "stabs" and "dwarf" formats support the following options:
|
||||
.TP
|
||||
@@ -131,10 +128,12 @@ behaviour.
|
||||
Update the *.il files if their assemblies have changed, but only if the
|
||||
file already exists.
|
||||
.PP
|
||||
The "dwarf-plus" format supports the following options:
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.TP
|
||||
.I "dont_fallback"
|
||||
Don't fallback to normal dwarf2 if the symbol file cannot be found.
|
||||
.I "MONO_PATH"
|
||||
Provides a search path to mono and mint where to look for library files.
|
||||
Directories are separated by the platform path separator (colons on unix). Example:
|
||||
.B /home/username/lib:/usr/local/mono/lib
|
||||
.PP
|
||||
.SH FILES
|
||||
On Unix assemblies are loaded from the installation lib directory. If you set
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
2002-09-14 Piers Haken <[email protected]>
|
||||
|
||||
* */makefile.gnu:
|
||||
use $(topdir)
|
||||
build nunit into $(topdir)/class/lib
|
||||
|
||||
2002-08-27 Gonzalo Paniagua Javier <[email protected]>
|
||||
|
||||
* makefile.gnu:
|
||||
* class/library.make:
|
||||
* class/makefile.gnu:
|
||||
* class/I18N/makefile.gnu
|
||||
* class/corlib/makefile.gnu:
|
||||
* class/corlib/Test/ChangeLog:
|
||||
* class/corlib/Test/corlib_linux_test.args:
|
||||
* class/corlib/Test/makefile.gnu:
|
||||
* class/corlib/Test/run_test.sh:
|
||||
* jay/makefile.gnu:
|
||||
* mcs/makefile.gnu:
|
||||
* monoresgen/makefile.gnu:
|
||||
* nunit/makefile.gnu:
|
||||
|
||||
Allow running 'make -f makefile.gnu test' from top directory.
|
||||
In the libraries makefile.gnu you just have to add TEST_DIR=dirname
|
||||
with the name where tests reside.
|
||||
|
||||
2002-08-23 Martin Baulig <[email protected]>
|
||||
|
||||
* class/makefile.gnu: Add class/Mono.CSharp.Debugger to the build.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = ../../lib/I18N.CJK.dll
|
||||
LIBRARY = $(topdir)/class/lib/I18N.CJK.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = --unsafe --resource jis.table -r corlib -r mscorlib -r I18N
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = --unsafe --resource jis.table -r corlib -r mscorlib -r I18N
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=
|
||||
|
||||
export MONO_PATH_PREFIX = ../../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = ../../lib/I18N.dll
|
||||
LIBRARY = $(topdir)/class/lib/I18N.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib -r mscorlib
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib -r mscorlib
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=
|
||||
|
||||
export MONO_PATH_PREFIX = ../../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -93,4 +93,24 @@
|
||||
</csc>
|
||||
|
||||
</target>
|
||||
<target name="clean">
|
||||
<delete failonerror="false">
|
||||
<fileset basedir="../lib">
|
||||
<includes name="I18N.dll"/>
|
||||
<includes name="I18N.CJK.dll"/>
|
||||
<includes name="I18N.MidEast.dll"/>
|
||||
<includes name="I18N.Other.dll"/>
|
||||
<includes name="I18N.Rare.dll"/>
|
||||
<includes name="I18N.West.dll"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
<!-- Uncomment this if build file added for those.
|
||||
<nant basedir="Common" target="clean"/>
|
||||
<nant basedir="CJK" target="clean"/>
|
||||
<nant basedir="MidEast" target="clean"/>
|
||||
<nant basedir="Other" target="clean"/>
|
||||
<nant basedir="Rare" target="clean"/>
|
||||
<nant basedir="West" target="clean"/>
|
||||
-->
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = ../../lib/I18N.MidEast.dll
|
||||
LIBRARY = $(topdir)/class/lib/I18N.MidEast.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=
|
||||
|
||||
export MONO_PATH_PREFIX = ../../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = ../../lib/I18N.Other.dll
|
||||
LIBRARY = $(topdir)/class/lib/I18N.Other.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=
|
||||
|
||||
export MONO_PATH_PREFIX = ../../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = ../../lib/I18N.Rare.dll
|
||||
LIBRARY = $(topdir)/class/lib/I18N.Rare.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=
|
||||
|
||||
export MONO_PATH_PREFIX = ../../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = ../../lib/I18N.West.dll
|
||||
LIBRARY = $(topdir)/class/lib/I18N.West.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib -r mscorlib -r I18N
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=
|
||||
|
||||
export MONO_PATH_PREFIX = ../../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -5,7 +5,7 @@ DIRS = Common West MidEast CJK Other Rare
|
||||
|
||||
default: all
|
||||
|
||||
all clean:
|
||||
all clean test:
|
||||
@for i in $(DIRS) ; do \
|
||||
if [ -d "$$i" ] && [ -f "$$i/makefile.gnu" ] ; then \
|
||||
(cd $$i && $(MAKE) -f makefile.gnu $@) || exit 1; \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = ../lib/Microsoft.VisualBasic.dll
|
||||
LIBRARY = $(topdir)/class/lib/Microsoft.VisualBasic.dll
|
||||
|
||||
LIB_LIST = list
|
||||
LIB_FLAGS = -r corlib -r System
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib -r System
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=./Test*
|
||||
|
||||
export MONO_PATH_PREFIX = ../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../library.make
|
||||
include $(topdir)/class/library.make
|
||||
@@ -1,311 +0,0 @@
|
||||
//
|
||||
// Mono.CSharp.Debugger/AssemblerWriterI386.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// IAssemblerWriter implementation for the Intel i386.
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public class AssemblerWriterI386 : IAssemblerWriter
|
||||
{
|
||||
public AssemblerWriterI386 (StreamWriter writer) {
|
||||
this.writer = writer;
|
||||
writer.WriteLine ("#NOAPP");
|
||||
}
|
||||
|
||||
private StreamWriter writer;
|
||||
private static int next_anon_label_idx = 0;
|
||||
private bool in_section = false;
|
||||
|
||||
public void WriteLabel (string label)
|
||||
{
|
||||
writer.WriteLine (".L_" + label + ":");
|
||||
}
|
||||
|
||||
public int GetNextLabelIndex ()
|
||||
{
|
||||
return ++next_anon_label_idx;
|
||||
}
|
||||
|
||||
public int WriteLabel ()
|
||||
{
|
||||
int index = ++next_anon_label_idx;
|
||||
|
||||
WriteLabel (index);
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
public void WriteLabel (int index)
|
||||
{
|
||||
char[] output = { '.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
':', '\n' };
|
||||
|
||||
unchecked {
|
||||
int value = (int) index;
|
||||
output [3] = hex [(value & 0xf00000) >> 20];
|
||||
output [4] = hex [(value & 0x0f0000) >> 16];
|
||||
output [5] = hex [(value & 0x00f000) >> 12];
|
||||
output [6] = hex [(value & 0x000f00) >> 8];
|
||||
output [7] = hex [(value & 0x0000f0) >> 4];
|
||||
output [8] = hex [(value & 0x00000f)];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
private static readonly char[] hex = { '0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
|
||||
public void WriteUInt8 (bool value)
|
||||
{
|
||||
WriteUInt8 (value ? 1 : 0);
|
||||
}
|
||||
|
||||
public void WriteUInt8 (int value)
|
||||
{
|
||||
char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
|
||||
'0', 'x', '\0', '\0',
|
||||
'\n' };
|
||||
|
||||
unchecked {
|
||||
output [9] = hex [(value & 0xf0) >> 4];
|
||||
output [10] = hex [value & 0x0f];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void WriteInt8 (int value)
|
||||
{
|
||||
char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
|
||||
'0', 'x', '\0', '\0',
|
||||
'\n' };
|
||||
|
||||
unchecked {
|
||||
uint uvalue = (uint) value;
|
||||
output [9] = hex [(uvalue & 0xf0) >> 4];
|
||||
output [10] = hex [uvalue & 0x0f];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void Write2Bytes (int a, int b)
|
||||
{
|
||||
char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
|
||||
'0', 'x', '\0', '\0', ',', ' ',
|
||||
'0', 'x', '\0', '\0',
|
||||
'\n' };
|
||||
|
||||
unchecked {
|
||||
uint ua = (uint) a;
|
||||
uint ub = (uint) b;
|
||||
output [9] = hex [(ua & 0xf0) >> 4];
|
||||
output [10] = hex [ua & 0x0f];
|
||||
output [15] = hex [(ub & 0xf0) >> 4];
|
||||
output [16] = hex [ub & 0x0f];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void WriteUInt16 (int value)
|
||||
{
|
||||
writer.WriteLine ("\t.word " + value);
|
||||
}
|
||||
|
||||
public void WriteInt16 (int value)
|
||||
{
|
||||
writer.WriteLine ("\t.word " + value);
|
||||
}
|
||||
|
||||
public void WriteUInt32 (int value)
|
||||
{
|
||||
char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
|
||||
'0', 'x', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
'\0', '\0', '\n' };
|
||||
|
||||
unchecked {
|
||||
output [9] = hex [(value & 0xf0000000) >> 28];
|
||||
output [10] = hex [(value & 0x0f000000) >> 24];
|
||||
output [11] = hex [(value & 0x00f00000) >> 20];
|
||||
output [12] = hex [(value & 0x000f0000) >> 16];
|
||||
output [13] = hex [(value & 0x0000f000) >> 12];
|
||||
output [14] = hex [(value & 0x00000f00) >> 8];
|
||||
output [15] = hex [(value & 0x000000f0) >> 4];
|
||||
output [16] = hex [(value & 0x0000000f)];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void WriteInt32 (int value)
|
||||
{
|
||||
char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
|
||||
'0', 'x', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
'\0', '\0', '\n' };
|
||||
|
||||
unchecked {
|
||||
uint uvalue = (uint) value;
|
||||
output [9] = hex [(uvalue & 0xf0000000) >> 28];
|
||||
output [10] = hex [(uvalue & 0x0f000000) >> 24];
|
||||
output [11] = hex [(uvalue & 0x00f00000) >> 20];
|
||||
output [12] = hex [(uvalue & 0x000f0000) >> 16];
|
||||
output [13] = hex [(uvalue & 0x0000f000) >> 12];
|
||||
output [14] = hex [(uvalue & 0x00000f00) >> 8];
|
||||
output [15] = hex [(uvalue & 0x000000f0) >> 4];
|
||||
output [16] = hex [(uvalue & 0x0000000f)];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void WriteSLeb128 (int value)
|
||||
{
|
||||
writer.WriteLine ("\t.sleb128 " + value);
|
||||
}
|
||||
|
||||
public void WriteULeb128 (int value)
|
||||
{
|
||||
writer.WriteLine ("\t.uleb128 " + value);
|
||||
}
|
||||
|
||||
public void WriteAddress (int value)
|
||||
{
|
||||
if (value == 0)
|
||||
writer.WriteLine ("\t.long 0");
|
||||
else
|
||||
writer.WriteLine ("\t.long " + value);
|
||||
}
|
||||
|
||||
public void WriteString (string value)
|
||||
{
|
||||
writer.WriteLine ("\t.string \"" + value + "\"");
|
||||
}
|
||||
|
||||
public void WriteSectionStart (String section)
|
||||
{
|
||||
if (in_section)
|
||||
throw new Exception ();
|
||||
in_section = true;
|
||||
writer.WriteLine ("\t.section ." + section);
|
||||
}
|
||||
|
||||
public void WriteSectionEnd ()
|
||||
{
|
||||
in_section = false;
|
||||
}
|
||||
|
||||
public void WriteRelativeOffset (int start_label, int end_label)
|
||||
{
|
||||
char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
|
||||
'.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
' ', '-', ' ',
|
||||
'.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
'\n' };
|
||||
|
||||
unchecked {
|
||||
output [10] = hex [(end_label & 0xf00000) >> 20];
|
||||
output [11] = hex [(end_label & 0x0f0000) >> 16];
|
||||
output [12] = hex [(end_label & 0x00f000) >> 12];
|
||||
output [13] = hex [(end_label & 0x000f00) >> 8];
|
||||
output [14] = hex [(end_label & 0x0000f0) >> 4];
|
||||
output [15] = hex [(end_label & 0x00000f)];
|
||||
output [22] = hex [(start_label & 0xf00000) >> 20];
|
||||
output [23] = hex [(start_label & 0x0f0000) >> 16];
|
||||
output [24] = hex [(start_label & 0x00f000) >> 12];
|
||||
output [25] = hex [(start_label & 0x000f00) >> 8];
|
||||
output [26] = hex [(start_label & 0x0000f0) >> 4];
|
||||
output [27] = hex [(start_label & 0x00000f)];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void WriteShortRelativeOffset (int start_label, int end_label)
|
||||
{
|
||||
char[] output = { '\t', '.', 'b', 'y', 't', 'e', ' ',
|
||||
'.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
' ', '-', ' ',
|
||||
'.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
'\n' };
|
||||
|
||||
unchecked {
|
||||
output [10] = hex [(end_label & 0xf00000) >> 20];
|
||||
output [11] = hex [(end_label & 0x0f0000) >> 16];
|
||||
output [12] = hex [(end_label & 0x00f000) >> 12];
|
||||
output [13] = hex [(end_label & 0x000f00) >> 8];
|
||||
output [14] = hex [(end_label & 0x0000f0) >> 4];
|
||||
output [15] = hex [(end_label & 0x00000f)];
|
||||
output [22] = hex [(start_label & 0xf00000) >> 20];
|
||||
output [23] = hex [(start_label & 0x0f0000) >> 16];
|
||||
output [24] = hex [(start_label & 0x00f000) >> 12];
|
||||
output [25] = hex [(start_label & 0x000f00) >> 8];
|
||||
output [26] = hex [(start_label & 0x0000f0) >> 4];
|
||||
output [27] = hex [(start_label & 0x00000f)];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
}
|
||||
|
||||
public void WriteAbsoluteOffset (string label)
|
||||
{
|
||||
writer.WriteLine ("\t.long .L_" + label);
|
||||
}
|
||||
|
||||
public void WriteAbsoluteOffset (int index)
|
||||
{
|
||||
char[] output = { '\t', '.', 'l', 'o', 'n', 'g', ' ',
|
||||
'.', 'L', '_', '\0', '\0', '\0', '\0', '\0', '\0',
|
||||
'\n' };
|
||||
|
||||
unchecked {
|
||||
output [10] = hex [(index & 0xf00000) >> 20];
|
||||
output [11] = hex [(index & 0x0f0000) >> 16];
|
||||
output [12] = hex [(index & 0x00f000) >> 12];
|
||||
output [13] = hex [(index & 0x000f00) >> 8];
|
||||
output [14] = hex [(index & 0x0000f0) >> 4];
|
||||
output [15] = hex [(index & 0x00000f)];
|
||||
}
|
||||
|
||||
writer.Write (output, 0, output.Length);
|
||||
|
||||
}
|
||||
|
||||
public object StartSubsectionWithSize ()
|
||||
{
|
||||
int start_index = ++next_anon_label_idx;
|
||||
int end_index = ++next_anon_label_idx;
|
||||
|
||||
WriteRelativeOffset (start_index, end_index);
|
||||
WriteLabel (start_index);
|
||||
|
||||
return end_index;
|
||||
}
|
||||
|
||||
public object StartSubsectionWithShortSize ()
|
||||
{
|
||||
int start_index = ++next_anon_label_idx;
|
||||
int end_index = ++next_anon_label_idx;
|
||||
|
||||
WriteShortRelativeOffset (start_index, end_index);
|
||||
WriteLabel (start_index);
|
||||
|
||||
return end_index;
|
||||
}
|
||||
|
||||
public void EndSubsection (object end_index)
|
||||
{
|
||||
WriteLabel ((int) end_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,104 @@
|
||||
2002-09-21 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 26. Removed all the dynamic
|
||||
stuff, this library now just deals with the compiler generated symbol table.
|
||||
The dynamic stuff is private between the JIT and the debugger.
|
||||
|
||||
2002-09-21 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 25. Added information about
|
||||
local variables.
|
||||
|
||||
2002-09-20 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 24. Added a type index
|
||||
table. Write the type of a local variable or a parameter as an index
|
||||
into this table.
|
||||
|
||||
2002-09-20 Martin Baulig <[email protected]>
|
||||
|
||||
* IMonoSymbolWriter.cs: Remove all the unused interfaces.
|
||||
|
||||
2002-09-20 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 23, include the size
|
||||
of a variable.
|
||||
|
||||
2002-09-20 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 22. Provide information
|
||||
about parameters and local variables.
|
||||
|
||||
2002-09-20 Martin Baulig <[email protected]>
|
||||
|
||||
* IMonoSymbolWriter.cs: Use fullly qualified name for
|
||||
System.Diagnostics.SymbolStore.ISymbolWriter rather than `using' this
|
||||
namespace. This allows us to use the name `ISymbolWriter' in our own
|
||||
code.
|
||||
|
||||
2002-09-18 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 21. Encode the source file
|
||||
as a 4-byte length field followed by the UTF8 encoded string.
|
||||
|
||||
2002-09-18 Martin Baulig <[email protected]>
|
||||
|
||||
* IMonoBinaryReader.cs: New interface.
|
||||
|
||||
* MonoSymbolTable.cs: Use IMonoBinaryReader instead of binary reader.
|
||||
|
||||
2002-09-16 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Set version number to 20.
|
||||
|
||||
2002-09-14 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs, IMonoSymbolWriter.cs, MonoSymbolTableWriter.cs:
|
||||
Make all classes and interfaces which don't need to be public internal.
|
||||
|
||||
2002-09-14 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Use only CLS-compliant types here, bumped version
|
||||
number to 19.
|
||||
|
||||
* MonoSymbolTableReader.cs: Removed, this is now in the debugger.
|
||||
|
||||
2002-09-03 Martin Baulig <[email protected]>
|
||||
|
||||
* AssemblerWriterI386.cs, IAssemblerWriter.cs, MonoDwarfFileWriter.cs,
|
||||
README, README.relocation-table, csharp-lang.[ch], gdb-csharp-support.patch,
|
||||
gdb-variable-scopes.patch: Removed.
|
||||
|
||||
2002-09-03 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTableReader.cs (MonoSymbolTableReader.ImageFile): New
|
||||
public property.
|
||||
|
||||
* MonoSymbolTable.cs: Bumped version number to 18.
|
||||
|
||||
2002-08-27 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs (MethodAddress): Removed `TrampolineAddress'.
|
||||
|
||||
2002-08-27 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs: Changed the file format in a way that allows us
|
||||
open it read-only and to use a specially malloced area for all the
|
||||
dynamic data.
|
||||
|
||||
2002-08-25 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTableReader.cs: New file. This is the reader for the
|
||||
new symbol file format.
|
||||
|
||||
2002-08-24 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolTable.cs, MonoSymbolTableWriter.cs: New files. This
|
||||
creates a binary application.dbg file which will be used by the
|
||||
JIT to display source lines for exceptions.
|
||||
|
||||
* list.unix: Disabled the dwarf file writer in the build.
|
||||
|
||||
2002-08-23 Martin Baulig <[email protected]>
|
||||
|
||||
* MonoSymbolWriter.cs (MonoSymbolWriter.Initialize): Added
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
//
|
||||
// Mono.CSharp.Debugger/IAssemblerWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// This is a platform and assembler independent assembler output interface.
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IAssemblerWriter
|
||||
{
|
||||
int GetNextLabelIndex ();
|
||||
|
||||
void WriteLabel (int index);
|
||||
|
||||
void WriteLabel (string label);
|
||||
|
||||
int WriteLabel ();
|
||||
|
||||
void WriteUInt8 (bool value);
|
||||
|
||||
void WriteUInt8 (int value);
|
||||
|
||||
void WriteInt8 (int value);
|
||||
|
||||
void Write2Bytes (int a, int b);
|
||||
|
||||
void WriteUInt16 (int value);
|
||||
|
||||
void WriteInt16 (int value);
|
||||
|
||||
void WriteUInt32 (int value);
|
||||
|
||||
void WriteInt32 (int value);
|
||||
|
||||
void WriteSLeb128 (int value);
|
||||
|
||||
void WriteULeb128 (int value);
|
||||
|
||||
void WriteAddress (int value);
|
||||
|
||||
void WriteString (string value);
|
||||
|
||||
void WriteSectionStart (String section);
|
||||
|
||||
void WriteSectionEnd ();
|
||||
|
||||
void WriteRelativeOffset (int start_label, int end_label);
|
||||
|
||||
void WriteShortRelativeOffset (int start_label, int end_label);
|
||||
|
||||
void WriteAbsoluteOffset (int index);
|
||||
|
||||
void WriteAbsoluteOffset (string label);
|
||||
|
||||
object StartSubsectionWithSize ();
|
||||
|
||||
object StartSubsectionWithShortSize ();
|
||||
|
||||
void EndSubsection (object end_index);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/IMonoBinaryReader.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IMonoBinaryReader
|
||||
{
|
||||
long Position {
|
||||
get; set;
|
||||
}
|
||||
|
||||
int ReadInt32 ();
|
||||
|
||||
long ReadInt64 ();
|
||||
|
||||
byte[] ReadBuffer (int size);
|
||||
}
|
||||
}
|
||||
@@ -12,122 +12,17 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Diagnostics.SymbolStore;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public interface IMonoSymbolWriter : ISymbolWriter
|
||||
public interface IMonoSymbolWriter : System.Diagnostics.SymbolStore.ISymbolWriter
|
||||
{
|
||||
ISourceMethod[] Methods {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceFile[] Sources {
|
||||
get;
|
||||
}
|
||||
|
||||
void Initialize (string assembly_filename, string filename, string[] args);
|
||||
}
|
||||
|
||||
public interface ISourceFile
|
||||
{
|
||||
string FileName {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceMethod[] Methods {
|
||||
get;
|
||||
}
|
||||
|
||||
void AddMethod (ISourceMethod method);
|
||||
}
|
||||
|
||||
public interface ISourceMethod
|
||||
{
|
||||
ISourceLine[] Lines {
|
||||
get;
|
||||
}
|
||||
|
||||
void AddLine (ISourceLine line);
|
||||
|
||||
ISourceBlock[] Blocks {
|
||||
get;
|
||||
}
|
||||
|
||||
ILocalVariable[] Locals {
|
||||
get;
|
||||
}
|
||||
|
||||
void AddLocal (ILocalVariable local);
|
||||
|
||||
|
||||
ISourceLine Start {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceLine End {
|
||||
get;
|
||||
}
|
||||
|
||||
string FullName {
|
||||
get;
|
||||
}
|
||||
|
||||
int Token {
|
||||
get;
|
||||
}
|
||||
|
||||
Type ReturnType {
|
||||
get;
|
||||
}
|
||||
|
||||
ParameterInfo[] Parameters {
|
||||
get;
|
||||
}
|
||||
|
||||
MethodBase MethodBase {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceFile SourceFile {
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public interface ISourceBlock
|
||||
{
|
||||
ISourceMethod SourceMethod {
|
||||
get;
|
||||
}
|
||||
|
||||
ILocalVariable[] Locals {
|
||||
get;
|
||||
}
|
||||
|
||||
void AddLocal (ILocalVariable local);
|
||||
|
||||
ISourceBlock[] Blocks {
|
||||
get;
|
||||
}
|
||||
|
||||
void AddBlock (ISourceBlock block);
|
||||
|
||||
ISourceLine Start {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceLine End {
|
||||
get;
|
||||
}
|
||||
|
||||
int ID {
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public enum SourceOffsetType
|
||||
internal enum SourceOffsetType
|
||||
{
|
||||
OFFSET_NONE,
|
||||
OFFSET_IL,
|
||||
@@ -135,26 +30,7 @@ namespace Mono.CSharp.Debugger
|
||||
OFFSET_PARAMETER
|
||||
}
|
||||
|
||||
public interface ISourceLine
|
||||
{
|
||||
SourceOffsetType OffsetType {
|
||||
get;
|
||||
}
|
||||
|
||||
int Offset {
|
||||
get;
|
||||
}
|
||||
|
||||
int Row {
|
||||
get;
|
||||
}
|
||||
|
||||
int Column {
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public interface ITypeHandle
|
||||
internal interface ITypeHandle
|
||||
{
|
||||
string Name {
|
||||
get;
|
||||
@@ -168,33 +44,4 @@ namespace Mono.CSharp.Debugger
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IVariable
|
||||
{
|
||||
string Name {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceLine Line {
|
||||
get;
|
||||
}
|
||||
|
||||
ITypeHandle TypeHandle {
|
||||
get;
|
||||
}
|
||||
|
||||
ISourceMethod Method {
|
||||
get;
|
||||
}
|
||||
|
||||
int Index {
|
||||
get;
|
||||
}
|
||||
}
|
||||
|
||||
public interface ILocalVariable : IVariable
|
||||
{ }
|
||||
|
||||
public interface IMethodParameter : IVariable
|
||||
{ }
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,280 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolTable.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public struct OffsetTable
|
||||
{
|
||||
public const int Version = 26;
|
||||
public const long Magic = 0x45e82623fd7fa614;
|
||||
|
||||
public int total_file_size;
|
||||
public int source_table_offset;
|
||||
public int source_table_size;
|
||||
public int method_count;
|
||||
public int method_table_offset;
|
||||
public int method_table_size;
|
||||
public int line_number_table_offset;
|
||||
public int line_number_table_size;
|
||||
public int local_variable_table_offset;
|
||||
public int local_variable_table_size;
|
||||
public int type_count;
|
||||
public int type_index_table_offset;
|
||||
public int type_index_table_size;
|
||||
|
||||
public OffsetTable (IMonoBinaryReader reader)
|
||||
{
|
||||
total_file_size = reader.ReadInt32 ();
|
||||
source_table_offset = reader.ReadInt32 ();
|
||||
source_table_size = reader.ReadInt32 ();
|
||||
method_count = reader.ReadInt32 ();
|
||||
method_table_offset = reader.ReadInt32 ();
|
||||
method_table_size = reader.ReadInt32 ();
|
||||
line_number_table_offset = reader.ReadInt32 ();
|
||||
line_number_table_size = reader.ReadInt32 ();
|
||||
local_variable_table_offset = reader.ReadInt32 ();
|
||||
local_variable_table_size = reader.ReadInt32 ();
|
||||
type_count = reader.ReadInt32 ();
|
||||
type_index_table_offset = reader.ReadInt32 ();
|
||||
type_index_table_size = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
public void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (total_file_size);
|
||||
bw.Write (source_table_offset);
|
||||
bw.Write (source_table_size);
|
||||
bw.Write (method_count);
|
||||
bw.Write (method_table_offset);
|
||||
bw.Write (method_table_size);
|
||||
bw.Write (line_number_table_offset);
|
||||
bw.Write (line_number_table_size);
|
||||
bw.Write (local_variable_table_offset);
|
||||
bw.Write (local_variable_table_size);
|
||||
bw.Write (type_count);
|
||||
bw.Write (type_index_table_offset);
|
||||
bw.Write (type_index_table_size);
|
||||
}
|
||||
}
|
||||
|
||||
public struct LineNumberEntry
|
||||
{
|
||||
public readonly int Row;
|
||||
public readonly int Offset;
|
||||
|
||||
public LineNumberEntry (int row, int offset)
|
||||
{
|
||||
this.Row = row;
|
||||
this.Offset = offset;
|
||||
}
|
||||
|
||||
internal LineNumberEntry (SourceLine line)
|
||||
: this (line.Row, line.Offset)
|
||||
{ }
|
||||
|
||||
public LineNumberEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
Row = reader.ReadInt32 ();
|
||||
Offset = reader.ReadInt32 ();
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (Row);
|
||||
bw.Write (Offset);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Line {0}:{1}]", Row, Offset);
|
||||
}
|
||||
}
|
||||
|
||||
public struct LocalVariableEntry
|
||||
{
|
||||
public readonly string Name;
|
||||
public readonly FieldAttributes Attributes;
|
||||
public readonly byte[] Signature;
|
||||
|
||||
public LocalVariableEntry (string Name, FieldAttributes Attributes, byte[] Signature)
|
||||
{
|
||||
this.Name = Name;
|
||||
this.Attributes = Attributes;
|
||||
this.Signature = Signature;
|
||||
}
|
||||
|
||||
public LocalVariableEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
int name_length = reader.ReadInt32 ();
|
||||
byte[] name = reader.ReadBuffer (name_length);
|
||||
Name = Encoding.UTF8.GetString (name);
|
||||
Attributes = (FieldAttributes) reader.ReadInt32 ();
|
||||
int sig_length = reader.ReadInt32 ();
|
||||
Signature = reader.ReadBuffer (sig_length);
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
byte[] name = Encoding.UTF8.GetBytes (Name);
|
||||
bw.Write ((int) name.Length);
|
||||
bw.Write (name);
|
||||
bw.Write ((int) Attributes);
|
||||
bw.Write ((int) Signature.Length);
|
||||
bw.Write (Signature);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[LocalVariable {0}:{1}]", Name, Attributes);
|
||||
}
|
||||
}
|
||||
|
||||
public class MethodEntry
|
||||
{
|
||||
public readonly int Token;
|
||||
public readonly int StartRow;
|
||||
public readonly int EndRow;
|
||||
public readonly int NumLineNumbers;
|
||||
public readonly int ThisTypeIndex;
|
||||
public readonly int NumParameters;
|
||||
public readonly int NumLocals;
|
||||
|
||||
public int TypeIndexTableOffset;
|
||||
public int LocalVariableTableOffset;
|
||||
public readonly int SourceFileOffset;
|
||||
public readonly int LineNumberTableOffset;
|
||||
|
||||
public readonly string SourceFile = null;
|
||||
public readonly LineNumberEntry[] LineNumbers = null;
|
||||
public readonly int[] ParamTypeIndices = null;
|
||||
public readonly int[] LocalTypeIndices = null;
|
||||
public readonly LocalVariableEntry[] Locals = null;
|
||||
|
||||
public static int Size
|
||||
{
|
||||
get {
|
||||
return 44;
|
||||
}
|
||||
}
|
||||
|
||||
public MethodEntry (IMonoBinaryReader reader)
|
||||
{
|
||||
Token = reader.ReadInt32 ();
|
||||
StartRow = reader.ReadInt32 ();
|
||||
EndRow = reader.ReadInt32 ();
|
||||
ThisTypeIndex = reader.ReadInt32 ();
|
||||
NumParameters = reader.ReadInt32 ();
|
||||
NumLocals = reader.ReadInt32 ();
|
||||
NumLineNumbers = reader.ReadInt32 ();
|
||||
TypeIndexTableOffset = reader.ReadInt32 ();
|
||||
LocalVariableTableOffset = reader.ReadInt32 ();
|
||||
SourceFileOffset = reader.ReadInt32 ();
|
||||
LineNumberTableOffset = reader.ReadInt32 ();
|
||||
|
||||
if (SourceFileOffset != 0) {
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = SourceFileOffset;
|
||||
int source_file_length = reader.ReadInt32 ();
|
||||
byte[] source_file = reader.ReadBuffer (source_file_length);
|
||||
SourceFile = Encoding.UTF8.GetString (source_file);
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (LineNumberTableOffset != 0) {
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = LineNumberTableOffset;
|
||||
|
||||
LineNumbers = new LineNumberEntry [NumLineNumbers];
|
||||
|
||||
for (int i = 0; i < NumLineNumbers; i++)
|
||||
LineNumbers [i] = new LineNumberEntry (reader);
|
||||
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (LocalVariableTableOffset != 0) {
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = LocalVariableTableOffset;
|
||||
|
||||
Locals = new LocalVariableEntry [NumLocals];
|
||||
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
Locals [i] = new LocalVariableEntry (reader);
|
||||
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
|
||||
if (TypeIndexTableOffset != 0) {
|
||||
long old_pos = reader.Position;
|
||||
reader.Position = TypeIndexTableOffset;
|
||||
|
||||
ParamTypeIndices = new int [NumParameters];
|
||||
LocalTypeIndices = new int [NumLocals];
|
||||
|
||||
for (int i = 0; i < NumParameters; i++)
|
||||
ParamTypeIndices [i] = reader.ReadInt32 ();
|
||||
for (int i = 0; i < NumLocals; i++)
|
||||
LocalTypeIndices [i] = reader.ReadInt32 ();
|
||||
|
||||
reader.Position = old_pos;
|
||||
}
|
||||
}
|
||||
|
||||
internal MethodEntry (int token, int sf_offset, string source_file,
|
||||
int this_type_index, int[] param_type_indices,
|
||||
int[] local_type_indices, LocalVariableEntry[] locals,
|
||||
LineNumberEntry[] lines, int lnt_offset,
|
||||
int start_row, int end_row)
|
||||
{
|
||||
this.Token = token;
|
||||
this.StartRow = start_row;
|
||||
this.EndRow = end_row;
|
||||
this.NumLineNumbers = lines.Length;
|
||||
this.ThisTypeIndex = this_type_index;
|
||||
this.NumParameters = param_type_indices.Length;
|
||||
this.NumLocals = local_type_indices.Length;
|
||||
this.ParamTypeIndices = param_type_indices;
|
||||
this.LocalTypeIndices = local_type_indices;
|
||||
this.Locals = locals;
|
||||
this.SourceFileOffset = sf_offset;
|
||||
this.LineNumberTableOffset = lnt_offset;
|
||||
this.SourceFile = source_file;
|
||||
this.LineNumbers = lines;
|
||||
}
|
||||
|
||||
internal void Write (BinaryWriter bw)
|
||||
{
|
||||
bw.Write (Token);
|
||||
bw.Write (StartRow);
|
||||
bw.Write (EndRow);
|
||||
bw.Write (ThisTypeIndex);
|
||||
bw.Write (NumParameters);
|
||||
bw.Write (NumLocals);
|
||||
bw.Write (NumLineNumbers);
|
||||
bw.Write (TypeIndexTableOffset);
|
||||
bw.Write (LocalVariableTableOffset);
|
||||
bw.Write (SourceFileOffset);
|
||||
bw.Write (LineNumberTableOffset);
|
||||
}
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format ("[Method {0}:{1}:{2}:{3}:{4} - {5}:{6}]",
|
||||
Token, SourceFile, StartRow, EndRow,
|
||||
NumLineNumbers, SourceFileOffset, LineNumberTableOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
//
|
||||
// System.Diagnostics.SymbolStore/MonoSymbolTableWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig ([email protected])
|
||||
//
|
||||
// (C) 2002 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
internal class MonoSymbolTableWriter : IDisposable
|
||||
{
|
||||
BinaryWriter bw;
|
||||
Hashtable type_hash;
|
||||
int last_type_index;
|
||||
|
||||
public MonoSymbolTableWriter (string output_filename)
|
||||
{
|
||||
FileStream stream = new FileStream (output_filename, FileMode.Create);
|
||||
bw = new BinaryWriter (stream);
|
||||
type_hash = new Hashtable ();
|
||||
}
|
||||
|
||||
int GetTypeIndex (Type type)
|
||||
{
|
||||
if (type_hash.Contains (type))
|
||||
return (int) type_hash [type];
|
||||
|
||||
int index = ++last_type_index;
|
||||
type_hash.Add (type, index);
|
||||
return index;
|
||||
}
|
||||
|
||||
public void WriteSymbolTable (MonoSymbolWriter symwriter)
|
||||
{
|
||||
// Magic number and file version.
|
||||
bw.Write (OffsetTable.Magic);
|
||||
bw.Write (OffsetTable.Version);
|
||||
|
||||
OffsetTable ot = new OffsetTable ();
|
||||
|
||||
//
|
||||
// Offsets of file sections; we must write this after we're done
|
||||
// writing the whole file, so we just reserve the space for it here.
|
||||
//
|
||||
long offset_table_offset = bw.BaseStream.Position;
|
||||
ot.Write (bw);
|
||||
|
||||
//
|
||||
// Write source file table.
|
||||
//
|
||||
Hashtable sources = new Hashtable ();
|
||||
|
||||
ot.source_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceFile source in symwriter.Sources) {
|
||||
if (sources.ContainsKey (source))
|
||||
continue;
|
||||
|
||||
sources.Add (source, (int) bw.BaseStream.Position);
|
||||
byte[] file_name = Encoding.UTF8.GetBytes (source.FileName);
|
||||
bw.Write ((int) file_name.Length);
|
||||
bw.Write (file_name);
|
||||
}
|
||||
ot.source_table_size = (int) bw.BaseStream.Position - ot.source_table_offset;
|
||||
|
||||
//
|
||||
// Write line number table
|
||||
//
|
||||
ArrayList methods = new ArrayList ();
|
||||
|
||||
int num_methods = 0;
|
||||
|
||||
ot.line_number_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (SourceMethod method in symwriter.Methods) {
|
||||
if (method.Start == null || method.Start.Row == 0)
|
||||
continue;
|
||||
|
||||
int count = method.Lines.Length;
|
||||
LineNumberEntry[] lines = new LineNumberEntry [count];
|
||||
|
||||
int pos = (int) bw.BaseStream.Position;
|
||||
|
||||
int num_params = method.Parameters.Length;
|
||||
int[] param_type_indices = new int [num_params];
|
||||
for (int i = 0; i < num_params; i++) {
|
||||
Type type = method.Parameters [i].ParameterType;
|
||||
param_type_indices [i] = GetTypeIndex (type);
|
||||
}
|
||||
|
||||
int num_locals = method.Locals.Length;
|
||||
int[] local_type_indices = new int [num_locals];
|
||||
for (int i = 0; i < num_locals; i++)
|
||||
local_type_indices [i] = ++last_type_index;
|
||||
|
||||
int type_index_table_offset = ot.type_index_table_size;
|
||||
ot.type_index_table_size += 4 * (num_params + num_locals);
|
||||
|
||||
int this_type_index = 0;
|
||||
if (!method.MethodBase.IsStatic)
|
||||
this_type_index = GetTypeIndex (method.MethodBase.ReflectedType);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
lines [i] = new LineNumberEntry (method.Lines [i]);
|
||||
lines [i].Write (bw);
|
||||
}
|
||||
|
||||
MethodEntry entry = new MethodEntry (
|
||||
(int) method.Token, (int) sources [method.SourceFile],
|
||||
method.SourceFile.FileName, this_type_index,
|
||||
param_type_indices, local_type_indices, method.Locals, lines, pos,
|
||||
(int) method.Start.Row, (int) method.End.Row);
|
||||
|
||||
methods.Add (entry);
|
||||
}
|
||||
ot.line_number_table_size = (int) bw.BaseStream.Position -
|
||||
ot.line_number_table_offset;
|
||||
|
||||
//
|
||||
// Write type index table.
|
||||
//
|
||||
|
||||
ot.type_index_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
|
||||
entry.TypeIndexTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int j = 0; j < entry.NumParameters; j++)
|
||||
bw.Write (entry.ParamTypeIndices [j]);
|
||||
for (int j = 0; j < entry.NumLocals; j++)
|
||||
bw.Write (entry.LocalTypeIndices [j]);
|
||||
}
|
||||
ot.type_index_table_size = (int) bw.BaseStream.Position -
|
||||
ot.type_index_table_offset;
|
||||
|
||||
//
|
||||
// Write local variable table.
|
||||
//
|
||||
|
||||
ot.local_variable_table_offset = (int) bw.BaseStream.Position;
|
||||
for (int i = 0; i < methods.Count; i++) {
|
||||
MethodEntry entry = (MethodEntry) methods [i];
|
||||
|
||||
entry.LocalVariableTableOffset = (int) bw.BaseStream.Position;
|
||||
|
||||
for (int j = 0; j < entry.NumLocals; j++)
|
||||
entry.Locals [j].Write (bw);
|
||||
}
|
||||
ot.local_variable_table_size = (int) bw.BaseStream.Position -
|
||||
ot.local_variable_table_offset;
|
||||
|
||||
//
|
||||
// Write method table
|
||||
//
|
||||
ot.method_count = methods.Count;
|
||||
ot.method_table_offset = (int) bw.BaseStream.Position;
|
||||
foreach (MethodEntry entry in methods)
|
||||
entry.Write (bw);
|
||||
ot.method_table_size = (int) bw.BaseStream.Position - ot.method_table_offset;
|
||||
|
||||
ot.type_count = last_type_index;
|
||||
|
||||
//
|
||||
// Write offset table
|
||||
//
|
||||
ot.total_file_size = (int) bw.BaseStream.Position;
|
||||
bw.Seek ((int) offset_table_offset, SeekOrigin.Begin);
|
||||
ot.Write (bw);
|
||||
bw.Seek (0, SeekOrigin.End);
|
||||
}
|
||||
|
||||
void IDisposable.Dispose() {
|
||||
Dispose (true);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
bw.Close ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ using System.IO;
|
||||
|
||||
namespace Mono.CSharp.Debugger
|
||||
{
|
||||
public class SourceFile : ISourceFile
|
||||
internal class SourceFile
|
||||
{
|
||||
private ArrayList _methods = new ArrayList ();
|
||||
private string _file_name;
|
||||
@@ -35,34 +35,32 @@ namespace Mono.CSharp.Debugger
|
||||
return _file_name;
|
||||
}
|
||||
|
||||
// interface ISourceFile
|
||||
|
||||
public string FileName {
|
||||
get {
|
||||
return _file_name;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceMethod[] Methods {
|
||||
public SourceMethod[] Methods {
|
||||
get {
|
||||
ISourceMethod[] retval = new ISourceMethod [_methods.Count];
|
||||
SourceMethod[] retval = new SourceMethod [_methods.Count];
|
||||
_methods.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddMethod (ISourceMethod method)
|
||||
public void AddMethod (SourceMethod method)
|
||||
{
|
||||
_methods.Add (method);
|
||||
}
|
||||
}
|
||||
|
||||
public class SourceBlock : ISourceBlock
|
||||
internal class SourceBlock
|
||||
{
|
||||
static private int next_index;
|
||||
private readonly int _index;
|
||||
|
||||
public SourceBlock (ISourceMethod method, ISourceLine start, ISourceLine end)
|
||||
public SourceBlock (SourceMethod method, SourceLine start, SourceLine end)
|
||||
{
|
||||
this._method = method;
|
||||
this._start = start;
|
||||
@@ -70,7 +68,7 @@ namespace Mono.CSharp.Debugger
|
||||
this._index = ++next_index;
|
||||
}
|
||||
|
||||
internal SourceBlock (ISourceMethod method, int startOffset)
|
||||
internal SourceBlock (SourceMethod method, int startOffset)
|
||||
{
|
||||
this._method = method;
|
||||
this._start = new SourceLine (startOffset);
|
||||
@@ -82,39 +80,39 @@ namespace Mono.CSharp.Debugger
|
||||
return "SourceBlock #" + ID + " (" + Start + " - " + End + ")";
|
||||
}
|
||||
|
||||
private readonly ISourceMethod _method;
|
||||
private readonly SourceMethod _method;
|
||||
private ArrayList _blocks = new ArrayList ();
|
||||
internal ISourceLine _start;
|
||||
internal ISourceLine _end;
|
||||
internal SourceLine _start;
|
||||
internal SourceLine _end;
|
||||
|
||||
private ArrayList _locals = new ArrayList ();
|
||||
|
||||
public ISourceMethod SourceMethod {
|
||||
public SourceMethod SourceMethod {
|
||||
get {
|
||||
return _method;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceBlock[] Blocks {
|
||||
public SourceBlock[] Blocks {
|
||||
get {
|
||||
ISourceBlock[] retval = new ISourceBlock [_blocks.Count];
|
||||
SourceBlock[] retval = new SourceBlock [_blocks.Count];
|
||||
_blocks.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBlock (ISourceBlock block)
|
||||
public void AddBlock (SourceBlock block)
|
||||
{
|
||||
_blocks.Add (block);
|
||||
}
|
||||
|
||||
public ISourceLine Start {
|
||||
public SourceLine Start {
|
||||
get {
|
||||
return _start;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceLine End {
|
||||
public SourceLine End {
|
||||
get {
|
||||
return _end;
|
||||
}
|
||||
@@ -126,21 +124,21 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public ILocalVariable[] Locals {
|
||||
public LocalVariableEntry[] Locals {
|
||||
get {
|
||||
ILocalVariable[] retval = new ILocalVariable [_locals.Count];
|
||||
LocalVariableEntry[] retval = new LocalVariableEntry [_locals.Count];
|
||||
_locals.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddLocal (ILocalVariable local)
|
||||
public void AddLocal (LocalVariableEntry local)
|
||||
{
|
||||
_locals.Add (local);
|
||||
}
|
||||
}
|
||||
|
||||
public class SourceLine : ISourceLine
|
||||
internal class SourceLine
|
||||
{
|
||||
public SourceLine (int row, int column)
|
||||
: this (0, row, column)
|
||||
@@ -170,7 +168,7 @@ namespace Mono.CSharp.Debugger
|
||||
internal int _row;
|
||||
internal int _column;
|
||||
|
||||
// interface ISourceLine
|
||||
// interface SourceLine
|
||||
|
||||
public SourceOffsetType OffsetType {
|
||||
get {
|
||||
@@ -197,96 +195,7 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public class Variable : IVariable
|
||||
{
|
||||
public Variable (string name, ITypeHandle handle, ISourceMethod method, int index)
|
||||
: this (name, handle, method, index, null)
|
||||
{ }
|
||||
|
||||
public Variable (string name, ITypeHandle handle, ISourceMethod method,
|
||||
int index, ISourceLine line)
|
||||
{
|
||||
this._name = name;
|
||||
this._handle = handle;
|
||||
this._method = method;
|
||||
this._line = line;
|
||||
this._index = index;
|
||||
}
|
||||
|
||||
private readonly string _name;
|
||||
private readonly ITypeHandle _handle;
|
||||
private readonly ISourceMethod _method;
|
||||
private readonly ISourceLine _line;
|
||||
private readonly int _index;
|
||||
|
||||
// interface IVariable
|
||||
|
||||
public string Name {
|
||||
get {
|
||||
return _name;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceMethod Method {
|
||||
get {
|
||||
return _method;
|
||||
}
|
||||
}
|
||||
|
||||
public int Index {
|
||||
get {
|
||||
return _index;
|
||||
}
|
||||
}
|
||||
|
||||
public ITypeHandle TypeHandle {
|
||||
get {
|
||||
return _handle;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceLine Line {
|
||||
get {
|
||||
return _line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class LocalVariable : Variable, ILocalVariable
|
||||
{
|
||||
public LocalVariable (string name, ITypeHandle handle, ISourceMethod method,
|
||||
int index, ISourceLine line)
|
||||
: base (name, handle, method, index, line)
|
||||
{ }
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
return "LocalVariable (" + Index + "," + Name + ")";
|
||||
}
|
||||
}
|
||||
|
||||
public class MethodParameter : Variable, IMethodParameter
|
||||
{
|
||||
private static int get_index (ISourceMethod method, ParameterInfo param)
|
||||
{
|
||||
return method.MethodBase.IsStatic ? param.Position - 1 :
|
||||
param.Position;
|
||||
}
|
||||
|
||||
public MethodParameter (DwarfFileWriter writer, ISourceMethod method,
|
||||
ParameterInfo param)
|
||||
: base (param.Name, writer.RegisterType (param.ParameterType),
|
||||
method, get_index (method, param))
|
||||
{
|
||||
this._method = method;
|
||||
this._param = param;
|
||||
}
|
||||
|
||||
private readonly ISourceMethod _method;
|
||||
private readonly ParameterInfo _param;
|
||||
}
|
||||
|
||||
public class SourceMethod : ISourceMethod
|
||||
internal class SourceMethod
|
||||
{
|
||||
private ArrayList _lines = new ArrayList ();
|
||||
private ArrayList _blocks = new ArrayList ();
|
||||
@@ -294,12 +203,12 @@ namespace Mono.CSharp.Debugger
|
||||
private Stack _block_stack = new Stack ();
|
||||
|
||||
internal readonly MethodBase _method_base;
|
||||
internal ISourceFile _source_file;
|
||||
internal SourceFile _source_file;
|
||||
internal int _token;
|
||||
|
||||
private SourceBlock _implicit_block;
|
||||
|
||||
public SourceMethod (MethodBase method_base, ISourceFile source_file)
|
||||
public SourceMethod (MethodBase method_base, SourceFile source_file)
|
||||
: this (method_base)
|
||||
{
|
||||
this._source_file = source_file;
|
||||
@@ -312,7 +221,7 @@ namespace Mono.CSharp.Debugger
|
||||
this._implicit_block = new SourceBlock (this, 0);
|
||||
}
|
||||
|
||||
public void SetSourceRange (ISourceFile sourceFile,
|
||||
public void SetSourceRange (SourceFile sourceFile,
|
||||
int startLine, int startColumn,
|
||||
int endLine, int endColumn)
|
||||
{
|
||||
@@ -322,7 +231,7 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
|
||||
|
||||
public void StartBlock (ISourceBlock block)
|
||||
public void StartBlock (SourceBlock block)
|
||||
{
|
||||
_block_stack.Push (block);
|
||||
}
|
||||
@@ -333,7 +242,7 @@ namespace Mono.CSharp.Debugger
|
||||
block._end = new SourceLine (endOffset);
|
||||
|
||||
if (_block_stack.Count > 0) {
|
||||
ISourceBlock parent = (ISourceBlock) _block_stack.Peek ();
|
||||
SourceBlock parent = (SourceBlock) _block_stack.Peek ();
|
||||
|
||||
parent.AddBlock (block);
|
||||
} else
|
||||
@@ -349,45 +258,43 @@ namespace Mono.CSharp.Debugger
|
||||
((SourceLine) block.End)._offset = endOffset;
|
||||
}
|
||||
|
||||
public ISourceBlock CurrentBlock {
|
||||
public SourceBlock CurrentBlock {
|
||||
get {
|
||||
if (_block_stack.Count > 0)
|
||||
return (ISourceBlock) _block_stack.Peek ();
|
||||
return (SourceBlock) _block_stack.Peek ();
|
||||
else
|
||||
return _implicit_block;
|
||||
}
|
||||
}
|
||||
|
||||
// interface ISourceMethod
|
||||
|
||||
public ISourceLine[] Lines {
|
||||
public SourceLine[] Lines {
|
||||
get {
|
||||
ISourceLine[] retval = new ISourceLine [_lines.Count];
|
||||
SourceLine[] retval = new SourceLine [_lines.Count];
|
||||
_lines.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddLine (ISourceLine line)
|
||||
public void AddLine (SourceLine line)
|
||||
{
|
||||
_lines.Add (line);
|
||||
}
|
||||
|
||||
public ISourceBlock[] Blocks {
|
||||
public SourceBlock[] Blocks {
|
||||
get {
|
||||
ISourceBlock[] retval = new ISourceBlock [_blocks.Count];
|
||||
SourceBlock[] retval = new SourceBlock [_blocks.Count];
|
||||
_blocks.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public ILocalVariable[] Locals {
|
||||
public LocalVariableEntry[] Locals {
|
||||
get {
|
||||
return _implicit_block.Locals;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddLocal (ILocalVariable local)
|
||||
public void AddLocal (LocalVariableEntry local)
|
||||
{
|
||||
_implicit_block.AddLocal (local);
|
||||
}
|
||||
@@ -428,7 +335,7 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceFile SourceFile {
|
||||
public SourceFile SourceFile {
|
||||
get {
|
||||
return _source_file;
|
||||
}
|
||||
@@ -443,13 +350,13 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceLine Start {
|
||||
public SourceLine Start {
|
||||
get {
|
||||
return _implicit_block.Start;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceLine End {
|
||||
public SourceLine End {
|
||||
get {
|
||||
return _implicit_block.End;
|
||||
}
|
||||
@@ -464,33 +371,27 @@ namespace Mono.CSharp.Debugger
|
||||
protected ArrayList orphant_methods = null;
|
||||
protected ArrayList methods = null;
|
||||
protected Hashtable sources = null;
|
||||
protected DwarfFileWriter writer = null;
|
||||
private ArrayList mbuilder_array = null;
|
||||
|
||||
public ISourceMethod[] Methods {
|
||||
internal SourceMethod[] Methods {
|
||||
get {
|
||||
ISourceMethod[] retval = new ISourceMethod [methods.Count];
|
||||
SourceMethod[] retval = new SourceMethod [methods.Count];
|
||||
methods.CopyTo (retval);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public ISourceFile[] Sources {
|
||||
internal SourceFile[] Sources {
|
||||
get {
|
||||
ISourceFile[] retval = new ISourceFile [sources.Count];
|
||||
SourceFile[] retval = new SourceFile [sources.Count];
|
||||
sources.Values.CopyTo (retval, 0);
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
public DwarfFileWriter DwarfFileWriter {
|
||||
get {
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
|
||||
protected SourceMethod current_method = null;
|
||||
private SourceMethod current_method = null;
|
||||
private string assembly_filename = null;
|
||||
private string output_filename = null;
|
||||
|
||||
//
|
||||
// Interface IMonoSymbolWriter
|
||||
@@ -513,7 +414,7 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
DoFixups (assembly);
|
||||
|
||||
CreateDwarfFile (assembly);
|
||||
CreateOutput (assembly);
|
||||
}
|
||||
|
||||
public void CloseNamespace () {
|
||||
@@ -538,6 +439,7 @@ namespace Mono.CSharp.Debugger
|
||||
int addr2,
|
||||
int addr3)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void DefineGlobalVariable (
|
||||
@@ -549,6 +451,7 @@ namespace Mono.CSharp.Debugger
|
||||
int addr2,
|
||||
int addr3)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void DefineLocalVariable (string name,
|
||||
@@ -560,30 +463,13 @@ namespace Mono.CSharp.Debugger
|
||||
int addr3,
|
||||
int startOffset,
|
||||
int endOffset)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void DefineLocalVariable (string name,
|
||||
LocalBuilder local,
|
||||
FieldAttributes attributes,
|
||||
int position,
|
||||
int startOffset,
|
||||
int endOffset)
|
||||
{
|
||||
if (current_method == null)
|
||||
return;
|
||||
|
||||
ITypeHandle type = writer.RegisterType (local.LocalType);
|
||||
|
||||
LocalVariable local_info = new LocalVariable (name, type, current_method,
|
||||
position, null);
|
||||
|
||||
current_method.CurrentBlock.AddLocal (local_info);
|
||||
locals.Add (local_info);
|
||||
current_method.AddLocal (new LocalVariableEntry (name, attributes, signature));
|
||||
}
|
||||
|
||||
|
||||
public void DefineParameter (string name,
|
||||
ParameterAttributes attributes,
|
||||
int sequence,
|
||||
@@ -602,6 +488,9 @@ namespace Mono.CSharp.Debugger
|
||||
int[] endLines,
|
||||
int[] endColumns)
|
||||
{
|
||||
if (current_method == null)
|
||||
return;
|
||||
|
||||
SourceLine source_line = new SourceLine (offsets [0], lines [0], columns [0]);
|
||||
|
||||
if (current_method != null)
|
||||
@@ -615,7 +504,7 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
public void Initialize (string assembly_filename, string filename, string[] args)
|
||||
{
|
||||
this.writer = new DwarfFileWriter (filename, args);
|
||||
this.output_filename = filename;
|
||||
this.assembly_filename = assembly_filename;
|
||||
}
|
||||
|
||||
@@ -675,6 +564,7 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
public void OpenNamespace (string name)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public int OpenScope (int startOffset)
|
||||
@@ -682,7 +572,7 @@ namespace Mono.CSharp.Debugger
|
||||
if (current_method == null)
|
||||
return 0;
|
||||
|
||||
ISourceBlock block = new SourceBlock (current_method, startOffset);
|
||||
SourceBlock block = new SourceBlock (current_method, startOffset);
|
||||
current_method.StartBlock (block);
|
||||
|
||||
return block.ID;
|
||||
@@ -705,6 +595,7 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
public void SetSymAttribute (SymbolToken parent, string name, byte[] data)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void SetUnderlyingWriter (IntPtr underlyingWriter)
|
||||
@@ -714,60 +605,17 @@ namespace Mono.CSharp.Debugger
|
||||
|
||||
public void SetUserEntryPoint (SymbolToken entryMethod)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
public void UsingNamespace (string fullName)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
//
|
||||
// MonoSymbolWriter implementation
|
||||
//
|
||||
protected void WriteLocal (DwarfFileWriter.Die parent_die, ILocalVariable local)
|
||||
{
|
||||
DwarfFileWriter.DieMethodVariable die;
|
||||
|
||||
die = new DwarfFileWriter.DieMethodVariable (parent_die, local);
|
||||
}
|
||||
|
||||
protected void WriteBlock (DwarfFileWriter.Die parent_die, ISourceBlock block)
|
||||
{
|
||||
DwarfFileWriter.DieLexicalBlock die;
|
||||
|
||||
die = new DwarfFileWriter.DieLexicalBlock (parent_die, block);
|
||||
|
||||
foreach (ILocalVariable local in block.Locals)
|
||||
WriteLocal (die, local);
|
||||
|
||||
foreach (ISourceBlock subblock in block.Blocks)
|
||||
WriteBlock (die, subblock);
|
||||
}
|
||||
|
||||
protected void WriteMethod (ISourceMethod method)
|
||||
{
|
||||
DwarfFileWriter.DieCompileUnit parent_die = writer.DieGlobalCompileUnit;
|
||||
DwarfFileWriter.TypeHandle declaring_type;
|
||||
DwarfFileWriter.DieSubProgram die;
|
||||
DwarfFileWriter.Die defining_die;
|
||||
|
||||
declaring_type = DwarfFileWriter.RegisterType (method.MethodBase.DeclaringType);
|
||||
|
||||
die = new DwarfFileWriter.DieSubProgram (declaring_type.TypeDie, method);
|
||||
defining_die = new DwarfFileWriter.DieSubProgram (parent_die, die, method);
|
||||
|
||||
foreach (ILocalVariable local in method.Locals)
|
||||
WriteLocal (defining_die, local);
|
||||
|
||||
foreach (ISourceBlock block in method.Blocks)
|
||||
WriteBlock (defining_die, block);
|
||||
}
|
||||
|
||||
protected void WriteSource (DwarfFileWriter writer, ISourceFile source)
|
||||
{
|
||||
foreach (ISourceMethod method in source.Methods)
|
||||
WriteMethod (method);
|
||||
}
|
||||
|
||||
protected void DoFixups (Assembly assembly)
|
||||
{
|
||||
foreach (SourceMethod method in methods) {
|
||||
@@ -785,27 +633,10 @@ namespace Mono.CSharp.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
protected void CreateDwarfFile (Assembly assembly)
|
||||
protected void CreateOutput (Assembly assembly)
|
||||
{
|
||||
foreach (ISourceFile source in sources.Values)
|
||||
WriteSource (writer, source);
|
||||
|
||||
if (orphant_methods.Count > 0) {
|
||||
SourceFile source = new SourceFile ("<unknown>");
|
||||
|
||||
foreach (SourceMethod orphant in orphant_methods) {
|
||||
orphant._source_file = source;
|
||||
source.AddMethod (orphant);
|
||||
}
|
||||
|
||||
WriteSource (writer, source);
|
||||
}
|
||||
|
||||
writer.WriteSymbolTable (this);
|
||||
|
||||
writer.WriteLineNumberTable (this);
|
||||
|
||||
writer.Close ();
|
||||
using (MonoSymbolTableWriter writer = new MonoSymbolTableWriter (output_filename))
|
||||
writer.WriteSymbolTable (this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
This is an implementation of the System.Diagnostics.SymbolStore.ISymbolWriter
|
||||
interface which writes a dwarf debugging information file.
|
||||
|
||||
Unfortunately there are several major problems with this interface and I'm
|
||||
unsure how to solve them:
|
||||
|
||||
1.) The interface contains a constructor method `Initialize' which has an
|
||||
'IntPtr' emitter argument which seems to be a pointer to the actual
|
||||
symbol writer which resides in a proprietary, undocumented DLL (I spent
|
||||
almost 3 hours browsing the ".NET Framework SDK Documentation" and
|
||||
msdn.microsoft.com - without success.
|
||||
|
||||
A short test showed me that mscorlib doesn't like passing zero, this
|
||||
won't give you the system's default implementation.
|
||||
|
||||
To solve this problem, I created a derived interface IMonoSymbolWriter
|
||||
which contains an additional constructor which only takes the name of
|
||||
the symbol file as argument.
|
||||
|
||||
void Initialize (string filename);
|
||||
|
||||
2.) You seem to get an instance of a class implementing this interface by
|
||||
creating a new instance of System.Reflection.Emit.ModuleBuilder (with the
|
||||
`bool createSymbolFile' argument) and then calling GetSymWriter() on
|
||||
the returned object.
|
||||
|
||||
So far so good, but how does this method find out which symbol writer
|
||||
to use ?
|
||||
|
||||
3.) According to the documentation, some of the methods of
|
||||
System.Reflection.Emit.ILGenerator and System.Reflection.Emit.LocalBuilder
|
||||
seem to use the symbol writer to emit symbol debugging information.
|
||||
|
||||
But again, how do these objects get the symbol writer ?
|
||||
|
||||
Currently, there are two ways to use this assembly:
|
||||
|
||||
a.) Fix the problems outlined above and dynamically load this assembly
|
||||
(Mono.CSharp.Debugger.dll) when a new symbol writer is created.
|
||||
|
||||
b.) Reference this assembly in your application and manually create the
|
||||
symbol writer using the constructor.
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
This is an implementation of the System.Diagnostics.SymbolStore.ISymbolWriter
|
||||
interface which writes a symbol file in the dwarf format.
|
||||
|
||||
The output is an assembler input file containing dwarf data with an
|
||||
additional ELF section called ".mono_reloc_table". This section is
|
||||
read by the JIT engine to map IL offsets and such to machine
|
||||
addresses.
|
||||
|
||||
The mono relocation table contains of
|
||||
|
||||
1. A 2-byte unsigned integer containing a version number, currently 2.
|
||||
|
||||
2. A 1-byte unsigned integer containing a flag specifying whether the
|
||||
object file containing this section has already been relocated.
|
||||
|
||||
The symbol writer sets this flag to zero, you must change it to 1
|
||||
if you write the relocated file back to disk.
|
||||
|
||||
3. A 4-byte unsigned integer containing the total size of the
|
||||
relocation table, but not including the size field itself.
|
||||
|
||||
4. One or more relocation entries.
|
||||
|
||||
Each entry in the relocation table has the following form:
|
||||
|
||||
1. A 1-byte unsigned integer specifying the type of this entry.
|
||||
|
||||
2. A 4-byte unsigned integer containing the size of this entry, but
|
||||
not including the size field itself.
|
||||
|
||||
3. A 1-byte unsigned integer specifying the ELF section of this entry.
|
||||
|
||||
4. A 4-byte unsigned offset from the beginning of the ELF section to
|
||||
the location which needs to be relocated. This is called the target.
|
||||
|
||||
5. Optional additional data depending on the type of the entry.
|
||||
|
||||
The following entry types are currently defined:
|
||||
|
||||
a) TARGET_ADDRESS_SIZE - 0x01
|
||||
|
||||
The target is a 1-byte unsigned integer containing the size in
|
||||
bytes of an address on the target machine.
|
||||
|
||||
b) IL_OFFSET - 0x02
|
||||
|
||||
The target is an integer of appropriate size to hold an address on
|
||||
the target machine (the assembler ensures that the object has the
|
||||
correct size) and contains an IL offset from the beginning of the
|
||||
current method which needs to be replaced with the corresponding
|
||||
machine address.
|
||||
|
||||
This entry has a 4-byte unsigned integer argument containing the
|
||||
metadata token of the current method and a 4-byte unsigned integer
|
||||
argument containing the IL offset.
|
||||
|
||||
c) METHOD_START_ADDRESS - 0x03
|
||||
d) METHOD_END_ADDRESS - 0x04
|
||||
|
||||
The target is an integer of appropriate size to hold an address on
|
||||
the target machine (the assembler ensures that the object has the
|
||||
correct size).
|
||||
|
||||
This entry has a 4-byte unsigned integer argument containing the
|
||||
metadata token of the current method.
|
||||
|
||||
To use the generated object file, the JIT must:
|
||||
|
||||
* Check whether the file contains a ".mono_reloc_table" section.
|
||||
If not, the file cannot be used (you need to change the address size
|
||||
field in each compilation unit header).
|
||||
|
||||
* Check whether the flag field of the relocation table (the 3rd byte
|
||||
of the relocation table) is zero. If it is 1, the file has already
|
||||
been relocated. In this case, it's best to reject the file.
|
||||
|
||||
* Set the flag field to 1.
|
||||
|
||||
* Process all relocation entries.
|
||||
|
||||
* Write the modified file back to disk.
|
||||
|
||||
To do the relocation, the JIT can assume that:
|
||||
|
||||
1.) All the relevant ELF sections are physically contiguous
|
||||
(a requirement from the DWARF 2 specification).
|
||||
|
||||
2.) All relocation targets holding addresses are suitable of holding
|
||||
an address on the target machine.
|
||||
|
||||
This means that you can do something like
|
||||
|
||||
* (void **) ptr = map_to_machine (* (void **) ptr)
|
||||
|
||||
3.) There are no other changes needed in the object file - so you can
|
||||
just write it back to disk once you're done with the relocation.
|
||||
|
||||
|
||||
Last changed March 19th, 2002
|
||||
Martin Baulig <[email protected]>
|
||||
@@ -1,330 +0,0 @@
|
||||
/* -*- mode: C; c-basic-offset: 2 -*-
|
||||
|
||||
C# language support for Mono.
|
||||
Copyright 2002 Ximian, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "symtab.h"
|
||||
#include "gdbtypes.h"
|
||||
#include "gdbcore.h"
|
||||
#include "expression.h"
|
||||
#include "value.h"
|
||||
#include "valprint.h"
|
||||
#include "demangle.h"
|
||||
#include "parser-defs.h"
|
||||
#include "language.h"
|
||||
#include "symfile.h"
|
||||
#include "objfiles.h"
|
||||
#include "gdb_string.h"
|
||||
#include "csharp-lang.h"
|
||||
#include "c-lang.h"
|
||||
#include "annotate.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static void csharp_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
|
||||
struct ui_file *stream, int format, int recurse,
|
||||
enum val_prettyprint pretty);
|
||||
|
||||
/* Print the character C on STREAM as part of the contents of a literal
|
||||
string whose delimiter is QUOTER. Note that that format for printing
|
||||
characters and strings is language specific. */
|
||||
|
||||
void
|
||||
csharp_emit_char (int c, struct ui_file *stream, int quoter)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case '\\':
|
||||
case '\'':
|
||||
fprintf_filtered (stream, "\\%c", c);
|
||||
break;
|
||||
case '\b':
|
||||
fputs_filtered ("\\b", stream);
|
||||
break;
|
||||
case '\t':
|
||||
fputs_filtered ("\\t", stream);
|
||||
break;
|
||||
case '\n':
|
||||
fputs_filtered ("\\n", stream);
|
||||
break;
|
||||
case '\f':
|
||||
fputs_filtered ("\\f", stream);
|
||||
break;
|
||||
case '\r':
|
||||
fputs_filtered ("\\r", stream);
|
||||
break;
|
||||
default:
|
||||
if (isprint (c))
|
||||
fputc_filtered (c, stream);
|
||||
else
|
||||
fprintf_filtered (stream, "\\u%.4x", (unsigned int) c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
csharp_value_print (struct value *val, struct ui_file *stream, int format,
|
||||
enum val_prettyprint pretty)
|
||||
{
|
||||
struct type *type;
|
||||
CORE_ADDR address;
|
||||
int i;
|
||||
char *name;
|
||||
|
||||
type = VALUE_TYPE (val);
|
||||
address = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
|
||||
|
||||
CHECK_TYPEDEF (type);
|
||||
if (TYPE_CODE (type) == TYPE_CODE_PTR)
|
||||
{
|
||||
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
CORE_ADDR addr = unpack_pointer (type, VALUE_CONTENTS (val));
|
||||
|
||||
if ((addr != 0) &&
|
||||
((TYPE_CODE (target_type) == TYPE_CODE_CSHARP_STRING) ||
|
||||
(TYPE_CODE (target_type) == TYPE_CODE_CSHARP_ARRAY) ||
|
||||
(TYPE_CODE (target_type) == TYPE_CODE_STRUCT) ||
|
||||
(TYPE_CODE (target_type) == TYPE_CODE_CLASS)))
|
||||
{
|
||||
struct value *newval = value_at (target_type, addr, VALUE_BFD_SECTION (val));
|
||||
int retval;
|
||||
|
||||
retval = val_print (target_type, VALUE_CONTENTS (newval), 0, addr,
|
||||
stream, format, 1, 0, pretty);
|
||||
|
||||
release_value (newval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
return (val_print (type, VALUE_CONTENTS (val), 0, address,
|
||||
stream, format, 1, 0, pretty));
|
||||
}
|
||||
|
||||
void
|
||||
csharp_print_type (struct type *type, char *varstring, struct ui_file *stream,
|
||||
int show, int level)
|
||||
{
|
||||
int i;
|
||||
|
||||
CHECK_TYPEDEF (type);
|
||||
switch (TYPE_CODE (type))
|
||||
{
|
||||
case TYPE_CODE_CSHARP_STRING:
|
||||
fputs_filtered ("string", stream);
|
||||
return;
|
||||
|
||||
case TYPE_CODE_CSHARP_ARRAY:
|
||||
csharp_print_type (TYPE_TARGET_TYPE (type), varstring, stream, show, level);
|
||||
|
||||
fprintf_filtered (stream, "[");
|
||||
for (i = 1; i < TYPE_CSHARP_ARRAY_ARRAY_RANK (type); i++)
|
||||
fprintf_filtered (stream, ",");
|
||||
fputs_filtered ("]", stream);
|
||||
|
||||
return;
|
||||
|
||||
case TYPE_CODE_PTR:
|
||||
if (level == 0)
|
||||
csharp_print_type (TYPE_TARGET_TYPE (type), varstring, stream,
|
||||
show, level + 1);
|
||||
else
|
||||
c_print_type (type, varstring, stream, show, level);
|
||||
|
||||
return;
|
||||
|
||||
default:
|
||||
c_print_type (type, varstring, stream, show, level);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Called by various <lang>_val_print routines to print elements of an
|
||||
array in the form "<elem1>, <elem2>, <elem3>, ...".
|
||||
|
||||
(FIXME?) Assumes array element separator is a comma, which is correct
|
||||
for all languages currently handled.
|
||||
(FIXME?) Some languages have a notation for repeated array elements,
|
||||
perhaps we should try to use that notation when appropriate.
|
||||
*/
|
||||
|
||||
void
|
||||
csharp_print_array_elements (struct type *type, char *valaddr, CORE_ADDR address,
|
||||
struct ui_file *stream, int format, int deref_ref,
|
||||
int recurse, enum val_prettyprint pretty,
|
||||
unsigned int len, unsigned int i)
|
||||
{
|
||||
unsigned int things_printed = 0;
|
||||
struct type *elttype;
|
||||
unsigned eltlen;
|
||||
/* Position of the array element we are examining to see
|
||||
whether it is repeated. */
|
||||
unsigned int rep1;
|
||||
/* Number of repetitions we have detected so far. */
|
||||
unsigned int reps;
|
||||
|
||||
elttype = TYPE_TARGET_TYPE (type);
|
||||
eltlen = TYPE_LENGTH (check_typedef (elttype));
|
||||
|
||||
annotate_array_section_begin (i, elttype);
|
||||
|
||||
for (; i < len && things_printed < print_max; i++)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
if (prettyprint_arrays)
|
||||
{
|
||||
fprintf_filtered (stream, ",\n");
|
||||
print_spaces_filtered (2 + 2 * recurse, stream);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf_filtered (stream, ", ");
|
||||
}
|
||||
}
|
||||
wrap_here (n_spaces (2 + 2 * recurse));
|
||||
|
||||
rep1 = i + 1;
|
||||
reps = 1;
|
||||
while ((rep1 < len) &&
|
||||
!memcmp (valaddr + i * eltlen, valaddr + rep1 * eltlen, eltlen))
|
||||
{
|
||||
++reps;
|
||||
++rep1;
|
||||
}
|
||||
|
||||
if (reps > repeat_count_threshold)
|
||||
{
|
||||
val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
|
||||
stream, format, deref_ref, recurse + 1, pretty);
|
||||
annotate_elt_rep (reps);
|
||||
fprintf_filtered (stream, " <repeats %u times>", reps);
|
||||
annotate_elt_rep_end ();
|
||||
|
||||
i = rep1 - 1;
|
||||
things_printed += repeat_count_threshold;
|
||||
}
|
||||
else
|
||||
{
|
||||
val_print (elttype, valaddr + i * eltlen, 0, address + i * eltlen,
|
||||
stream, format, deref_ref, recurse + 1, pretty);
|
||||
annotate_elt ();
|
||||
things_printed++;
|
||||
}
|
||||
}
|
||||
annotate_array_section_end ();
|
||||
if (i < len)
|
||||
{
|
||||
fprintf_filtered (stream, "...");
|
||||
}
|
||||
}
|
||||
|
||||
/* Print data of type TYPE located at VALADDR (within GDB), which came from
|
||||
the inferior at address ADDRESS, onto stdio stream STREAM according to
|
||||
FORMAT (a letter or 0 for natural format). The data at VALADDR is in
|
||||
target byte order.
|
||||
|
||||
If the data are a string pointer, returns the number of string characters
|
||||
printed.
|
||||
|
||||
If DEREF_REF is nonzero, then dereference references, otherwise just print
|
||||
them like pointers.
|
||||
|
||||
The PRETTY parameter controls prettyprinting. */
|
||||
|
||||
int
|
||||
csharp_val_print (struct type *type, char *valaddr, int embedded_offset,
|
||||
CORE_ADDR address, struct ui_file *stream, int format,
|
||||
int deref_ref, int recurse, enum val_prettyprint pretty)
|
||||
{
|
||||
register unsigned int i = 0; /* Number of characters printed */
|
||||
struct type *target_type;
|
||||
struct value *newval;
|
||||
LONGEST length;
|
||||
CORE_ADDR addr;
|
||||
|
||||
CHECK_TYPEDEF (type);
|
||||
switch (TYPE_CODE (type))
|
||||
{
|
||||
case TYPE_CODE_CSHARP_STRING:
|
||||
addr = address + TYPE_CSHARP_ARRAY_LENGTH_OFFSET (type);
|
||||
length = read_memory_integer (addr, TYPE_CSHARP_ARRAY_LENGTH_BYTESIZE (type));
|
||||
|
||||
addr = address + TYPE_CSHARP_ARRAY_DATA_OFFSET (type);
|
||||
|
||||
return val_print_string (addr, length, 2, stream);
|
||||
|
||||
case TYPE_CODE_CSHARP_ARRAY:
|
||||
target_type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
|
||||
addr = address + TYPE_CSHARP_ARRAY_LENGTH_OFFSET (type);
|
||||
length = read_memory_integer (addr, TYPE_CSHARP_ARRAY_LENGTH_BYTESIZE (type));
|
||||
|
||||
addr = address + TYPE_CSHARP_ARRAY_DATA_OFFSET (type);
|
||||
|
||||
newval = allocate_repeat_value (target_type, length);
|
||||
|
||||
VALUE_LVAL (newval) = lval_memory;
|
||||
VALUE_ADDRESS (newval) = addr;
|
||||
VALUE_LAZY (newval) = 1;
|
||||
|
||||
fprintf_filtered (stream, "{");
|
||||
|
||||
csharp_print_array_elements (type, VALUE_CONTENTS (newval), addr, stream,
|
||||
format, deref_ref, recurse, pretty, length, 0);
|
||||
|
||||
fprintf_filtered (stream, "}");
|
||||
|
||||
release_value (newval);
|
||||
|
||||
return 0;
|
||||
|
||||
case TYPE_CODE_PTR:
|
||||
target_type = check_typedef (TYPE_TARGET_TYPE (type));
|
||||
addr = unpack_pointer (type, valaddr);
|
||||
|
||||
if ((addr != 0) && (TYPE_CODE (target_type) == TYPE_CODE_CSHARP_STRING))
|
||||
{
|
||||
struct value *newval = value_at (target_type, addr, NULL);
|
||||
int retval;
|
||||
|
||||
retval = val_print (target_type, VALUE_CONTENTS (newval), 0, addr,
|
||||
stream, format, 1, 0, pretty);
|
||||
|
||||
release_value (newval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return c_val_print (type, valaddr, embedded_offset, address, stream,
|
||||
format, deref_ref, recurse, pretty);
|
||||
}
|
||||
|
||||
/* Table mapping opcodes into strings for printing operators
|
||||
and precedences of the operators. */
|
||||
|
||||
const struct op_print csharp_op_print_tab[] =
|
||||
{
|
||||
{NULL, 0, 0, 0}
|
||||
};
|
||||
@@ -1,38 +0,0 @@
|
||||
/* -*- mode: C; c-basic-offset: 2 -*-
|
||||
|
||||
C# language support for Mono.
|
||||
Copyright 2002 Ximian, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef CSHARP_LANG_H
|
||||
#define CSHARP_LANG_H
|
||||
|
||||
extern const struct op_print csharp_op_print_tab[];
|
||||
|
||||
extern void csharp_emit_char (int c, struct ui_file *stream, int quoter);
|
||||
|
||||
extern void csharp_print_type (struct type *type, char *varstring,
|
||||
struct ui_file *stream, int show, int level);
|
||||
|
||||
extern int csharp_val_print (struct type *type, char *valaddr, int embedded_offset,
|
||||
CORE_ADDR address, struct ui_file *stream, int format,
|
||||
int deref_ref, int recurse, enum val_prettyprint pretty);
|
||||
|
||||
extern int csharp_value_print (struct value *val, struct ui_file *stream, int format,
|
||||
enum val_prettyprint pretty);
|
||||
|
||||
#endif
|
||||
@@ -1,76 +0,0 @@
|
||||
/* -*- mode: C; c-basic-offset: 2 -*-
|
||||
|
||||
C# language support for Mono.
|
||||
Copyright 2002 Ximian, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "symtab.h"
|
||||
#include "gdbtypes.h"
|
||||
#include "expression.h"
|
||||
#include "parser-defs.h"
|
||||
#include "language.h"
|
||||
#include "gdbtypes.h"
|
||||
#include "symtab.h"
|
||||
#include "symfile.h"
|
||||
#include "objfiles.h"
|
||||
#include "gdb_string.h"
|
||||
#include "value.h"
|
||||
#include "csharp-lang.h"
|
||||
#include "c-lang.h"
|
||||
#include "gdbcore.h"
|
||||
#include <ctype.h>
|
||||
|
||||
/* Local functions */
|
||||
|
||||
extern void _initialize_csharp_mono_language (void);
|
||||
|
||||
const struct language_defn csharp_mono_language_defn =
|
||||
{
|
||||
"csharp-mono", /* Language name */
|
||||
language_csharp_mono,
|
||||
c_builtin_types,
|
||||
range_check_off,
|
||||
type_check_off,
|
||||
case_sensitive_on,
|
||||
c_parse,
|
||||
c_error,
|
||||
evaluate_subexp_standard,
|
||||
c_printchar, /* Print a character constant */
|
||||
c_printstr, /* Function to print string constant */
|
||||
csharp_emit_char, /* Function to print a single character */
|
||||
c_create_fundamental_type, /* Create fundamental type in this language */
|
||||
csharp_print_type, /* Print a type using appropriate syntax */
|
||||
csharp_val_print, /* Print a value using appropriate syntax */
|
||||
csharp_value_print, /* Print a top-level value */
|
||||
{"", "", "", ""}, /* Binary format info */
|
||||
{"0%lo", "0", "o", ""}, /* Octal format info */
|
||||
{"%ld", "", "d", ""}, /* Decimal format info */
|
||||
{"0x%lx", "0x", "x", ""}, /* Hex format info */
|
||||
csharp_op_print_tab, /* expression operators for printing */
|
||||
0, /* not c-style arrays */
|
||||
0, /* String lower bound */
|
||||
&builtin_type_char, /* Type of string elements */
|
||||
LANG_MAGIC
|
||||
};
|
||||
|
||||
void
|
||||
_initialize_csharp_mono_language (void)
|
||||
{
|
||||
add_language (&csharp_mono_language_defn);
|
||||
}
|
||||
|
||||
@@ -1,460 +0,0 @@
|
||||
diff -ru gdb-5.2.orig/gdb/Makefile.in gdb-5.2/gdb/Makefile.in
|
||||
--- gdb-5.2.orig/gdb/Makefile.in Mon Feb 25 19:15:52 2002
|
||||
+++ gdb-5.2/gdb/Makefile.in Thu May 30 22:33:31 2002
|
||||
@@ -548,7 +548,8 @@
|
||||
tui/tui-file.h tui/tui-file.c tui/tui-out.c tui/tui-hooks.c \
|
||||
ui-file.h ui-file.c \
|
||||
frame.c doublest.c \
|
||||
- gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c
|
||||
+ gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c \
|
||||
+ csharp-lang.c csharp-mono-lang.c
|
||||
|
||||
LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
|
||||
|
||||
@@ -670,7 +671,8 @@
|
||||
vx-share/dbgRpcLib.h vx-share/ptrace.h vx-share/vxTypes.h \
|
||||
vx-share/vxWorks.h vx-share/wait.h vx-share/xdr_ld.h \
|
||||
vx-share/xdr_ptrace.h vx-share/xdr_rdb.h gdbthread.h \
|
||||
- dcache.h remote-utils.h top.h somsolib.h
|
||||
+ dcache.h remote-utils.h top.h somsolib.h \
|
||||
+ csharp-lang.h
|
||||
|
||||
# Header files that already have srcdir in them, or which are in objdir.
|
||||
|
||||
@@ -722,7 +724,8 @@
|
||||
nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o \
|
||||
ui-file.o \
|
||||
frame.o doublest.o \
|
||||
- gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o
|
||||
+ gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o \
|
||||
+ csharp-lang.o csharp-mono-lang.o
|
||||
|
||||
OBS = $(COMMON_OBS) $(ANNOTATE_OBS)
|
||||
|
||||
diff -ru gdb-5.2.orig/gdb/defs.h gdb-5.2/gdb/defs.h
|
||||
--- gdb-5.2.orig/gdb/defs.h Mon Mar 25 17:50:20 2002
|
||||
+++ gdb-5.2/gdb/defs.h Thu May 30 22:32:57 2002
|
||||
@@ -209,7 +209,8 @@
|
||||
language_m2, /* Modula-2 */
|
||||
language_asm, /* Assembly language */
|
||||
language_scm, /* Scheme / Guile */
|
||||
- language_pascal /* Pascal */
|
||||
+ language_pascal, /* Pascal */
|
||||
+ language_csharp_mono /* C# using Mono */
|
||||
};
|
||||
|
||||
enum precision_type
|
||||
diff -ru gdb-5.2.orig/gdb/dwarf2read.c gdb-5.2/gdb/dwarf2read.c
|
||||
--- gdb-5.2.orig/gdb/dwarf2read.c Thu Feb 28 12:21:16 2002
|
||||
+++ gdb-5.2/gdb/dwarf2read.c Fri Jul 5 14:34:25 2002
|
||||
@@ -733,7 +733,8 @@
|
||||
static void read_tag_volatile_type (struct die_info *, struct objfile *,
|
||||
const struct comp_unit_head *);
|
||||
|
||||
-static void read_tag_string_type (struct die_info *, struct objfile *);
|
||||
+static void read_tag_string_type (struct die_info *, struct objfile *,
|
||||
+ const struct comp_unit_head *);
|
||||
|
||||
static void read_subroutine_type (struct die_info *, struct objfile *,
|
||||
const struct comp_unit_head *);
|
||||
@@ -1520,7 +1521,7 @@
|
||||
read_tag_reference_type (die, objfile, cu_header);
|
||||
break;
|
||||
case DW_TAG_string_type:
|
||||
- read_tag_string_type (die, objfile);
|
||||
+ read_tag_string_type (die, objfile, cu_header);
|
||||
break;
|
||||
case DW_TAG_base_type:
|
||||
read_base_type (die, objfile);
|
||||
@@ -2510,6 +2511,52 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (cu_language == language_csharp_mono)
|
||||
+ {
|
||||
+ die->type = create_csharp_array_type (NULL, element_type);
|
||||
+
|
||||
+ attr = dwarf_attr (die, DW_AT_data_location);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_CSHARP_ARRAY_DATA_OFFSET (die->type) =
|
||||
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
|
||||
+ }
|
||||
+
|
||||
+ child_die = die->next;
|
||||
+ while (child_die && child_die->tag)
|
||||
+ {
|
||||
+ if (child_die->tag != DW_TAG_subrange_type)
|
||||
+ internal_error (__FILE__, __LINE__,
|
||||
+ "read_array_type: invalid C# array type");
|
||||
+
|
||||
+ ++TYPE_CSHARP_ARRAY_ARRAY_RANK (die->type);
|
||||
+
|
||||
+ child_die = sibling_die (child_die);
|
||||
+ }
|
||||
+
|
||||
+ if (TYPE_CSHARP_ARRAY_ARRAY_RANK (die->type) < 2)
|
||||
+ {
|
||||
+ attr = dwarf_attr (die->next, DW_AT_count);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_CSHARP_ARRAY_LENGTH_OFFSET (die->type) =
|
||||
+ decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
|
||||
+ }
|
||||
+
|
||||
+ attr = dwarf_attr (die->next, DW_AT_byte_size);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_CSHARP_ARRAY_LENGTH_BYTESIZE (die->type) = DW_UNSND (attr);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ TYPE_LENGTH (die->type) = max (TYPE_CSHARP_ARRAY_DATA_OFFSET (die->type),
|
||||
+ TYPE_CSHARP_ARRAY_LENGTH_OFFSET (die->type)) +
|
||||
+ TYPE_CSHARP_ARRAY_LENGTH_BYTESIZE (die->type);
|
||||
+
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
back_to = make_cleanup (null_cleanup, NULL);
|
||||
child_die = die->next;
|
||||
while (child_die && child_die->tag)
|
||||
@@ -2766,7 +2813,8 @@
|
||||
attribute to reference it. */
|
||||
|
||||
static void
|
||||
-read_tag_string_type (struct die_info *die, struct objfile *objfile)
|
||||
+read_tag_string_type (struct die_info *die, struct objfile *objfile,
|
||||
+ const struct comp_unit_head *cu_header)
|
||||
{
|
||||
struct type *type, *range_type, *index_type, *char_type;
|
||||
struct attribute *attr;
|
||||
@@ -2777,6 +2825,34 @@
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (cu_language == language_csharp_mono)
|
||||
+ {
|
||||
+ type = create_csharp_string_type (NULL, objfile);
|
||||
+ TYPE_NAME (type) = obsavestring ("string", 6, &objfile->type_obstack);
|
||||
+
|
||||
+ attr = dwarf_attr (die, DW_AT_string_length);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_CSHARP_ARRAY_LENGTH_OFFSET (type) = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
|
||||
+ }
|
||||
+
|
||||
+ attr = dwarf_attr (die, DW_AT_byte_size);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_CSHARP_ARRAY_LENGTH_BYTESIZE (type) = DW_UNSND (attr);
|
||||
+ }
|
||||
+
|
||||
+ attr = dwarf_attr (die, DW_AT_data_location);
|
||||
+ if (attr)
|
||||
+ {
|
||||
+ TYPE_CSHARP_ARRAY_DATA_OFFSET (type) = decode_locdesc (DW_BLOCK (attr), objfile, cu_header);
|
||||
+ }
|
||||
+
|
||||
+ die->type = type;
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
attr = dwarf_attr (die, DW_AT_string_length);
|
||||
if (attr)
|
||||
{
|
||||
@@ -3822,6 +3898,9 @@
|
||||
case DW_LANG_Java:
|
||||
cu_language = language_java;
|
||||
break;
|
||||
+ case DW_LANG_CSharp_Mono:
|
||||
+ cu_language = language_csharp_mono;
|
||||
+ break;
|
||||
case DW_LANG_Ada83:
|
||||
case DW_LANG_Cobol74:
|
||||
case DW_LANG_Cobol85:
|
||||
@@ -4288,6 +4367,19 @@
|
||||
add_symbol_to_list (sym, list_in_scope);
|
||||
break;
|
||||
}
|
||||
+ attr = dwarf_attr (die, DW_AT_start_scope);
|
||||
+ attr2 = dwarf_attr (die, DW_AT_end_scope);
|
||||
+ if (attr && attr2)
|
||||
+ {
|
||||
+ struct range_list *r = (struct range_list *)
|
||||
+ obstack_alloc (&objfile->type_obstack,
|
||||
+ sizeof (struct range_list));
|
||||
+
|
||||
+ r->start = DW_ADDR (attr);
|
||||
+ r->end = DW_ADDR (attr2);
|
||||
+
|
||||
+ SYMBOL_RANGES (sym) = r;
|
||||
+ }
|
||||
attr = dwarf_attr (die, DW_AT_location);
|
||||
if (attr)
|
||||
{
|
||||
@@ -4701,7 +4793,7 @@
|
||||
read_tag_volatile_type (die, objfile, cu_header);
|
||||
break;
|
||||
case DW_TAG_string_type:
|
||||
- read_tag_string_type (die, objfile);
|
||||
+ read_tag_string_type (die, objfile, cu_header);
|
||||
break;
|
||||
case DW_TAG_typedef:
|
||||
read_typedef (die, objfile, cu_header);
|
||||
diff -ru gdb-5.2.orig/gdb/findvar.c gdb-5.2/gdb/findvar.c
|
||||
--- gdb-5.2.orig/gdb/findvar.c Sun Feb 10 03:47:11 2002
|
||||
+++ gdb-5.2/gdb/findvar.c Fri May 31 01:14:10 2002
|
||||
@@ -411,9 +411,11 @@
|
||||
read_var_value (register struct symbol *var, struct frame_info *frame)
|
||||
{
|
||||
register struct value *v;
|
||||
+ register struct range_list *r;
|
||||
struct type *type = SYMBOL_TYPE (var);
|
||||
CORE_ADDR addr;
|
||||
register int len;
|
||||
+ int range_ok = 0;
|
||||
|
||||
v = allocate_value (type);
|
||||
VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */
|
||||
@@ -423,6 +425,23 @@
|
||||
|
||||
if (frame == NULL)
|
||||
frame = selected_frame;
|
||||
+
|
||||
+ if (!SYMBOL_RANGES (var))
|
||||
+ range_ok = 1;
|
||||
+ else
|
||||
+ {
|
||||
+ for (r = SYMBOL_RANGES (var); r; r = r->next)
|
||||
+ {
|
||||
+ if (r->start <= frame->pc && r->end >= frame->pc)
|
||||
+ {
|
||||
+ range_ok = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!range_ok)
|
||||
+ return NULL;
|
||||
|
||||
switch (SYMBOL_CLASS (var))
|
||||
{
|
||||
diff -ru gdb-5.2.orig/gdb/gdbtypes.c gdb-5.2/gdb/gdbtypes.c
|
||||
--- gdb-5.2.orig/gdb/gdbtypes.c Fri Feb 8 18:34:33 2002
|
||||
+++ gdb-5.2/gdb/gdbtypes.c Fri Jul 5 14:32:54 2002
|
||||
@@ -726,6 +726,26 @@
|
||||
return (result_type);
|
||||
}
|
||||
|
||||
+struct type *
|
||||
+create_csharp_array_type (struct type *result_type, struct type *element_type)
|
||||
+{
|
||||
+ LONGEST low_bound, high_bound;
|
||||
+
|
||||
+ if (result_type == NULL)
|
||||
+ {
|
||||
+ result_type = alloc_type (TYPE_OBJFILE (element_type));
|
||||
+ }
|
||||
+ TYPE_CODE (result_type) = TYPE_CODE_CSHARP_ARRAY;
|
||||
+ TYPE_TARGET_TYPE (result_type) = element_type;
|
||||
+
|
||||
+ CHECK_TYPEDEF (element_type);
|
||||
+
|
||||
+ TYPE_CSHARP_ARRAY (result_type) = (struct csharp_array_type *)
|
||||
+ TYPE_ALLOC (result_type, sizeof (struct csharp_array_type));
|
||||
+
|
||||
+ return (result_type);
|
||||
+}
|
||||
+
|
||||
/* Create a string type using either a blank type supplied in RESULT_TYPE,
|
||||
or creating a new type. String types are similar enough to array of
|
||||
char types that we can use create_array_type to build the basic type
|
||||
@@ -744,6 +764,18 @@
|
||||
*current_language->string_char_type,
|
||||
range_type);
|
||||
TYPE_CODE (result_type) = TYPE_CODE_STRING;
|
||||
+ return (result_type);
|
||||
+}
|
||||
+
|
||||
+struct type *
|
||||
+create_csharp_string_type (struct type *result_type, struct objfile *objfile)
|
||||
+{
|
||||
+ result_type = alloc_type (objfile);
|
||||
+ TYPE_CODE (result_type) = TYPE_CODE_CSHARP_STRING;
|
||||
+
|
||||
+ TYPE_CSHARP_ARRAY (result_type) = (struct csharp_array_type *)
|
||||
+ TYPE_ALLOC (result_type, sizeof (struct csharp_array_type));
|
||||
+
|
||||
return (result_type);
|
||||
}
|
||||
|
||||
diff -ru gdb-5.2.orig/gdb/gdbtypes.h gdb-5.2/gdb/gdbtypes.h
|
||||
--- gdb-5.2.orig/gdb/gdbtypes.h Sun Feb 3 23:57:56 2002
|
||||
+++ gdb-5.2/gdb/gdbtypes.h Fri Jul 5 00:16:16 2002
|
||||
@@ -130,7 +130,10 @@
|
||||
|
||||
TYPE_CODE_TYPEDEF,
|
||||
TYPE_CODE_TEMPLATE, /* C++ template */
|
||||
- TYPE_CODE_TEMPLATE_ARG /* C++ template arg */
|
||||
+ TYPE_CODE_TEMPLATE_ARG, /* C++ template arg */
|
||||
+
|
||||
+ TYPE_CODE_CSHARP_STRING, /* C# string */
|
||||
+ TYPE_CODE_CSHARP_ARRAY /* C# array */
|
||||
|
||||
};
|
||||
|
||||
@@ -471,6 +474,10 @@
|
||||
|
||||
struct cplus_struct_type *cplus_stuff;
|
||||
|
||||
+ /* CSHARP_ARRAY is for TYPE_CODE_CSHARP_ARRAY. */
|
||||
+
|
||||
+ struct csharp_array_type *csharp_array;
|
||||
+
|
||||
/* FLOATFORMAT is for TYPE_CODE_FLT. It is a pointer to the
|
||||
floatformat object that describes the floating-point value
|
||||
that resides within the type. */
|
||||
@@ -704,6 +711,20 @@
|
||||
*localtype_ptr;
|
||||
};
|
||||
|
||||
+/* C# language-specific information for TYPE_CODE_CSHARP_STRING and
|
||||
+ * TYPE_CODE_CSHARP_ARRAY nodes. */
|
||||
+
|
||||
+struct csharp_array_type
|
||||
+ {
|
||||
+ unsigned array_rank;
|
||||
+
|
||||
+ unsigned length_offset;
|
||||
+
|
||||
+ unsigned length_bytesize;
|
||||
+
|
||||
+ unsigned data_offset;
|
||||
+ };
|
||||
+
|
||||
/* Struct used in computing virtual base list */
|
||||
struct vbase
|
||||
{
|
||||
@@ -844,6 +865,14 @@
|
||||
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
|
||||
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n)))
|
||||
|
||||
+/* C# */
|
||||
+
|
||||
+#define TYPE_CSHARP_ARRAY(thistype) (thistype)->type_specific.csharp_array
|
||||
+#define TYPE_CSHARP_ARRAY_ARRAY_RANK(thistype) TYPE_CSHARP_ARRAY(thistype)->array_rank
|
||||
+#define TYPE_CSHARP_ARRAY_LENGTH_OFFSET(thistype) TYPE_CSHARP_ARRAY(thistype)->length_offset
|
||||
+#define TYPE_CSHARP_ARRAY_LENGTH_BYTESIZE(thistype) TYPE_CSHARP_ARRAY(thistype)->length_bytesize
|
||||
+#define TYPE_CSHARP_ARRAY_DATA_OFFSET(thistype) TYPE_CSHARP_ARRAY(thistype)->data_offset
|
||||
+
|
||||
#define TYPE_FIELD_STATIC(thistype, n) ((thistype)->fields[n].bitsize < 0)
|
||||
#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) ((thistype)->fields[n].bitsize == -2)
|
||||
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_PHYSNAME(TYPE_FIELD(thistype, n))
|
||||
@@ -1100,7 +1129,12 @@
|
||||
extern struct type *create_array_type (struct type *, struct type *,
|
||||
struct type *);
|
||||
|
||||
+extern struct type *create_csharp_array_type (struct type *result_type,
|
||||
+ struct type *element_type);
|
||||
+
|
||||
extern struct type *create_string_type (struct type *, struct type *);
|
||||
+
|
||||
+extern struct type *create_csharp_string_type (struct type *, struct objfile *);
|
||||
|
||||
extern struct type *create_set_type (struct type *, struct type *);
|
||||
|
||||
diff -ru gdb-5.2.orig/gdb/language.c gdb-5.2/gdb/language.c
|
||||
--- gdb-5.2.orig/gdb/language.c Wed Feb 13 19:49:30 2002
|
||||
+++ gdb-5.2/gdb/language.c Thu May 30 22:32:57 2002
|
||||
@@ -865,6 +865,7 @@
|
||||
case language_chill:
|
||||
case language_m2:
|
||||
case language_pascal:
|
||||
+ case language_csharp_mono:
|
||||
return TYPE_CODE (type) != TYPE_CODE_CHAR ? 0 : 1;
|
||||
|
||||
case language_c:
|
||||
diff -ru gdb-5.2.orig/gdb/stack.c gdb-5.2/gdb/stack.c
|
||||
--- gdb-5.2.orig/gdb/stack.c Thu Feb 14 08:24:54 2002
|
||||
+++ gdb-5.2/gdb/stack.c Fri May 31 01:13:24 2002
|
||||
@@ -1173,14 +1173,36 @@
|
||||
case LOC_REGISTER:
|
||||
case LOC_STATIC:
|
||||
case LOC_BASEREG:
|
||||
- values_printed = 1;
|
||||
- for (j = 0; j < num_tabs; j++)
|
||||
- fputs_filtered ("\t", stream);
|
||||
- fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
|
||||
- fputs_filtered (" = ", stream);
|
||||
- print_variable_value (sym, fi, stream);
|
||||
- fprintf_filtered (stream, "\n");
|
||||
- break;
|
||||
+ {
|
||||
+ struct range_list *r;
|
||||
+ int range_ok = 0;
|
||||
+
|
||||
+ if (!SYMBOL_RANGES (sym))
|
||||
+ range_ok = 1;
|
||||
+ else
|
||||
+ {
|
||||
+ for (r = SYMBOL_RANGES (sym); r; r = r->next)
|
||||
+ {
|
||||
+ if (r->start <= fi->pc && r->end >= fi->pc)
|
||||
+ {
|
||||
+ range_ok = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (range_ok)
|
||||
+ {
|
||||
+ values_printed = 1;
|
||||
+ for (j = 0; j < num_tabs; j++)
|
||||
+ fputs_filtered ("\t", stream);
|
||||
+ fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
|
||||
+ fputs_filtered (" = ", stream);
|
||||
+ print_variable_value (sym, fi, stream);
|
||||
+ fprintf_filtered (stream, "\n");
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
default:
|
||||
/* Ignore symbols which are not locals. */
|
||||
diff -ru gdb-5.2.orig/include/elf/ChangeLog gdb-5.2/include/elf/ChangeLog
|
||||
--- gdb-5.2.orig/include/elf/ChangeLog Wed Feb 13 19:14:48 2002
|
||||
+++ gdb-5.2/include/elf/ChangeLog Fri May 31 00:25:33 2002
|
||||
@@ -1,3 +1,7 @@
|
||||
+2002-04-12 Martin Baulig <[email protected]>
|
||||
+
|
||||
+ * dwarf2.h (DW_AT_end_scope): Added as GNU extension.
|
||||
+
|
||||
2002-02-13 Matt Fredette <[email protected]>
|
||||
|
||||
* m68k.h (EF_M68000): Define.
|
||||
diff -ru gdb-5.2.orig/include/elf/dwarf2.h gdb-5.2/include/elf/dwarf2.h
|
||||
--- gdb-5.2.orig/include/elf/dwarf2.h Tue Jan 29 00:26:53 2002
|
||||
+++ gdb-5.2/include/elf/dwarf2.h Fri May 31 00:25:33 2002
|
||||
@@ -328,6 +328,8 @@
|
||||
DW_AT_src_coords = 0x2104,
|
||||
DW_AT_body_begin = 0x2105,
|
||||
DW_AT_body_end = 0x2106,
|
||||
+ DW_AT_end_scope = 0x2121,
|
||||
+
|
||||
/* VMS Extensions. */
|
||||
DW_AT_VMS_rtnbeg_pd_address = 0x2201
|
||||
};
|
||||
@@ -675,7 +677,8 @@
|
||||
DW_LANG_Ada95 = 0x000d,
|
||||
DW_LANG_Fortran95 = 0x000e,
|
||||
/* MIPS. */
|
||||
- DW_LANG_Mips_Assembler = 0x8001
|
||||
+ DW_LANG_Mips_Assembler = 0x8001,
|
||||
+ DW_LANG_CSharp_Mono = 0x9001
|
||||
};
|
||||
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
Index: include/elf/ChangeLog
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/include/elf/ChangeLog,v
|
||||
retrieving revision 1.121
|
||||
diff -u -u -p -r1.121 ChangeLog
|
||||
--- include/elf/ChangeLog 13 Feb 2002 18:14:48 -0000 1.121
|
||||
+++ include/elf/ChangeLog 12 Apr 2002 19:50:31 -0000
|
||||
@@ -1,3 +1,7 @@
|
||||
+2002-04-12 Martin Baulig <[email protected]>
|
||||
+
|
||||
+ * dwarf2.h (DW_AT_end_scope): Added as GNU extension.
|
||||
+
|
||||
2002-02-13 Matt Fredette <[email protected]>
|
||||
|
||||
* m68k.h (EF_M68000): Define.
|
||||
Index: include/elf/dwarf2.h
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/include/elf/dwarf2.h,v
|
||||
retrieving revision 1.8
|
||||
diff -u -u -p -r1.8 dwarf2.h
|
||||
--- include/elf/dwarf2.h 28 Jan 2002 23:26:53 -0000 1.8
|
||||
+++ include/elf/dwarf2.h 12 Apr 2002 19:50:32 -0000
|
||||
@@ -328,6 +328,8 @@ enum dwarf_attribute
|
||||
DW_AT_src_coords = 0x2104,
|
||||
DW_AT_body_begin = 0x2105,
|
||||
DW_AT_body_end = 0x2106,
|
||||
+ DW_AT_end_scope = 0x2121,
|
||||
+
|
||||
/* VMS Extensions. */
|
||||
DW_AT_VMS_rtnbeg_pd_address = 0x2201
|
||||
};
|
||||
Index: gdb/ChangeLog
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/ChangeLog,v
|
||||
retrieving revision 1.2421
|
||||
diff -u -u -p -r1.2421 ChangeLog
|
||||
--- gdb/ChangeLog 12 Apr 2002 07:37:17 -0000 1.2421
|
||||
+++ gdb/ChangeLog 12 Apr 2002 19:50:38 -0000
|
||||
@@ -1,3 +1,14 @@
|
||||
+2002-04-12 Martin Baulig <[email protected]>
|
||||
+
|
||||
+ * dwarf2read.c (new_symbol): If DW_AT_start_scope and DW_AT_end_scope
|
||||
+ are specified, set SYMBOL_RANGES().
|
||||
+
|
||||
+ * findvar.c (read_var_value): Check whether the current PC is within
|
||||
+ the SYMBOL_RANGES(), return NULL if not.
|
||||
+
|
||||
+ * stack.c (print_block_frame_locals): Only print vars if the current PC
|
||||
+ is in their SYMBOL_RANGES().
|
||||
+
|
||||
2002-04-12 Kevin Buettner <[email protected]>
|
||||
|
||||
From Jimi X <[email protected]>:
|
||||
Index: gdb/dwarf2read.c
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
|
||||
retrieving revision 1.52
|
||||
diff -u -u -p -r1.52 dwarf2read.c
|
||||
--- gdb/dwarf2read.c 4 Apr 2002 22:26:43 -0000 1.52
|
||||
+++ gdb/dwarf2read.c 12 Apr 2002 19:50:44 -0000
|
||||
@@ -4394,6 +4394,19 @@ new_symbol (struct die_info *die, struct
|
||||
add_symbol_to_list (sym, list_in_scope);
|
||||
break;
|
||||
}
|
||||
+ attr = dwarf_attr (die, DW_AT_start_scope);
|
||||
+ attr2 = dwarf_attr (die, DW_AT_end_scope);
|
||||
+ if (attr && attr2)
|
||||
+ {
|
||||
+ struct range_list *r = (struct range_list *)
|
||||
+ obstack_alloc (&objfile->type_obstack,
|
||||
+ sizeof (struct range_list));
|
||||
+
|
||||
+ r->start = DW_ADDR (attr);
|
||||
+ r->end = DW_ADDR (attr2);
|
||||
+
|
||||
+ SYMBOL_RANGES (sym) = r;
|
||||
+ }
|
||||
attr = dwarf_attr (die, DW_AT_location);
|
||||
if (attr)
|
||||
{
|
||||
Index: gdb/findvar.c
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/findvar.c,v
|
||||
retrieving revision 1.31
|
||||
diff -u -u -p -r1.31 findvar.c
|
||||
--- gdb/findvar.c 9 Apr 2002 03:06:13 -0000 1.31
|
||||
+++ gdb/findvar.c 12 Apr 2002 19:50:45 -0000
|
||||
@@ -417,9 +417,11 @@ struct value *
|
||||
read_var_value (register struct symbol *var, struct frame_info *frame)
|
||||
{
|
||||
register struct value *v;
|
||||
+ register struct range_list *r;
|
||||
struct type *type = SYMBOL_TYPE (var);
|
||||
CORE_ADDR addr;
|
||||
register int len;
|
||||
+ int range_ok = 0;
|
||||
|
||||
v = allocate_value (type);
|
||||
VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */
|
||||
@@ -429,6 +431,23 @@ read_var_value (register struct symbol *
|
||||
|
||||
if (frame == NULL)
|
||||
frame = selected_frame;
|
||||
+
|
||||
+ if (!SYMBOL_RANGES (var))
|
||||
+ range_ok = 1;
|
||||
+ else
|
||||
+ {
|
||||
+ for (r = SYMBOL_RANGES (var); r; r = r->next)
|
||||
+ {
|
||||
+ if (r->start <= frame->pc && r->end > frame->pc)
|
||||
+ {
|
||||
+ range_ok = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!range_ok)
|
||||
+ return NULL;
|
||||
|
||||
switch (SYMBOL_CLASS (var))
|
||||
{
|
||||
Index: gdb/stack.c
|
||||
===================================================================
|
||||
RCS file: /cvs/src/src/gdb/stack.c,v
|
||||
retrieving revision 1.33
|
||||
diff -u -u -p -r1.33 stack.c
|
||||
--- gdb/stack.c 10 Apr 2002 23:32:33 -0000 1.33
|
||||
+++ gdb/stack.c 12 Apr 2002 19:50:47 -0000
|
||||
@@ -1173,14 +1173,36 @@ print_block_frame_locals (struct block *
|
||||
case LOC_REGISTER:
|
||||
case LOC_STATIC:
|
||||
case LOC_BASEREG:
|
||||
- values_printed = 1;
|
||||
- for (j = 0; j < num_tabs; j++)
|
||||
- fputs_filtered ("\t", stream);
|
||||
- fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
|
||||
- fputs_filtered (" = ", stream);
|
||||
- print_variable_value (sym, fi, stream);
|
||||
- fprintf_filtered (stream, "\n");
|
||||
- break;
|
||||
+ {
|
||||
+ struct range_list *r;
|
||||
+ int range_ok = 0;
|
||||
+
|
||||
+ if (!SYMBOL_RANGES (sym))
|
||||
+ range_ok = 1;
|
||||
+ else
|
||||
+ {
|
||||
+ for (r = SYMBOL_RANGES (sym); r; r = r->next)
|
||||
+ {
|
||||
+ if (r->start <= fi->pc && r->end > fi->pc)
|
||||
+ {
|
||||
+ range_ok = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (range_ok)
|
||||
+ {
|
||||
+ values_printed = 1;
|
||||
+ for (j = 0; j < num_tabs; j++)
|
||||
+ fputs_filtered ("\t", stream);
|
||||
+ fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
|
||||
+ fputs_filtered (" = ", stream);
|
||||
+ print_variable_value (sym, fi, stream);
|
||||
+ fprintf_filtered (stream, "\n");
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
default:
|
||||
/* Ignore symbols which are not locals. */
|
||||
@@ -1,6 +1,6 @@
|
||||
AssemblerWriterI386.cs
|
||||
IAssemblerWriter.cs
|
||||
IMonoSymbolWriter.cs
|
||||
MonoDwarfFileWriter.cs
|
||||
MonoSymbolDocumentWriter.cs
|
||||
MonoSymbolWriter.cs
|
||||
MonoSymbolTable.cs
|
||||
MonoSymbolTableWriter.cs
|
||||
IMonoBinaryReader.cs
|
||||
@@ -1,6 +1,6 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = ../lib/Mono.CSharp.Debugger.dll
|
||||
LIBRARY = $(topdir)/class/lib/Mono.CSharp.Debugger.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r corlib
|
||||
@@ -8,6 +8,6 @@ LIB_FLAGS = -r corlib
|
||||
SOURCES_INCLUDE=*.cs
|
||||
|
||||
|
||||
export MONO_PATH_PREFIX = ../lib:
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include ../library.make
|
||||
include $(topdir)/class/library.make
|
||||
Whitespace-only changes.
@@ -0,0 +1,141 @@
|
||||
//
|
||||
// Mono.Directory.LDAP.LDAP
|
||||
//
|
||||
// Author:
|
||||
// Chris Toshok ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
//
|
||||
// Just enough (for now) LDAP support to get System.DirectoryServices
|
||||
// working.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Directory.LDAP
|
||||
{
|
||||
class TimeVal {
|
||||
public int tv_sec;
|
||||
public int tv_usec;
|
||||
|
||||
public static TimeVal FromTimeSpan (TimeSpan span) {
|
||||
TimeVal tv = new TimeVal();
|
||||
long nanoseconds;
|
||||
|
||||
/* make sure we're dealing with a positive TimeSpan */
|
||||
span = span.Duration();
|
||||
|
||||
nanoseconds = span.Ticks * 100;
|
||||
|
||||
tv.tv_sec = (int)(nanoseconds / 1E+09);
|
||||
tv.tv_usec = (int)((nanoseconds % 1E+09) / 1000);
|
||||
|
||||
return tv;
|
||||
}
|
||||
}
|
||||
|
||||
public enum SearchScope {
|
||||
Base = 0x0000,
|
||||
OneLevel = 0x0001,
|
||||
SubTree = 0x0002
|
||||
}
|
||||
|
||||
public class LDAP {
|
||||
|
||||
/* Search Scopes */
|
||||
public LDAP (string uri) {
|
||||
int rv;
|
||||
rv = ldap_initialize (out ld, uri);
|
||||
// FIXME throw something here if ldap_initialize returns an error
|
||||
}
|
||||
|
||||
public LDAP (string host, int port) {
|
||||
ld = ldap_init (host, port);
|
||||
// FIXME throw something here if ldap_init fails.
|
||||
}
|
||||
|
||||
public int BindSimple (string who, string cred) {
|
||||
return ldap_simple_bind_s (ld, who, cred);
|
||||
}
|
||||
|
||||
public int StartTLS () {
|
||||
// FIXME should expose client/server ctrls
|
||||
return ldap_start_tls_s (ld, (IntPtr)null, (IntPtr)null);
|
||||
}
|
||||
|
||||
public int Search (string base_entry,
|
||||
SearchScope scope,
|
||||
string filter,
|
||||
string[] attrs,
|
||||
bool attrsonly,
|
||||
TimeSpan timeOut,
|
||||
int sizeLimit,
|
||||
out LDAPMessage res) {
|
||||
// FIXME should expose client/server ctrls
|
||||
IntPtr serverctrls = new IntPtr();
|
||||
IntPtr clientctrls = new IntPtr();
|
||||
TimeVal tv = TimeVal.FromTimeSpan (timeOut);
|
||||
IntPtr native_res;
|
||||
int rv;
|
||||
|
||||
rv = ldap_search_ext_s (ld, base_entry, (int) scope, filter,
|
||||
attrs, attrsonly ? 1 : 0,
|
||||
serverctrls, clientctrls,
|
||||
ref tv, sizeLimit, out native_res);
|
||||
|
||||
if (native_res != IntPtr.Zero)
|
||||
res = new LDAPMessage (this, native_res);
|
||||
else
|
||||
res = null;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
public void Unbind () {
|
||||
// FIXME should expose client/server ctrls
|
||||
ldap_unbind_ext_s (ld, (IntPtr)null, (IntPtr)null);
|
||||
// FIXME throw something here if ldap_unbind_ext_s returns an error
|
||||
}
|
||||
|
||||
public IntPtr NativeLDAP {
|
||||
get { return ld; }
|
||||
}
|
||||
|
||||
[DllImport("ldap")]
|
||||
static extern IntPtr ldap_init(string host, int port);
|
||||
|
||||
[DllImport("ldap")]
|
||||
static extern int ldap_initialize(out IntPtr ld, string uri);
|
||||
|
||||
[DllImport("ldap")]
|
||||
static extern int ldap_simple_bind_s(IntPtr ld,
|
||||
string who, string cred);
|
||||
|
||||
[DllImport("ldap")]
|
||||
static extern int ldap_start_tls_s (IntPtr ld,
|
||||
IntPtr serverctrls,
|
||||
IntPtr clientctrls);
|
||||
|
||||
[DllImport("ldap")]
|
||||
static extern int ldap_search_ext_s (IntPtr ld,
|
||||
string base_entry,
|
||||
int scope,
|
||||
string filter,
|
||||
string[] attrs,
|
||||
int attrsonly,
|
||||
IntPtr serverctrls,
|
||||
IntPtr clientctrls,
|
||||
ref TimeVal timeout,
|
||||
int sizelimit,
|
||||
out IntPtr res);
|
||||
|
||||
[DllImport("ldap")]
|
||||
static extern int ldap_unbind_ext_s (IntPtr ld,
|
||||
IntPtr serverctrls,
|
||||
IntPtr clientctrls);
|
||||
|
||||
IntPtr ld;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
//
|
||||
// Mono.Directory.LDAP.LDAPMessage
|
||||
//
|
||||
// Author:
|
||||
// Chris Toshok ([email protected])
|
||||
//
|
||||
// (C) Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
//
|
||||
// Just enough (for now) LDAP support to get System.DirectoryServices
|
||||
// working.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.Directory.LDAP
|
||||
{
|
||||
public class LDAPMessage {
|
||||
|
||||
internal LDAPMessage(LDAP ld, IntPtr ldm) {
|
||||
this.ld = ld;
|
||||
this.ldm = ldm;
|
||||
}
|
||||
|
||||
public LDAPMessage FirstMessage () {
|
||||
IntPtr nm = ldap_first_message (ld.NativeLDAP ,ldm);
|
||||
|
||||
if (nm == IntPtr.Zero)
|
||||
return null;
|
||||
else
|
||||
return new LDAPMessage (ld, nm);
|
||||
}
|
||||
|
||||
public LDAPMessage NextMessage () {
|
||||
IntPtr nm = ldap_next_message (ld.NativeLDAP ,ldm);
|
||||
|
||||
if (nm == IntPtr.Zero)
|
||||
return null;
|
||||
else
|
||||
return new LDAPMessage (ld, nm);
|
||||
}
|
||||
|
||||
public int CountMessages () {
|
||||
return ldap_count_messages (ld.NativeLDAP, ldm);
|
||||
}
|
||||
|
||||
public LDAPMessage FirstEntry() {
|
||||
IntPtr nm = ldap_first_entry (ld.NativeLDAP ,ldm);
|
||||
|
||||
if (nm == IntPtr.Zero)
|
||||
return null;
|
||||
else
|
||||
return new LDAPMessage (ld, nm);
|
||||
}
|
||||
|
||||
public LDAPMessage NextEntry() {
|
||||
IntPtr nm = ldap_next_entry (ld.NativeLDAP ,ldm);
|
||||
|
||||
if (nm == IntPtr.Zero)
|
||||
return null;
|
||||
else
|
||||
return new LDAPMessage (ld, nm);
|
||||
}
|
||||
|
||||
public int CountEntries() {
|
||||
return ldap_count_entries (ld.NativeLDAP, ldm);
|
||||
}
|
||||
|
||||
public string DN {
|
||||
get { return ldap_get_dn (ld.NativeLDAP, ldm); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public string[] GetValues (string target) {
|
||||
throw new NotImplementedException ();
|
||||
/*
|
||||
string[] ldap_values;
|
||||
|
||||
Console.WriteLine ("calling ldap_get_values ({0})", target);
|
||||
|
||||
ldap_values = ldap_get_values (ld.NativeLDAP, ldm, target);
|
||||
|
||||
if (ldap_values != null) {
|
||||
string[] rv;
|
||||
int i;
|
||||
|
||||
rv = new string[ldap_values.Length - 1];
|
||||
for (i = 0; i < ldap_values.Length - 1; i ++)
|
||||
rv[i] = ldap_values[i];
|
||||
|
||||
return rv;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static string ldap_get_dn (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static IntPtr ldap_first_message (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static IntPtr ldap_next_message (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static int ldap_count_messages (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static IntPtr ldap_first_entry (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static IntPtr ldap_next_entry (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static int ldap_count_entries (IntPtr ld, IntPtr ldm);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static string ldap_first_attribute (IntPtr ld, IntPtr ldm, out IntPtr ber);
|
||||
|
||||
[DllImport("ldap")]
|
||||
extern static string ldap_next_attribute (IntPtr ld, IntPtr ldm, IntPtr ber);
|
||||
|
||||
/*
|
||||
[DllImport("ldapglue")]
|
||||
extern static void ldapsharp_get_values (IntPtr ld, IntPtr ldm, string target,
|
||||
out string[] values, out int count);
|
||||
*/
|
||||
IntPtr ldm;
|
||||
LDAP ld;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// MonoTests.System.DirectoryServices.AllTests, System.DirectoryServices.dll
|
||||
//
|
||||
// Author:
|
||||
// Chris Toshok <[email protected]>
|
||||
//
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using MonoTests.Directory.LDAP;
|
||||
|
||||
namespace MonoTests.Directory.LDAP {
|
||||
|
||||
public class AllTests : TestCase {
|
||||
|
||||
public AllTests (string name) : base (name)
|
||||
{
|
||||
}
|
||||
|
||||
public static ITest Suite {
|
||||
get {
|
||||
TestSuite suite = new TestSuite ();
|
||||
suite.AddTest (BindSimpleTest.Suite);
|
||||
suite.AddTest (QueryRootDSE.Suite);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using Mono.Directory.LDAP;
|
||||
|
||||
namespace MonoTests.Directory.LDAP
|
||||
{
|
||||
public class BindSimpleTest : TestCase {
|
||||
public BindSimpleTest () :
|
||||
base ("[MonoTests.Directory.LDAP.BindSimpleTest]'") {}
|
||||
|
||||
public BindSimpleTest (string name) :
|
||||
base (name) {}
|
||||
|
||||
protected override void SetUp () {}
|
||||
|
||||
protected override void TearDown () {}
|
||||
|
||||
public static ITest Suite
|
||||
{
|
||||
get {
|
||||
return new TestSuite (typeof (BindSimpleTest));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void TestStuff() {
|
||||
string myLDAPPath = "ldap://ldap.toshok.org";
|
||||
string username = "cn=Manager,dc=toshok,dc=org", passwd = "evotest";
|
||||
try {
|
||||
LDAP ld = new LDAP (myLDAPPath);
|
||||
|
||||
ld.BindSimple (username, passwd);
|
||||
|
||||
Console.WriteLine("Successfully bound {0} at {1}", username, myLDAPPath);
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("The '" + myLDAPPath + "' path not found.");
|
||||
Console.WriteLine("Exception : " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using Mono.Directory.LDAP;
|
||||
|
||||
namespace MonoTests.Directory.LDAP
|
||||
{
|
||||
public class QueryRootDSE : TestCase {
|
||||
public QueryRootDSE () :
|
||||
base ("[MonoTests.Directory.LDAP.QueryRootDSE]'") {}
|
||||
|
||||
public QueryRootDSE (string name) :
|
||||
base (name) {}
|
||||
|
||||
protected override void SetUp () {}
|
||||
|
||||
protected override void TearDown () {}
|
||||
|
||||
public static ITest Suite
|
||||
{
|
||||
get {
|
||||
return new TestSuite (typeof (QueryRootDSE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void TestStuff() {
|
||||
string myLDAPPath = "ldap://ldap.toshok.org";
|
||||
try {
|
||||
LDAP ld = new LDAP (myLDAPPath);
|
||||
LDAPMessage res, entry;
|
||||
string[] attrs = { "+", null };
|
||||
|
||||
/* don't bind, we do this anonymously */
|
||||
|
||||
ld.Search ("" /* root dse */,
|
||||
SearchScope.Base,
|
||||
"(objectclass=*)",
|
||||
attrs, false,
|
||||
TimeSpan.FromSeconds(10), 0 /* no size limit */,
|
||||
out res);
|
||||
|
||||
if (res == null) {
|
||||
Console.WriteLine ("the search failed");
|
||||
}
|
||||
|
||||
Console.WriteLine ("There are {0} entries", res.CountEntries());
|
||||
|
||||
entry = res.FirstEntry();
|
||||
if (entry == null)
|
||||
Console.WriteLine ("null returned from res.FirstEntry");
|
||||
|
||||
string[] extensions = entry.GetValues ("supportedExtension");
|
||||
|
||||
if (extensions != null) {
|
||||
foreach( String e in extensions )
|
||||
Console.WriteLine ("Supported Extension: {0}\n", e);
|
||||
}
|
||||
else {
|
||||
Console.WriteLine ("null returned from entry.GetValues\n");
|
||||
}
|
||||
}
|
||||
catch(Exception e) {
|
||||
Console.WriteLine("The '" + myLDAPPath + "' path not found.");
|
||||
Console.WriteLine("Exception : " + e.Message);
|
||||
Console.WriteLine(e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -0,0 +1,10 @@
|
||||
--target library
|
||||
-o dslib_linux_test.dll
|
||||
--noconfig
|
||||
-r ../../lib/Mono.Directory.LDAP.dll
|
||||
-r ../../lib/corlib.dll
|
||||
-r ../../lib/System.dll
|
||||
-r ../../../nunit/NUnitCore_mono.dll
|
||||
Mono.Directory.LDAP/BindSimpleTest.cs
|
||||
Mono.Directory.LDAP/QueryRootDSE.cs
|
||||
Mono.Directory.LDAP/AllTests.cs
|
||||
@@ -0,0 +1,23 @@
|
||||
topdir = ../../..
|
||||
|
||||
LIBRARY = dslib_linux_test.dll
|
||||
|
||||
LIB_LIST = dslib_linux_test.args
|
||||
LIB_FLAGS = -r ../../lib/Mono.Directory.LDAP.dll -r ../../lib/corlib.dll -r ../../lib/System.dll \
|
||||
-r $(topdir)/nunit/src/NUnitCore/NUnitCore_mono.dll
|
||||
|
||||
include ../../library.make
|
||||
|
||||
MCS_FLAGS = --target library --noconfig
|
||||
|
||||
TEST_SUITE_PREFIX = MonoTests.Directory.LDAP.
|
||||
TEST_SUITE = AllTests
|
||||
NUNITCONSOLE=$(topdir)/nunit/src/NUnitConsole/NUnitConsole_mono.exe
|
||||
NUNIT_MONO_PATH=$(topdir)/nunit/src/NUnitCore:.
|
||||
|
||||
test: $(LIBRARY) run_test
|
||||
|
||||
.PHONY: run_test
|
||||
|
||||
run_test:
|
||||
MONO_PATH=$(NUNIT_MONO_PATH) mono $(NUNITCONSOLE) $(TEST_SUITE_PREFIX)$(TEST_SUITE),dslib_linux_test.dll
|
||||
@@ -0,0 +1,2 @@
|
||||
Mono.Directory.LDAP/LDAP.cs
|
||||
Mono.Directory.LDAP/LDAPMessage.cs
|
||||
@@ -0,0 +1,14 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = ../lib/Mono.Directory.LDAP.dll
|
||||
|
||||
LIB_LIST = list
|
||||
LIB_FLAGS = -r corlib -r System -r System.Data -r mscorlib
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
SOURCES_EXCLUDE=\
|
||||
./Test*
|
||||
|
||||
export MONO_PATH_PREFIX = ../lib:
|
||||
|
||||
include ../library.make
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// AboutAttribute.cs
|
||||
//
|
||||
// Author: Rafael Teixeira ([email protected])
|
||||
//
|
||||
// (C) 2002 Rafael Teixeira
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Assembly)]
|
||||
public class AboutAttribute : System.Attribute
|
||||
{
|
||||
public string Details;
|
||||
|
||||
public AboutAttribute(string details)
|
||||
{
|
||||
Details = details;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Details;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Mono.GetOptions
|
||||
{
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class ArgumentProcessorAttribute : Attribute
|
||||
{
|
||||
public ArgumentProcessorAttribute() {}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// AuthorAttribute.cs
|
||||
//
|
||||
// Author: Rafael Teixeira ([email protected])
|
||||
//
|
||||
// (C) 2002 Rafael Teixeira
|
||||
//
|
||||
using System;
|
||||
|
||||
namespace Mono
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
|
||||
public class AuthorAttribute : System.Attribute
|
||||
{
|
||||
public string Name;
|
||||
public string SubProject;
|
||||
|
||||
public AuthorAttribute(string name)
|
||||
{
|
||||
Name = name;
|
||||
SubProject = null;
|
||||
}
|
||||
|
||||
public AuthorAttribute(string name, string subProject)
|
||||
{
|
||||
Name = name;
|
||||
SubProject = subProject;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (SubProject == null)
|
||||
return Name;
|
||||
else
|
||||
return Name + " (" + SubProject + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
2002-09-03 Rafael Teixeira <[email protected]>
|
||||
|
||||
* added AboutAttribute.cs, AuthorAttribute.cs, OptionAttribute.cs,
|
||||
UsageComplementAttribute.cs, OptionDetails.cs, Options.cs.
|
||||
Now reflection is used to drive de options processing.
|
||||
|
||||
* added GetOptTest test subproject
|
||||
|
||||
2002-08-30 Juli Mallett <[email protected]>
|
||||
|
||||
* list.unix, makefile.gnu: Added build glue for UNIX.
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("GetOptTest")]
|
||||
[assembly: AssemblyDescription("Mono.GetOptions Test driver")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("(C) 2002 Rafael Teixeira")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: Mono.About("Distributed under the GPL")]
|
||||
|
||||
[assembly: Mono.UsageComplement("some strings")]
|
||||
|
||||
[assembly: Mono.Author("Rafael Teixeira")]
|
||||
[assembly: Mono.Author("Dean Scarff")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using Mono.GetOptions;
|
||||
|
||||
namespace GetOptTest
|
||||
{
|
||||
class GetOptTestOptions : Options
|
||||
{
|
||||
[Option(3, "Just a testing Parameter", 'p')]
|
||||
public string[] param = new string[] { "Default value" };
|
||||
|
||||
[Option("Just a boolean testing parameter", 't')]
|
||||
public bool turnItOn = false;
|
||||
|
||||
private bool verboseOn = false;
|
||||
|
||||
[Option("Be verbose", 'v')]
|
||||
public bool verbose
|
||||
{
|
||||
set
|
||||
{
|
||||
verboseOn = value;
|
||||
Console.WriteLine("verbose was set to : " + verboseOn);
|
||||
}
|
||||
}
|
||||
|
||||
[Option(-1, "Execute a test routine", 's', null)]
|
||||
public WhatToDoNext simpleProcedure(int dids)
|
||||
{
|
||||
Console.WriteLine("Inside simpleProcedure({0})", dids);
|
||||
return WhatToDoNext.GoAhead;
|
||||
}
|
||||
|
||||
[Option("Show usage syntax", 'u', "usage")]
|
||||
public override WhatToDoNext DoUsage()
|
||||
{
|
||||
base.DoUsage();
|
||||
return WhatToDoNext.GoAhead;
|
||||
}
|
||||
|
||||
public override WhatToDoNext DoHelp() // uses parent´s OptionAttribute as is
|
||||
{
|
||||
base.DoHelp();
|
||||
return WhatToDoNext.GoAhead;
|
||||
}
|
||||
|
||||
public GetOptTestOptions()
|
||||
{
|
||||
this.ParsingMode = OptionsParsingMode.Both;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Summary description for GetOptTester.
|
||||
/// </summary>
|
||||
class GetOptTester
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("------------ Original 'args'");
|
||||
for(int i = 0; i < args.Length; i++)
|
||||
Console.WriteLine("args[{0}] = \"{1}\"",i,args[i]);
|
||||
Console.WriteLine("----------------------------------------");
|
||||
Console.WriteLine("------------ GetOptions Processing");
|
||||
GetOptTestOptions options = new GetOptTestOptions();
|
||||
options.ProcessArgs(args);
|
||||
Console.WriteLine("----------------------------------------");
|
||||
Console.WriteLine("------------ Results");
|
||||
if (options.param != null)
|
||||
{
|
||||
Console.WriteLine("Parameters supplied for 'param' were:");
|
||||
foreach (string Parameter in options.param)
|
||||
Console.WriteLine("\t" + Parameter);
|
||||
}
|
||||
for(int i = 0; i < options.RemainingArguments.Length; i++)
|
||||
Console.WriteLine("remaining args[{0}] = \"{1}\"",i,options.RemainingArguments[i]);
|
||||
Console.WriteLine("----------------------------------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.XML"
|
||||
AssemblyName = "System.XML"
|
||||
AssemblyName = "System.Xml"
|
||||
HintPath = "..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
|
||||
/>
|
||||
</References>
|
||||
@@ -77,7 +77,31 @@
|
||||
<Files>
|
||||
<Include>
|
||||
<File
|
||||
RelPath = "AssemblyInfo.cs"
|
||||
RelPath = "AboutAttribute.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ArgumentProcessorAttribute.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "AuthorAttribute.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ChangeLog"
|
||||
BuildAction = "None"
|
||||
/>
|
||||
<File
|
||||
RelPath = "OptionAttribute.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "OptionDetails.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
@@ -86,6 +110,20 @@
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "Options.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ToDo"
|
||||
BuildAction = "Content"
|
||||
/>
|
||||
<File
|
||||
RelPath = "UsageComplementAttribute.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
using System;
|
||||
|
||||
namespace Mono.GetOptions
|
||||
{
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)]
|
||||
public class OptionAttribute : Attribute
|
||||
{
|
||||
public string ShortDescription;
|
||||
public char ShortForm;
|
||||
public string LongForm;
|
||||
public int MaxOccurs; // negative means there is no limit
|
||||
|
||||
private void SetValues(
|
||||
string shortDescription,
|
||||
char shortForm,
|
||||
string longForm,
|
||||
int maxOccurs)
|
||||
{
|
||||
ShortDescription = shortDescription;
|
||||
ShortForm = shortForm;
|
||||
LongForm = longForm;
|
||||
MaxOccurs = maxOccurs;
|
||||
}
|
||||
|
||||
public OptionAttribute(string shortDescription)
|
||||
{
|
||||
SetValues(shortDescription, ' ', string.Empty, 0);
|
||||
}
|
||||
|
||||
public OptionAttribute(string shortDescription, char shortForm)
|
||||
{
|
||||
SetValues(shortDescription, shortForm, string.Empty, 0);
|
||||
}
|
||||
|
||||
public OptionAttribute(string shortDescription, char shortForm, string longForm)
|
||||
{
|
||||
SetValues(shortDescription, shortForm, longForm, 0);
|
||||
}
|
||||
|
||||
public OptionAttribute(string shortDescription, string longForm)
|
||||
{
|
||||
SetValues(shortDescription, ' ', longForm, 0);
|
||||
}
|
||||
|
||||
public OptionAttribute(int maxOccurs, string shortDescription)
|
||||
{
|
||||
SetValues(shortDescription, ' ', string.Empty, maxOccurs);
|
||||
}
|
||||
|
||||
public OptionAttribute(int maxOccurs, string shortDescription, char shortForm)
|
||||
{
|
||||
SetValues(shortDescription, shortForm, string.Empty, maxOccurs);
|
||||
}
|
||||
|
||||
public OptionAttribute(int maxOccurs, string shortDescription, char shortForm, string longForm)
|
||||
{
|
||||
SetValues(shortDescription, shortForm, longForm, maxOccurs);
|
||||
}
|
||||
|
||||
public OptionAttribute(int maxOccurs, string shortDescription, string longForm)
|
||||
{
|
||||
SetValues(shortDescription, ' ', longForm, maxOccurs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
//
|
||||
// OptionDetails.cs
|
||||
//
|
||||
// Author: Rafael Teixeira ([email protected])
|
||||
//
|
||||
// (C) 2002 Rafael Teixeira
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Mono.GetOptions
|
||||
{
|
||||
public enum WhatToDoNext
|
||||
{
|
||||
AbandonProgram,
|
||||
GoAhead
|
||||
}
|
||||
|
||||
internal class OptionDetails : IComparable
|
||||
{
|
||||
public char ShortForm;
|
||||
public string LongForm;
|
||||
public string ShortDescription;
|
||||
public bool NeedsParameter;
|
||||
public int MaxOccurs; // negative means there is no limit
|
||||
public int Occurs;
|
||||
public Options OptionBundle;
|
||||
public MemberInfo MemberInfo;
|
||||
public ArrayList Values;
|
||||
public System.Type ParameterType;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string optionHelp;
|
||||
// TODO: Yet not that good
|
||||
optionHelp = " ";
|
||||
optionHelp += (this.ShortForm != ' ') ? "-"+this.ShortForm+" " : " ";
|
||||
optionHelp += (this.LongForm != string.Empty && this.LongForm != null) ? "--"+this.LongForm : "";
|
||||
if (NeedsParameter)
|
||||
{
|
||||
if (this.LongForm != string.Empty && this.LongForm != null)
|
||||
optionHelp += "=PARAM";
|
||||
else
|
||||
optionHelp += "PARAM";
|
||||
}
|
||||
optionHelp = optionHelp.PadRight(23) + " ";
|
||||
optionHelp += this.ShortDescription;
|
||||
return optionHelp;
|
||||
}
|
||||
|
||||
private static System.Type TypeOfMember(MemberInfo memberInfo)
|
||||
{
|
||||
if ((memberInfo.MemberType == MemberTypes.Field && memberInfo is FieldInfo))
|
||||
return ((FieldInfo)memberInfo).FieldType;
|
||||
|
||||
if ((memberInfo.MemberType == MemberTypes.Property && memberInfo is PropertyInfo))
|
||||
return ((PropertyInfo)memberInfo).PropertyType;
|
||||
|
||||
if ((memberInfo.MemberType == MemberTypes.Method && memberInfo is MethodInfo))
|
||||
{
|
||||
if (((MethodInfo)memberInfo).ReturnType.FullName != typeof(WhatToDoNext).FullName)
|
||||
throw new NotSupportedException("Option method must return '" + typeof(WhatToDoNext).FullName + "'");
|
||||
|
||||
ParameterInfo[] parameters = ((MethodInfo)memberInfo).GetParameters();
|
||||
if ((parameters == null) || (parameters.Length == 0))
|
||||
return null;
|
||||
else
|
||||
return parameters[0].ParameterType;
|
||||
}
|
||||
|
||||
throw new NotSupportedException("'" + memberInfo.MemberType + "' memberType is not supportted");
|
||||
}
|
||||
|
||||
public OptionDetails(MemberInfo memberInfo, OptionAttribute option, Options optionBundle)
|
||||
{
|
||||
this.ShortForm = option.ShortForm;
|
||||
this.LongForm = (option.LongForm == string.Empty)? memberInfo.Name:option.LongForm;
|
||||
this.ShortDescription = option.ShortDescription;
|
||||
this.Occurs = 0;
|
||||
this.OptionBundle = optionBundle;
|
||||
this.MemberInfo = memberInfo;
|
||||
this.NeedsParameter = false;
|
||||
this.Values = null;
|
||||
this.MaxOccurs = 1;
|
||||
this.ParameterType = TypeOfMember(memberInfo);
|
||||
|
||||
if (this.ParameterType != null && this.ParameterType.FullName != "System.Boolean")
|
||||
{
|
||||
this.NeedsParameter = true;
|
||||
if (this.ParameterType.IsArray)
|
||||
{
|
||||
this.Values = new ArrayList();
|
||||
this.MaxOccurs = option.MaxOccurs;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.MemberInfo is MethodInfo)
|
||||
this.MaxOccurs = option.MaxOccurs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal string Key
|
||||
{
|
||||
get { return ((this.ShortForm != ' ') ? this.ShortForm + "" : "") + this.LongForm; }
|
||||
}
|
||||
|
||||
int IComparable.CompareTo(object other)
|
||||
{
|
||||
return Key.CompareTo(((OptionDetails)other).Key);
|
||||
}
|
||||
|
||||
public void TransferValues()
|
||||
{
|
||||
if (Values != null)
|
||||
{
|
||||
if (MemberInfo is FieldInfo)
|
||||
{
|
||||
((FieldInfo)MemberInfo).SetValue(OptionBundle, Values.ToArray(ParameterType.GetElementType()));
|
||||
return;
|
||||
}
|
||||
|
||||
if (MemberInfo is PropertyInfo)
|
||||
{
|
||||
((PropertyInfo)MemberInfo).SetValue(OptionBundle, Values.ToArray(ParameterType.GetElementType()), null);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((WhatToDoNext)((MethodInfo)MemberInfo).Invoke(OptionBundle, new object[] { Values.ToArray(ParameterType.GetElementType()) }) == WhatToDoNext.AbandonProgram)
|
||||
System.Environment.Exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private void DoIt(string parameter)
|
||||
{
|
||||
Occurs++;
|
||||
|
||||
if (MaxOccurs > 0 && Occurs > MaxOccurs)
|
||||
throw new IndexOutOfRangeException("Option " + ShortForm + " can be used at most " + MaxOccurs + " times");
|
||||
|
||||
if (!NeedsParameter)
|
||||
{
|
||||
if (MemberInfo is FieldInfo)
|
||||
{
|
||||
((FieldInfo)MemberInfo).SetValue(OptionBundle, true);
|
||||
return;
|
||||
}
|
||||
if (MemberInfo is PropertyInfo)
|
||||
{
|
||||
((PropertyInfo)MemberInfo).SetValue(OptionBundle, true, null);
|
||||
return;
|
||||
}
|
||||
if ((WhatToDoNext)((MethodInfo)MemberInfo).Invoke(OptionBundle, null) == WhatToDoNext.AbandonProgram)
|
||||
System.Environment.Exit(1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
object convertedParameter = null;
|
||||
|
||||
if (Values != null && parameter != null)
|
||||
{
|
||||
convertedParameter = Convert.ChangeType(parameter, ParameterType.GetElementType());
|
||||
Values.Add(convertedParameter);
|
||||
return;
|
||||
}
|
||||
|
||||
if (parameter != null)
|
||||
convertedParameter = Convert.ChangeType(parameter, ParameterType);
|
||||
|
||||
if (MemberInfo is FieldInfo)
|
||||
{
|
||||
((FieldInfo)MemberInfo).SetValue(OptionBundle, convertedParameter);
|
||||
return;
|
||||
}
|
||||
|
||||
if (MemberInfo is PropertyInfo)
|
||||
{
|
||||
((PropertyInfo)MemberInfo).SetValue(OptionBundle, convertedParameter, null);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((WhatToDoNext)((MethodInfo)MemberInfo).Invoke(OptionBundle, new object[] { convertedParameter }) == WhatToDoNext.AbandonProgram)
|
||||
System.Environment.Exit(1);
|
||||
}
|
||||
|
||||
public bool ProcessArgument(string arg, string nextArg)
|
||||
{
|
||||
if (arg == ("-" + ShortForm) || arg == ("--" + LongForm))
|
||||
{
|
||||
DoIt(nextArg);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
//
|
||||
// OptionList.cs
|
||||
//
|
||||
// Author: Rafael Teixeira ([email protected])
|
||||
// Author: Rafael Teixeira ([email protected]) (original)
|
||||
// Author: Dean Scarff ([email protected]) (modifications)
|
||||
//
|
||||
// (C) 2002 Rafael Teixeira
|
||||
// Modifications (C) 2002 Dean Scarff, distributed under the Gnu General Public License Version 2 or later
|
||||
//
|
||||
|
||||
using System;
|
||||
@@ -13,80 +15,62 @@ using System.Reflection;
|
||||
|
||||
namespace Mono.GetOptions
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple=true)]
|
||||
public class AuthorAttribute : System.Attribute
|
||||
{
|
||||
public string Name;
|
||||
public string SubProject;
|
||||
|
||||
public AuthorAttribute(string Name)
|
||||
{
|
||||
this.Name = Name;
|
||||
this.SubProject = null;
|
||||
}
|
||||
|
||||
public AuthorAttribute(string Name, string SubProject)
|
||||
{
|
||||
this.Name = Name;
|
||||
this.SubProject = SubProject;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (SubProject == null)
|
||||
return Name;
|
||||
else
|
||||
return Name + " (" + SubProject + ")";
|
||||
}
|
||||
[Flags]
|
||||
public enum OptionsParsingMode
|
||||
{
|
||||
Linux = 1,
|
||||
Windows = 2,
|
||||
Both = 3
|
||||
}
|
||||
|
||||
enum OptionParameterType
|
||||
{
|
||||
None,
|
||||
Integer,
|
||||
Decimal, // look XML Schemas for better names
|
||||
String,
|
||||
Symbol,
|
||||
FilePath,
|
||||
FileMask,
|
||||
AssemblyName,
|
||||
AssemblyFileName,
|
||||
AssemblyNameOrFileName
|
||||
}
|
||||
|
||||
public delegate bool OptionFound(object Value);
|
||||
|
||||
/// <summary>
|
||||
/// Summary description for Class1.
|
||||
/// Option Parsing
|
||||
/// </summary>
|
||||
public class OptionList
|
||||
{
|
||||
struct OptionDetails
|
||||
{
|
||||
public char ShortForm;
|
||||
public string LongForm;
|
||||
public string ShortDescription;
|
||||
public OptionParameterType ParameterType;
|
||||
public int MinOccurs;
|
||||
public int MaxOccurs; // negative means there is no limit
|
||||
public object DefaultValue;
|
||||
public OptionFound Dispatcher;
|
||||
|
||||
}
|
||||
|
||||
private Options optionBundle = null;
|
||||
private OptionsParsingMode parsingMode;
|
||||
private bool endOptionProcessingWithDoubleDash;
|
||||
|
||||
private string appExeName;
|
||||
private string appVersion;
|
||||
|
||||
private string appTitle = "Add a [assembly: AssemblyTitle(\"Here goes the application name\")] to your assembly";
|
||||
private string appCopyright = "Add a [assembly: AssemblyCopyright(\"(c)200n Here goes the copyright holder name\")] to your assembly";
|
||||
private string appDescription = "Add a [assembly: AssemblyDescription(\"Here goes the short description\")] to your assembly";
|
||||
private string appAboutDetails = "Add a [assembly: Mono.About(\"Here goes the short about details\")] to your assembly";
|
||||
private string appUsageComplement = "Add a [assembly: Mono.UsageComplement(\"Here goes the usage clause complement\")] to your assembly";
|
||||
private string[] appAuthors;
|
||||
|
||||
public readonly string usageFormat;
|
||||
public readonly string aboutDetails;
|
||||
private ArrayList list = new ArrayList();
|
||||
private ArrayList arguments = new ArrayList();
|
||||
private ArrayList argumentsTail = new ArrayList();
|
||||
private MethodInfo argumentProcessor = null;
|
||||
|
||||
private SortedList list = new SortedList();
|
||||
public string Usage
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Usage: " + appExeName + " [options] " + appUsageComplement;
|
||||
}
|
||||
}
|
||||
|
||||
public string AboutDetails
|
||||
{
|
||||
get
|
||||
{
|
||||
return appAboutDetails;
|
||||
}
|
||||
}
|
||||
|
||||
#region Assembly Attributes
|
||||
|
||||
Assembly entry;
|
||||
|
||||
private object[] GetAssemblyAttributes(Type type)
|
||||
{
|
||||
Assembly entry = Assembly.GetEntryAssembly();
|
||||
return entry.GetCustomAttributes(type, false);
|
||||
}
|
||||
|
||||
@@ -111,99 +95,273 @@ namespace Mono.GetOptions
|
||||
object[] result = GetAssemblyAttributes(type);
|
||||
|
||||
if ((result != null) && (result.Length > 0))
|
||||
var = (string)(string)type.InvokeMember(propertyName, BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty | BindingFlags.Instance, null, result[0], new object [] {}); ;
|
||||
var = (string)type.InvokeMember(propertyName, BindingFlags.Public | BindingFlags.GetField | BindingFlags.GetProperty | BindingFlags.Instance, null, result[0], new object [] {}); ;
|
||||
}
|
||||
|
||||
public OptionList(string aboutDetails, string usageFormat)
|
||||
private void GetAssemblyAttributeValue(Type type, ref string var)
|
||||
{
|
||||
this.aboutDetails = aboutDetails;
|
||||
this.usageFormat = usageFormat;
|
||||
object[] result = GetAssemblyAttributes(type);
|
||||
|
||||
if ((result != null) && (result.Length > 0))
|
||||
var = result[0].ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
private void AddArgumentProcessor(MemberInfo memberInfo)
|
||||
{
|
||||
if (argumentProcessor != null)
|
||||
throw new NotSupportedException("More than one argument processor method found");
|
||||
|
||||
if ((memberInfo.MemberType == MemberTypes.Method && memberInfo is MethodInfo))
|
||||
{
|
||||
if (((MethodInfo)memberInfo).ReturnType.FullName != typeof(void).FullName)
|
||||
throw new NotSupportedException("Argument processor method must return 'void'");
|
||||
|
||||
ParameterInfo[] parameters = ((MethodInfo)memberInfo).GetParameters();
|
||||
if ((parameters == null) || (parameters.Length != 1) || (parameters[0].ParameterType.FullName != typeof(string).FullName))
|
||||
throw new NotSupportedException("Argument processor method must have a string parameter");
|
||||
|
||||
argumentProcessor = (MethodInfo)memberInfo;
|
||||
}
|
||||
else
|
||||
throw new NotSupportedException("Argument processor marked member isn't a method");
|
||||
}
|
||||
|
||||
private void Initialize(Options optionBundle)
|
||||
{
|
||||
if (optionBundle == null)
|
||||
throw new ArgumentNullException("optionBundle");
|
||||
|
||||
entry = Assembly.GetEntryAssembly();
|
||||
appExeName = entry.GetName().Name;
|
||||
appVersion = entry.GetName().Version.ToString();
|
||||
|
||||
this.optionBundle = optionBundle;
|
||||
this.parsingMode = optionBundle.ParsingMode ;
|
||||
this.endOptionProcessingWithDoubleDash = optionBundle.EndOptionProcessingWithDoubleDash;
|
||||
|
||||
GetAssemblyAttributeValue(typeof(AssemblyTitleAttribute), "Title", ref appTitle);
|
||||
GetAssemblyAttributeValue(typeof(AssemblyCopyrightAttribute), "Copyright", ref appCopyright);
|
||||
GetAssemblyAttributeValue(typeof(AssemblyDescriptionAttribute), "Description", ref appDescription);
|
||||
GetAssemblyAttributeValue(typeof(Mono.AboutAttribute), ref appAboutDetails);
|
||||
GetAssemblyAttributeValue(typeof(Mono.UsageComplementAttribute), ref appUsageComplement);
|
||||
appAuthors = GetAssemblyAttributeStrings(typeof(AuthorAttribute));
|
||||
if (appAuthors.Length == 0)
|
||||
{
|
||||
appAuthors = new String[1];
|
||||
appAuthors[0] = "Add one or more [assembly: Mono.GetOptions.Author(\"Here goes the author name\")] to your assembly";
|
||||
}
|
||||
|
||||
foreach(MemberInfo mi in optionBundle.GetType().GetMembers())
|
||||
{
|
||||
object[] attribs = mi.GetCustomAttributes(typeof(OptionAttribute), true);
|
||||
if (attribs != null && attribs.Length > 0)
|
||||
list.Add(new OptionDetails(mi, (OptionAttribute)attribs[0], optionBundle));
|
||||
else
|
||||
{
|
||||
attribs = mi.GetCustomAttributes(typeof(ArgumentProcessorAttribute), true);
|
||||
if (attribs != null && attribs.Length > 0)
|
||||
AddArgumentProcessor(mi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddGenericOption(
|
||||
char shortForm,
|
||||
string longForm,
|
||||
string shortDescription,
|
||||
OptionParameterType parameterType,
|
||||
int minOccurs,
|
||||
int maxOccurs,
|
||||
object defaultValue,
|
||||
OptionFound dispatcher)
|
||||
public OptionList(Options optionBundle)
|
||||
{
|
||||
OptionDetails option = new OptionDetails();
|
||||
|
||||
option.ShortForm = shortForm;
|
||||
option.LongForm = longForm;
|
||||
option.ShortDescription = shortDescription;
|
||||
option.ParameterType = parameterType;
|
||||
option.MinOccurs = minOccurs;
|
||||
option.MaxOccurs = maxOccurs;
|
||||
option.DefaultValue = defaultValue;
|
||||
option.Dispatcher = dispatcher;
|
||||
|
||||
if (shortForm == ' ')
|
||||
list.Add(longForm, option);
|
||||
else
|
||||
list.Add(shortForm.ToString(), option);
|
||||
Initialize(optionBundle);
|
||||
}
|
||||
|
||||
public void AddAbout(char shortForm, string longForm, string shortDescription)
|
||||
{
|
||||
AddGenericOption(shortForm, longForm, shortDescription, OptionParameterType.None, 0, 1, null, new OptionFound(DoAbout));
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void AddBooleanSwitch(char shortForm, string longForm, string shortDescription, bool defaultValue, OptionFound switcher)
|
||||
{
|
||||
AddGenericOption(shortForm, longForm, shortDescription, OptionParameterType.None, 0, 1, defaultValue, switcher);
|
||||
}
|
||||
#region Prebuilt Options
|
||||
|
||||
public void ShowAbout()
|
||||
private void ShowTitleLines()
|
||||
{
|
||||
Console.WriteLine(appTitle + " - " + appCopyright);
|
||||
Console.WriteLine(appTitle + " " + appVersion + " - " + appCopyright);
|
||||
Console.WriteLine(appDescription);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine(aboutDetails);
|
||||
}
|
||||
|
||||
private void ShowAbout()
|
||||
{
|
||||
ShowTitleLines();
|
||||
Console.WriteLine(appAboutDetails);
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Authors:");
|
||||
foreach(string s in appAuthors)
|
||||
Console.WriteLine ("\t" + s);
|
||||
}
|
||||
|
||||
private bool DoAbout(object nothing)
|
||||
private void ShowHelp()
|
||||
{
|
||||
ShowAbout();
|
||||
return true;
|
||||
ShowTitleLines();
|
||||
Console.WriteLine(Usage);
|
||||
Console.WriteLine("Options:");
|
||||
foreach (OptionDetails option in list)
|
||||
Console.WriteLine(option);
|
||||
}
|
||||
|
||||
public void ShowUsage()
|
||||
private void ShowUsage()
|
||||
{
|
||||
Console.WriteLine(appTitle + " - " + appCopyright);
|
||||
Console.Write("Usage: ");
|
||||
Console.WriteLine(usageFormat);
|
||||
// TODO: list registered options here
|
||||
foreach (DictionaryEntry option in list)
|
||||
Console.WriteLine(option.Value.ToString());
|
||||
Console.WriteLine(Usage);
|
||||
Console.Write("Short Options: ");
|
||||
foreach (OptionDetails option in list)
|
||||
Console.Write((option.ShortForm != ' ') ? option.ShortForm.ToString() : "");
|
||||
Console.WriteLine();
|
||||
|
||||
}
|
||||
|
||||
public void ShowUsage(string errorMessage)
|
||||
private void ShowUsage(string errorMessage)
|
||||
{
|
||||
Console.WriteLine(errorMessage);
|
||||
Console.WriteLine("ERROR: " + errorMessage.TrimEnd());
|
||||
ShowUsage();
|
||||
}
|
||||
|
||||
public void ProcessArgs(string[] args)
|
||||
internal WhatToDoNext DoUsage()
|
||||
{
|
||||
ShowUsage();
|
||||
return WhatToDoNext.AbandonProgram;
|
||||
}
|
||||
|
||||
internal WhatToDoNext DoAbout()
|
||||
{
|
||||
ShowAbout();
|
||||
return WhatToDoNext.GoAhead;
|
||||
}
|
||||
|
||||
internal WhatToDoNext DoHelp()
|
||||
{
|
||||
ShowHelp();
|
||||
return WhatToDoNext.AbandonProgram;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Arguments Processing
|
||||
|
||||
public string[] NormalizeArgs(string[] args)
|
||||
{
|
||||
bool ParsingOptions = true;
|
||||
ArrayList result = new ArrayList();
|
||||
|
||||
foreach(string arg in args)
|
||||
{
|
||||
if (ParsingOptions)
|
||||
{
|
||||
if (endOptionProcessingWithDoubleDash && (arg == "--"))
|
||||
{
|
||||
ParsingOptions = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((parsingMode & OptionsParsingMode.Windows) > 0)
|
||||
{
|
||||
if ((arg.Length == 2) && (arg[0] == '/')) // Windows options only come in this fashion
|
||||
{
|
||||
result.Add("-" + arg[1]); // translate to Linux style
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ((parsingMode & OptionsParsingMode.Linux) > 0)
|
||||
{
|
||||
if ((arg[0] == '-') && (arg[1] != '-'))
|
||||
{
|
||||
foreach(char c in arg.Substring(1)) // many single-letter options
|
||||
result.Add("-" + c); // expand into individualized options
|
||||
continue;
|
||||
}
|
||||
|
||||
if (arg.StartsWith("--"))
|
||||
{
|
||||
result.AddRange(arg.Split('=')); // put in the same form of one-letter options with a parameter
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
argumentsTail.Add(arg);
|
||||
continue;
|
||||
}
|
||||
|
||||
// if nothing else matches then it get here
|
||||
result.Add(arg);
|
||||
}
|
||||
|
||||
return (string[])result.ToArray(typeof(string));
|
||||
}
|
||||
|
||||
public string[] ProcessArgs(string[] args)
|
||||
{
|
||||
string arg;
|
||||
string nextArg;
|
||||
bool OptionWasProcessed;
|
||||
|
||||
list.Sort();
|
||||
|
||||
args = NormalizeArgs(args);
|
||||
|
||||
try
|
||||
{
|
||||
int argc = args.Length;
|
||||
for(int i = 0; i < argc; i++)
|
||||
{
|
||||
arg = args[i];
|
||||
if (i+1 < argc)
|
||||
{
|
||||
nextArg = args[i+1];
|
||||
if (nextArg.StartsWith("-"))
|
||||
nextArg = null;
|
||||
}
|
||||
else
|
||||
nextArg = null;
|
||||
|
||||
OptionWasProcessed = false;
|
||||
|
||||
if (arg.StartsWith("-"))
|
||||
{
|
||||
foreach(OptionDetails option in list)
|
||||
{
|
||||
if (option.ProcessArgument(arg, nextArg))
|
||||
{
|
||||
OptionWasProcessed = true;
|
||||
if (nextArg != null)
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!OptionWasProcessed)
|
||||
arguments.Add(arg);
|
||||
}
|
||||
|
||||
foreach(OptionDetails option in list)
|
||||
option.TransferValues();
|
||||
|
||||
foreach(string argument in argumentsTail)
|
||||
arguments.Add(argument);
|
||||
|
||||
if (argumentProcessor == null)
|
||||
return (string[])arguments.ToArray(typeof(string));
|
||||
|
||||
foreach(string argument in arguments)
|
||||
argumentProcessor.Invoke(optionBundle, new object[] { argument });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowUsage(ex.Message);
|
||||
System.Environment.Exit(1);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Mono.GetOptions
|
||||
{
|
||||
public class Options
|
||||
{
|
||||
public OptionsParsingMode ParsingMode;
|
||||
public bool EndOptionProcessingWithDoubleDash;
|
||||
|
||||
private OptionList optionParser;
|
||||
|
||||
public string[] RemainingArguments;
|
||||
|
||||
public Options()
|
||||
{
|
||||
ParsingMode = OptionsParsingMode.Both;
|
||||
EndOptionProcessingWithDoubleDash = true;
|
||||
}
|
||||
|
||||
public void ProcessArgs(string[] args)
|
||||
{
|
||||
optionParser = new OptionList(this);
|
||||
RemainingArguments = optionParser.ProcessArgs(args);
|
||||
}
|
||||
|
||||
[Option("Show this help list", '?',"help")]
|
||||
public virtual WhatToDoNext DoHelp()
|
||||
{
|
||||
return optionParser.DoHelp();
|
||||
}
|
||||
|
||||
[Option("Display version and licensing information", 'V',"version")]
|
||||
public virtual WhatToDoNext DoAbout()
|
||||
{
|
||||
return optionParser.DoAbout();
|
||||
}
|
||||
|
||||
[Option("Show usage syntax and exit", ' ',"usage")]
|
||||
public virtual WhatToDoNext DoUsage()
|
||||
{
|
||||
return optionParser.DoUsage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// UsageComplementAttribute.cs
|
||||
//
|
||||
// Author: Rafael Teixeira ([email protected])
|
||||
//
|
||||
// (C) 2002 Rafael Teixeira
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Assembly)]
|
||||
public class UsageComplementAttribute : System.Attribute
|
||||
{
|
||||
public string Details;
|
||||
|
||||
public UsageComplementAttribute(string details)
|
||||
{
|
||||
Details = details;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Details;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
AssemblyInfo.cs
|
||||
AboutAttribute.cs
|
||||
AuthorAttribute.cs
|
||||
OptionAttribute.cs
|
||||
UsageComplementAttribute.cs
|
||||
OptionList.cs
|
||||
OptionDetails.cs
|
||||
Options.cs
|
||||
@@ -0,0 +1,13 @@
|
||||
topdir = ../..
|
||||
|
||||
LIBRARY = $(topdir)/class/lib/Mono.GetOptions.dll
|
||||
|
||||
LIB_LIST = list.unix
|
||||
LIB_FLAGS = -r System.Data -r System.Xml
|
||||
|
||||
SOURCES_INCLUDE=*.cs
|
||||
|
||||
|
||||
export MONO_PATH_PREFIX = $(topdir)/class/lib:
|
||||
|
||||
include $(topdir)/class/library.make
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public class BadImageException : Exception {
|
||||
|
||||
public BadImageException() : base()
|
||||
{
|
||||
}
|
||||
|
||||
public BadImageException(string msg) : base(msg)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
/// <summary>
|
||||
/// IMAGE_FILE_HEADER
|
||||
/// </summary>
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct COFFHeader {
|
||||
|
||||
internal MachineId machine;
|
||||
internal short sections;
|
||||
internal uint tdStampRaw;
|
||||
internal uint symTabPtr;
|
||||
internal uint numSymbols;
|
||||
internal short optHeaderSize;
|
||||
internal Characteristics characteristics;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Machine identifier.
|
||||
/// </summary>
|
||||
public MachineId Machine {
|
||||
get {
|
||||
return machine;
|
||||
}
|
||||
set {
|
||||
machine = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public short NumberOfSections {
|
||||
get {
|
||||
return sections;
|
||||
}
|
||||
set {
|
||||
sections = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public uint TimeDateStamp {
|
||||
get {
|
||||
return tdStampRaw;
|
||||
}
|
||||
set {
|
||||
tdStampRaw = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public DateTime TimeStamp {
|
||||
get {
|
||||
return (new DateTime(1970, 1, 1) +
|
||||
TimeSpan.FromSeconds(tdStampRaw)).ToLocalTime();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public uint PointerToSymbolTable {
|
||||
get {
|
||||
return symTabPtr;
|
||||
}
|
||||
set {
|
||||
symTabPtr = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public uint NumberOfSymbols {
|
||||
get {
|
||||
return numSymbols;
|
||||
}
|
||||
set {
|
||||
numSymbols = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public short SizeOfOptionalHeader {
|
||||
get {
|
||||
return optHeaderSize;
|
||||
}
|
||||
set {
|
||||
optHeaderSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public Characteristics Characteristics {
|
||||
get {
|
||||
return characteristics;
|
||||
}
|
||||
set {
|
||||
characteristics = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
unsafe public void Read(BinaryReader reader) {
|
||||
fixed (void* pThis = &this) {
|
||||
PEUtils.ReadStruct(reader, pThis, sizeof (COFFHeader), typeof (COFFHeader));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
writer.WriteLine(
|
||||
"Machine ID : {0}" + Environment.NewLine +
|
||||
"Sections : {1}" + Environment.NewLine +
|
||||
"timestamp : {2}" + Environment.NewLine +
|
||||
"Characteristics : {3}" + Environment.NewLine,
|
||||
machine, sections,
|
||||
TimeStamp + " (" + tdStampRaw.ToString("X") + ")",
|
||||
characteristics + " (0x" + characteristics.ToString("X") + ")"
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
Dump(sw);
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
[Flags]
|
||||
public enum Characteristics : ushort {
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Relocation info stripped from file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_RELOCS_STRIPPED
|
||||
/// </remarks>
|
||||
RELOCS_STRIPPED = 0x0001,
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// File is executable
|
||||
/// (i.e. file is neither object file nor library file,
|
||||
/// so there are no unresolved externel references).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_EXECUTABLE_IMAGE
|
||||
/// </remarks>
|
||||
EXECUTABLE_IMAGE = 0x0002,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Line nunbers stripped from file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_LINE_NUMS_STRIPPED
|
||||
/// </remarks>
|
||||
LINE_NUMS_STRIPPED = 0x0004,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Local symbols stripped from file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_LOCAL_SYMS_STRIPPED
|
||||
/// </remarks>
|
||||
LOCAL_SYMS_STRIPPED = 0x0008,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Agressively trim working set
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_AGGRESIVE_WS_TRIM
|
||||
/// </remarks>
|
||||
AGGRESIVE_WS_TRIM = 0x0010,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// App can handle >2gb addresses
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_LARGE_ADDRESS_AWARE
|
||||
/// </remarks>
|
||||
LARGE_ADDRESS_AWARE = 0x0020,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Bytes of machine word are reversed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_BYTES_REVERSED_LO
|
||||
/// </remarks>
|
||||
BYTES_REVERSED_LO = 0x0080,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 32 bit word machine.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_32BIT_MACHINE
|
||||
/// </remarks>
|
||||
MACHINE_32BIT = 0x0100,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Debugging info stripped from file in .DBG file
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_DEBUG_STRIPPED
|
||||
/// </remarks>
|
||||
DEBUG_STRIPPED = 0x0200,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// If Image is on removable media, copy and run from the swap file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
|
||||
/// </remarks>
|
||||
REMOVABLE_RUN_FROM_SWAP = 0x0400,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// If Image is on Net, copy and run from the swap file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_NET_RUN_FROM_SWAP
|
||||
/// </remarks>
|
||||
NET_RUN_FROM_SWAP = 0x0800,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This flag is used to indicate that the file
|
||||
/// is a system sile, such as device driver.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_SYSTEM
|
||||
/// </remarks>
|
||||
SYSTEM = 0x1000,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This flag indicates that the file
|
||||
/// is a dynamic library (DLL).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_DLL
|
||||
/// </remarks>
|
||||
DLL = 0x2000,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// File should only be run on a uni-processor (UP) machine.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_UP_SYSTEM_ONLY
|
||||
/// </remarks>
|
||||
UP_SYSTEM_ONLY = 0x4000,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Bytes of machine word are reversed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_BYTES_REVERSED_HI
|
||||
/// </remarks>
|
||||
BYTES_REVERSED_HI = 0x8000,
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Default flags that must be set in CIL-only image.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See Partition II, 24.2.2.1
|
||||
/// </remarks>
|
||||
CIL_DEFAULT = LINE_NUMS_STRIPPED |
|
||||
LOCAL_SYMS_STRIPPED |
|
||||
DEBUG_STRIPPED
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
// see http://cvs.winehq.com/cvsweb/wine/dlls/imagehlp/modify.c
|
||||
// starting from Revision 1.8
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public sealed class CheckSum {
|
||||
|
||||
private CheckSum()
|
||||
{
|
||||
// Never instantiated.
|
||||
}
|
||||
|
||||
|
||||
public static uint Calc(string peFile)
|
||||
{
|
||||
uint res = 0;
|
||||
|
||||
FileInfo pe = new FileInfo(peFile);
|
||||
if (!pe.Exists) {
|
||||
throw new Exception("CheckSum : Invalid file path.");
|
||||
}
|
||||
|
||||
using (BinaryReader reader = new BinaryReader(pe.OpenRead())) {
|
||||
if (!reader.BaseStream.CanSeek) {
|
||||
throw new Exception("Can't seek.");
|
||||
}
|
||||
|
||||
DOSHeader dosHdr = new DOSHeader();
|
||||
COFFHeader coffHdr = new COFFHeader();
|
||||
PEHeader peHdr = new PEHeader();
|
||||
|
||||
dosHdr.Read (reader);
|
||||
reader.BaseStream.Position = dosHdr.lfanew;
|
||||
ExeSignature peSig = (ExeSignature) reader.ReadUInt16();
|
||||
if (peSig != ExeSignature.NT) {
|
||||
throw new BadImageException("Checksum : Invalid image format, cannot find PE signature.");
|
||||
}
|
||||
|
||||
peSig = (ExeSignature) reader.ReadUInt16();
|
||||
if (peSig != ExeSignature.NT2) {
|
||||
throw new BadImageException("Checksum : Invalid image format, cannot find PE signature.");
|
||||
}
|
||||
|
||||
coffHdr.Read(reader);
|
||||
peHdr.Read(reader);
|
||||
|
||||
uint oldSum = peHdr.CheckSum;
|
||||
reader.BaseStream.Position = 0;
|
||||
long len = pe.Length;
|
||||
long whole = len >> 1;
|
||||
uint sum = 0;
|
||||
uint hi, lo;
|
||||
for (long i = whole; --i >= 0;) {
|
||||
sum += reader.ReadUInt16();
|
||||
hi = sum >> 16;
|
||||
if (hi != 0) {
|
||||
sum = hi + (sum & 0xFFFF);
|
||||
}
|
||||
}
|
||||
if ((len & 1L) != 0) {
|
||||
sum += (uint) reader.ReadByte();
|
||||
hi = sum >> 16;
|
||||
if (hi != 0) {
|
||||
sum = hi + (sum & 0xFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
// fix low word of checksum
|
||||
lo = oldSum & 0xFFFF;
|
||||
if ((sum & 0xFFFF) >= lo) {
|
||||
sum -= lo;
|
||||
} else {
|
||||
sum = (((sum & 0xFFFF) - lo) & 0xFFFF) - 1;
|
||||
}
|
||||
|
||||
// fix high word of checksum
|
||||
hi = oldSum >> 16;
|
||||
if ((sum & 0xFFFF) >= hi) {
|
||||
sum -= hi;
|
||||
} else {
|
||||
sum = (((sum & 0xFFFF) - hi) & 0xFFFF) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Mono.PEToolkit.Metadata;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
[Flags]
|
||||
public enum CorFlags : uint {
|
||||
/// <summary>
|
||||
/// COMIMAGE_FLAGS_ILONLY
|
||||
/// </summary>
|
||||
ILONLY = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// COMIMAGE_FLAGS_32BITREQUIRED
|
||||
/// </summary>
|
||||
REQUIRED_32BIT = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// COMIMAGE_FLAGS_IL_LIBRARY
|
||||
/// </summary>
|
||||
IL_LIBRARY = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// COMIMAGE_FLAGS_TRACKDEBUGDATA
|
||||
/// </summary>
|
||||
TRACKDEBUGDATA = 0x00010000,
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// CLR 2.0 header structure.
|
||||
/// IMAGE_COR20_HEADER
|
||||
/// </summary>
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct CorHeader {
|
||||
// Header versioning
|
||||
internal uint cb;
|
||||
internal short runtimeMaj;
|
||||
internal short runtimeMin;
|
||||
|
||||
// Symbol table and startup information.
|
||||
internal DataDir meta;
|
||||
internal CorFlags flags;
|
||||
internal uint entryTok;
|
||||
|
||||
// Binding information.
|
||||
internal DataDir rsrc;
|
||||
internal DataDir strongSig;
|
||||
|
||||
// Regular fixup and binding information.
|
||||
internal DataDir codeManTab;
|
||||
internal DataDir vtab;
|
||||
internal DataDir jumps;
|
||||
|
||||
// Managed Native Code.
|
||||
internal DataDir eeInfo;
|
||||
internal DataDir helper;
|
||||
internal DataDir dynInfo;
|
||||
internal DataDir delayInfo;
|
||||
internal DataDir modImg;
|
||||
internal DataDir extFixups;
|
||||
internal DataDir ridMap;
|
||||
internal DataDir dbgMap;
|
||||
|
||||
// obsolete?
|
||||
internal DataDir ipMap;
|
||||
|
||||
|
||||
//
|
||||
// Accessors
|
||||
//
|
||||
|
||||
public uint Size {
|
||||
get {
|
||||
return cb;
|
||||
}
|
||||
set {
|
||||
cb = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MajorRuntimeVersion {
|
||||
get {
|
||||
return runtimeMaj;
|
||||
}
|
||||
set {
|
||||
runtimeMaj = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MinorRuntimeVersion {
|
||||
get {
|
||||
return runtimeMin;
|
||||
}
|
||||
set {
|
||||
runtimeMin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string RuntimeVersion {
|
||||
get {
|
||||
return String.Format("{0}.{1}", runtimeMaj, runtimeMin);
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir MetaData {
|
||||
get {
|
||||
return meta;
|
||||
}
|
||||
set {
|
||||
meta = value;
|
||||
}
|
||||
}
|
||||
|
||||
public CorFlags Flags {
|
||||
get {
|
||||
return flags;
|
||||
}
|
||||
set {
|
||||
flags = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MDToken EntryPointToken {
|
||||
get {
|
||||
return entryTok;
|
||||
}
|
||||
set {
|
||||
entryTok = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir Resources {
|
||||
get {
|
||||
return rsrc;
|
||||
}
|
||||
set {
|
||||
rsrc = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir StrongNameSignature {
|
||||
get {
|
||||
return strongSig;
|
||||
}
|
||||
set {
|
||||
strongSig = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir CodeManagerTable {
|
||||
get {
|
||||
return codeManTab;
|
||||
}
|
||||
set {
|
||||
codeManTab = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir VTableFixups {
|
||||
get {
|
||||
return vtab;
|
||||
}
|
||||
set {
|
||||
vtab = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir ExportAddressTableJumps {
|
||||
get {
|
||||
return jumps;
|
||||
}
|
||||
set {
|
||||
jumps = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DataDir EEInfoTable {
|
||||
get {
|
||||
return eeInfo;
|
||||
}
|
||||
set {
|
||||
eeInfo = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir HelperTable {
|
||||
get {
|
||||
return helper;
|
||||
}
|
||||
set {
|
||||
helper = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir DynamicInfo {
|
||||
get {
|
||||
return dynInfo;
|
||||
}
|
||||
set {
|
||||
dynInfo = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir DelayLoadInfo {
|
||||
get {
|
||||
return delayInfo;
|
||||
}
|
||||
set {
|
||||
delayInfo = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir ModuleImage {
|
||||
get {
|
||||
return modImg;
|
||||
}
|
||||
set {
|
||||
modImg = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir ExternalFixups {
|
||||
get {
|
||||
return extFixups;
|
||||
}
|
||||
set {
|
||||
extFixups = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir RidMap {
|
||||
get {
|
||||
return ridMap;
|
||||
}
|
||||
set {
|
||||
ridMap = value;
|
||||
}
|
||||
}
|
||||
|
||||
public DataDir DebugMap {
|
||||
get {
|
||||
return dbgMap;
|
||||
}
|
||||
set {
|
||||
dbgMap = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public DataDir IPMap {
|
||||
get {
|
||||
return ipMap;
|
||||
}
|
||||
set {
|
||||
ipMap = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsafe public void Read(BinaryReader reader)
|
||||
{
|
||||
// TODO: clear structure before reading to initialize/reset
|
||||
// unused fields. initblk would be great.
|
||||
|
||||
// Read exactly the number of bytes as specified in the header.
|
||||
// This number is duplicated in PEHeader::CLIHdrDir.
|
||||
cb = reader.ReadUInt32();
|
||||
if (cb > sizeof(uint)) {
|
||||
fixed (void* ptr = &this.runtimeMaj, pThis = &this) {
|
||||
PEUtils.ReadStruct(reader, ptr, (int)cb - sizeof (uint));
|
||||
if (!System.BitConverter.IsLittleEndian) {
|
||||
// fix entries on big-endian machine
|
||||
// preserving cb
|
||||
uint oldcb = cb;
|
||||
PEUtils.ChangeStructEndianess(pThis, typeof (CorHeader));
|
||||
cb = oldcb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
writer.WriteLine(String.Format (
|
||||
"Header Size : {0}" + Environment.NewLine +
|
||||
"Runtime Version : {1}" + Environment.NewLine +
|
||||
"MetaData Root : {2}" + Environment.NewLine +
|
||||
"Flags : {3}" + Environment.NewLine +
|
||||
"Entry Point Token : {4}" + Environment.NewLine +
|
||||
"Resources : {5}" + Environment.NewLine +
|
||||
"Strong Name Signature : {6}" + Environment.NewLine +
|
||||
"Code Manager Table : {7}" + Environment.NewLine +
|
||||
"VTable Fixups : {8}" + Environment.NewLine +
|
||||
"Export Address Table Jumps : {9}" + Environment.NewLine +
|
||||
"EE Info Table : {10}" + Environment.NewLine +
|
||||
"Helper Table : {11}" + Environment.NewLine +
|
||||
"Dynamic Info : {12}" + Environment.NewLine +
|
||||
"Delay Load Info : {13}" + Environment.NewLine +
|
||||
"Module Image : {14}" + Environment.NewLine +
|
||||
"External Fixups : {15}" + Environment.NewLine +
|
||||
"Rid Map : {16}" + Environment.NewLine +
|
||||
"Debug Map : {17}" + Environment.NewLine +
|
||||
"IP Map : {18}" + Environment.NewLine,
|
||||
cb + String.Format(" (0x{0})", cb.ToString("X")),
|
||||
RuntimeVersion,
|
||||
meta, flags, EntryPointToken,
|
||||
rsrc, strongSig,
|
||||
codeManTab, vtab, jumps,
|
||||
eeInfo, helper, dynInfo, delayInfo, modImg, extFixups,
|
||||
ridMap, dbgMap, ipMap
|
||||
));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString() {
|
||||
StringWriter sw = new StringWriter();
|
||||
Dump(sw);
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct DOSHeader {
|
||||
// Magic number (ExeSignature.DOS).
|
||||
[FieldOffset(0*2)] public ExeSignature magic;
|
||||
|
||||
// Bytes on last page of file.
|
||||
[FieldOffset(1*2)] public short cblp;
|
||||
|
||||
// Pages in file.
|
||||
[FieldOffset(2*2)] public short cp;
|
||||
|
||||
// Relocations.
|
||||
[FieldOffset(3*2)] public short crlc;
|
||||
|
||||
// Size of header in paragraphs.
|
||||
[FieldOffset(4*2)] public short cparhdr;
|
||||
|
||||
// Minimum extra paragraphs needed.
|
||||
[FieldOffset(5*2)] public short minalloc;
|
||||
|
||||
// Maximum extra paragraphs needed.
|
||||
[FieldOffset(6*2)] public short maxalloc;
|
||||
|
||||
// Initial (relative) SS value.
|
||||
[FieldOffset(7*2)] public short ss;
|
||||
|
||||
// Initial SP value.
|
||||
[FieldOffset(8*2)] public short sp;
|
||||
|
||||
// Checksum.
|
||||
[FieldOffset(9*2)] public short csum;
|
||||
|
||||
// Initial IP value.
|
||||
[FieldOffset(10*2)] public short ip;
|
||||
|
||||
// Initial (relative) CS value.
|
||||
[FieldOffset(11*2)] public short cs;
|
||||
|
||||
// File address of relocation table.
|
||||
[FieldOffset(12*2)] public short lfarlc;
|
||||
|
||||
// Overlay number.
|
||||
[FieldOffset(13*2)] public short ovno;
|
||||
|
||||
// Reserved words.
|
||||
// short[4] res;
|
||||
|
||||
// OEM identifier (for e_oeminfo).
|
||||
[FieldOffset(18*2)] public short oemid;
|
||||
|
||||
// OEM information; e_oemid specific.
|
||||
[FieldOffset(19*2)] public short oeminfo;
|
||||
|
||||
// Reserved words
|
||||
// short[10] res2;
|
||||
|
||||
// File address of new exe header.
|
||||
[FieldOffset(30*2)] public uint lfanew;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
unsafe public void Read(BinaryReader reader)
|
||||
{
|
||||
fixed (void* pThis = &this) {
|
||||
PEUtils.ReadStruct(reader, pThis, sizeof (DOSHeader), typeof (DOSHeader));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
writer.WriteLine(
|
||||
"Number of pages : {0}" + Environment.NewLine +
|
||||
"Bytes on last pages : {1}" + Environment.NewLine +
|
||||
"New header offset : {2}" + Environment.NewLine +
|
||||
"Initial CS:IP : {3}:{4}" + Environment.NewLine +
|
||||
"Initial SS:SP : {5}:{6}" + Environment.NewLine +
|
||||
"Overlay number : {7}" + Environment.NewLine,
|
||||
cp, cblp,
|
||||
lfanew + " (0x" + lfanew.ToString("X") + ")",
|
||||
cs.ToString("X"), ip.ToString("X"),
|
||||
ss.ToString("X"), sp.ToString("X"),
|
||||
ovno
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
Dump(sw);
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
/// <summary>
|
||||
/// IMAGE_DATA_DIRECTORY.
|
||||
/// </summary>
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct DataDir {
|
||||
|
||||
public static readonly DataDir Null;
|
||||
|
||||
public RVA virtAddr;
|
||||
public uint size;
|
||||
|
||||
static DataDir ()
|
||||
{
|
||||
Null.virtAddr = 0;
|
||||
Null.size = 0;
|
||||
}
|
||||
|
||||
|
||||
public RVA VirtualAddress {
|
||||
get {
|
||||
return virtAddr;
|
||||
}
|
||||
set {
|
||||
virtAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint Size {
|
||||
get {
|
||||
return size;
|
||||
}
|
||||
set {
|
||||
size = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsNull {
|
||||
get {
|
||||
return (this == Null);
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (virtAddr.GetHashCode() ^ (int)(size << 1));
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
bool res = (obj is DataDir);
|
||||
if (res) {
|
||||
DataDir that = (DataDir) obj;
|
||||
res = (this.virtAddr == that.virtAddr) &&
|
||||
(this.size == that.size);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static bool operator == (DataDir d1, DataDir d2)
|
||||
{
|
||||
return d1.Equals(d2);
|
||||
}
|
||||
|
||||
public static bool operator != (DataDir d1, DataDir d2)
|
||||
{
|
||||
return !d1.Equals(d2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
if (this.IsNull) return "NULL";
|
||||
return String.Format("RVA = {0}, size = 0x{1}", virtAddr, size.ToString("X"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public enum ExeSignature : ushort {
|
||||
|
||||
UNKNOWN = 0,
|
||||
|
||||
/// <summary>
|
||||
/// "MZ"
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_DOS_SIGNATURE
|
||||
/// </remarks>
|
||||
DOS = 0x5A4D,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// "NE"
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_OS2_SIGNATURE
|
||||
/// </remarks>
|
||||
OS2 = 0x454E,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// "LE"
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_OS2_SIGNATURE_LE
|
||||
/// </remarks>
|
||||
OS2_LE = 0x454C,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// "LE"
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_VXD_SIGNATURE
|
||||
/// </remarks>
|
||||
VXD = OS2_LE,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// "PE", the complete signature is "PE\0\0"
|
||||
/// (that is, NT followed by NT2).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_NT_SIGNATURE
|
||||
/// </remarks>
|
||||
NT = 0x4550,
|
||||
NT2 = 0
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Mono.PEToolkit.Metadata;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public class Image : IDisposable {
|
||||
|
||||
internal DOSHeader dosHdr;
|
||||
internal COFFHeader coffHdr;
|
||||
internal PEHeader peHdr;
|
||||
|
||||
internal CorHeader corHdr;
|
||||
|
||||
internal Hashtable sections;
|
||||
// File position right after PEHeader (NT Optional Header).
|
||||
protected long sectionsPos;
|
||||
|
||||
private MetaDataRoot mdRoot;
|
||||
|
||||
private string name;
|
||||
private bool open;
|
||||
internal BinaryReader reader;
|
||||
|
||||
public Image(string name)
|
||||
{
|
||||
this.name = name;
|
||||
open = false;
|
||||
reader = null;
|
||||
|
||||
mdRoot = null;
|
||||
|
||||
dosHdr = new DOSHeader();
|
||||
coffHdr = new COFFHeader();
|
||||
peHdr = new PEHeader();
|
||||
corHdr = new CorHeader();
|
||||
|
||||
sections = new Hashtable();
|
||||
sectionsPos = -1;
|
||||
}
|
||||
|
||||
~Image()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
public Hashtable Sections {
|
||||
get {
|
||||
return sections;
|
||||
}
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
lock (this) if (!open) {
|
||||
FileInfo pe = new FileInfo(name);
|
||||
if (!pe.Exists) {
|
||||
throw new Exception("Invalid file path.");
|
||||
}
|
||||
|
||||
reader = new BinaryReader(new BufferedStream(pe.OpenRead()));
|
||||
if (!reader.BaseStream.CanSeek) {
|
||||
throw new Exception("Can't seek.");
|
||||
}
|
||||
|
||||
open = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
lock (this) if (open) {
|
||||
reader.Close();
|
||||
open = false;
|
||||
}
|
||||
}
|
||||
|
||||
// IDisposable
|
||||
public void Dispose()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
public bool IsCLI {
|
||||
get {
|
||||
return peHdr.IsCLIImage;
|
||||
}
|
||||
}
|
||||
|
||||
public MetaDataRoot MetadataRoot {
|
||||
get {
|
||||
return mdRoot;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public void ReadHeaders()
|
||||
{
|
||||
if (!open) {
|
||||
throw new Exception("You must open image before trying to read it.");
|
||||
}
|
||||
|
||||
dosHdr.Read(reader);
|
||||
reader.BaseStream.Position = dosHdr.lfanew;
|
||||
ExeSignature peSig = (ExeSignature) reader.ReadUInt16();
|
||||
if (peSig != ExeSignature.NT) {
|
||||
throw new Exception ("Invalid image format: cannot find PE signature.");
|
||||
}
|
||||
peSig = (ExeSignature) reader.ReadUInt16();
|
||||
if (peSig != ExeSignature.NT2) {
|
||||
throw new Exception ("Invalid image format: cannot find PE signature.");
|
||||
}
|
||||
|
||||
coffHdr.Read(reader);
|
||||
peHdr.Read(reader);
|
||||
sectionsPos = reader.BaseStream.Position;
|
||||
ReadSections();
|
||||
|
||||
if (this.IsCLI) {
|
||||
reader.BaseStream.Position = RVAToVA(peHdr.CLIHdrDir.virtAddr);
|
||||
corHdr.Read(reader);
|
||||
|
||||
mdRoot = new MetaDataRoot(this);
|
||||
reader.BaseStream.Position = RVAToVA(corHdr.MetaData.virtAddr);
|
||||
mdRoot.Read(reader);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
protected void ReadSections()
|
||||
{
|
||||
if (sectionsPos < 0) {
|
||||
throw new Exception("Read headers first.");
|
||||
}
|
||||
reader.BaseStream.Position = sectionsPos;
|
||||
|
||||
int n = coffHdr.NumberOfSections;
|
||||
for (int i = n; --i >=0;) {
|
||||
Section sect = new Section();
|
||||
sect.Read(reader);
|
||||
sections [sect.Name] = sect;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="writer"></param>
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
writer.WriteLine (
|
||||
dosHdr.ToString() + Environment.NewLine +
|
||||
coffHdr.ToString() + Environment.NewLine +
|
||||
peHdr.ToString() + Environment.NewLine +
|
||||
corHdr.ToString()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
Dump(sw);
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns name of the section for the given RVA.
|
||||
/// </summary>
|
||||
/// <param name="rva"></param>
|
||||
/// <returns></returns>
|
||||
public string RVAToSectionName(RVA rva)
|
||||
{
|
||||
string res = null;
|
||||
foreach (Section s in Sections.Values) {
|
||||
RVA sva = s.VirtualAddress;
|
||||
if (rva >= sva && rva < sva + s.SizeOfRawData) {
|
||||
res = s.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public long RVAToVA(RVA rva)
|
||||
{
|
||||
string sectName = RVAToSectionName(rva);
|
||||
long res = 0;
|
||||
if (sectName != null) {
|
||||
Section s = (Section) Sections [sectName];
|
||||
res = rva + (s.PointerToRawData - s.VirtualAddress);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public MetaDataRoot MetaDataRoot {
|
||||
get {
|
||||
return mdRoot;
|
||||
}
|
||||
}
|
||||
|
||||
public void DumpStreamHeader(TextWriter writer, string name)
|
||||
{
|
||||
if (mdRoot == null || name == null || name == String.Empty || writer == null) return;
|
||||
writer.Write(name + " header: ");
|
||||
MDStream s = MetaDataRoot.Streams[name] as MDStream;
|
||||
if (s != null) {
|
||||
writer.WriteLine();
|
||||
writer.WriteLine(s);
|
||||
} else {
|
||||
writer.WriteLine("not present.");
|
||||
writer.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
public void DumpStreamHeader(string name)
|
||||
{
|
||||
DumpStreamHeader(Console.Out, name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
|
||||
// Auto-generated file - DO NOT EDIT!
|
||||
// Please edit bitconverter.xsl if you want to make changes.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
/// <summary>
|
||||
/// Little-endian bit converter.
|
||||
/// </summary>
|
||||
public sealed class LEBitConverter {
|
||||
|
||||
internal interface IConverter {
|
||||
|
||||
short ToInt16(byte [] val, int idx);
|
||||
ushort ToUInt16(byte [] val, int idx);
|
||||
int ToInt32(byte [] val, int idx);
|
||||
uint ToUInt32(byte [] val, int idx);
|
||||
long ToInt64(byte [] val, int idx);
|
||||
ulong ToUInt64(byte [] val, int idx);
|
||||
|
||||
}
|
||||
|
||||
public static readonly bool Native = System.BitConverter.IsLittleEndian;
|
||||
|
||||
private static readonly IConverter impl = System.BitConverter.IsLittleEndian
|
||||
? new LEConverter() as IConverter
|
||||
: new BEConverter() as IConverter;
|
||||
|
||||
|
||||
|
||||
|
||||
private LEBitConverter()
|
||||
{
|
||||
// Never instantiated.
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
unsafe public static short SwapInt16(short x)
|
||||
{
|
||||
short* p = stackalloc short [1];
|
||||
*p = x;
|
||||
byte* bp = (byte*) p;
|
||||
byte b = bp [0];
|
||||
bp [0] = bp [1];
|
||||
bp [1] = b;
|
||||
return *p;
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
unsafe public static ushort SwapUInt16(ushort x)
|
||||
{
|
||||
ushort* p = stackalloc ushort [1];
|
||||
*p = x;
|
||||
byte* bp = (byte*) p;
|
||||
byte b = bp [0];
|
||||
bp [0] = bp [1];
|
||||
bp [1] = b;
|
||||
return *p;
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
unsafe public static int SwapInt32(int x)
|
||||
{
|
||||
int* p = stackalloc int [1];
|
||||
*p = x;
|
||||
byte* bp = (byte*) p;
|
||||
byte b = bp [0];
|
||||
bp [0] = bp [3];
|
||||
bp [3] = b;
|
||||
b = bp [1];
|
||||
bp [1] = bp [2];
|
||||
bp [2] = b;
|
||||
return *p;
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
unsafe public static uint SwapUInt32(uint x)
|
||||
{
|
||||
uint* p = stackalloc uint [1];
|
||||
*p = x;
|
||||
byte* bp = (byte*) p;
|
||||
byte b = bp [0];
|
||||
bp [0] = bp [3];
|
||||
bp [3] = b;
|
||||
b = bp [1];
|
||||
bp [1] = bp [2];
|
||||
bp [2] = b;
|
||||
return *p;
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
unsafe public static long SwapInt64(long x)
|
||||
{
|
||||
long* p = stackalloc long [1];
|
||||
*p = x;
|
||||
byte* bp = (byte*) p;
|
||||
byte b = bp [0];
|
||||
bp [0] = bp [7];
|
||||
bp [7] = b;
|
||||
b = bp [1];
|
||||
bp [1] = bp [6];
|
||||
bp [6] = b;
|
||||
b = bp [2];
|
||||
bp [2] = bp [5];
|
||||
bp [5] = b;
|
||||
b = bp [3];
|
||||
bp [3] = bp [4];
|
||||
bp [4] = b;
|
||||
return *p;
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
unsafe public static ulong SwapUInt64(ulong x)
|
||||
{
|
||||
ulong* p = stackalloc ulong [1];
|
||||
*p = x;
|
||||
byte* bp = (byte*) p;
|
||||
byte b = bp [0];
|
||||
bp [0] = bp [7];
|
||||
bp [7] = b;
|
||||
b = bp [1];
|
||||
bp [1] = bp [6];
|
||||
bp [6] = b;
|
||||
b = bp [2];
|
||||
bp [2] = bp [5];
|
||||
bp [5] = b;
|
||||
b = bp [3];
|
||||
bp [3] = bp [4];
|
||||
bp [4] = b;
|
||||
return *p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
internal sealed class LEConverter : IConverter {
|
||||
///<summary></summary>
|
||||
public short ToInt16(byte [] val, int idx)
|
||||
{
|
||||
return BitConverter.ToInt16(val, idx);
|
||||
}
|
||||
///<summary></summary>
|
||||
public ushort ToUInt16(byte [] val, int idx)
|
||||
{
|
||||
return BitConverter.ToUInt16(val, idx);
|
||||
}
|
||||
///<summary></summary>
|
||||
public int ToInt32(byte [] val, int idx)
|
||||
{
|
||||
return BitConverter.ToInt32(val, idx);
|
||||
}
|
||||
///<summary></summary>
|
||||
public uint ToUInt32(byte [] val, int idx)
|
||||
{
|
||||
return BitConverter.ToUInt32(val, idx);
|
||||
}
|
||||
///<summary></summary>
|
||||
public long ToInt64(byte [] val, int idx)
|
||||
{
|
||||
return BitConverter.ToInt64(val, idx);
|
||||
}
|
||||
///<summary></summary>
|
||||
public ulong ToUInt64(byte [] val, int idx)
|
||||
{
|
||||
return BitConverter.ToUInt64(val, idx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal sealed class BEConverter : IConverter {
|
||||
///<summary></summary>
|
||||
public short ToInt16(byte [] val, int idx)
|
||||
{
|
||||
return SwapInt16(BitConverter.ToInt16(val, idx));
|
||||
}
|
||||
///<summary></summary>
|
||||
public ushort ToUInt16(byte [] val, int idx)
|
||||
{
|
||||
return SwapUInt16(BitConverter.ToUInt16(val, idx));
|
||||
}
|
||||
///<summary></summary>
|
||||
public int ToInt32(byte [] val, int idx)
|
||||
{
|
||||
return SwapInt32(BitConverter.ToInt32(val, idx));
|
||||
}
|
||||
///<summary></summary>
|
||||
public uint ToUInt32(byte [] val, int idx)
|
||||
{
|
||||
return SwapUInt32(BitConverter.ToUInt32(val, idx));
|
||||
}
|
||||
///<summary></summary>
|
||||
public long ToInt64(byte [] val, int idx)
|
||||
{
|
||||
return SwapInt64(BitConverter.ToInt64(val, idx));
|
||||
}
|
||||
///<summary></summary>
|
||||
public ulong ToUInt64(byte [] val, int idx)
|
||||
{
|
||||
return SwapUInt64(BitConverter.ToUInt64(val, idx));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
///<summary></summary>
|
||||
public static short ToInt16(byte [] val, int idx)
|
||||
{
|
||||
return impl.ToInt16(val, idx);
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
public static ushort ToUInt16(byte [] val, int idx)
|
||||
{
|
||||
return impl.ToUInt16(val, idx);
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
public static int ToInt32(byte [] val, int idx)
|
||||
{
|
||||
return impl.ToInt32(val, idx);
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
public static uint ToUInt32(byte [] val, int idx)
|
||||
{
|
||||
return impl.ToUInt32(val, idx);
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
public static long ToInt64(byte [] val, int idx)
|
||||
{
|
||||
return impl.ToInt64(val, idx);
|
||||
}
|
||||
|
||||
///<summary></summary>
|
||||
public static ulong ToUInt64(byte [] val, int idx)
|
||||
{
|
||||
return impl.ToUInt64(val, idx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public enum MachineId : ushort {
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_UNKNOWN
|
||||
/// </remarks>
|
||||
UNKNOWN = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Intel 386.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_I386
|
||||
/// </remarks>
|
||||
I386 = 0x014c,
|
||||
|
||||
/// <summary>
|
||||
/// Intel 486.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
I486 = 0x014d,
|
||||
|
||||
/// <summary>
|
||||
/// Intel Pentium.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// </remarks>
|
||||
PENTIUM = 0x014e,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS 3K big-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_R3000
|
||||
/// </remarks>
|
||||
R3000_BE = 0x0160,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS 3K little-endian, 0x160 big-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_R3000
|
||||
/// </remarks>
|
||||
R3000 = 0x0162,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS 4K little-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_R4000
|
||||
/// </remarks>
|
||||
R4000 = 0x0166,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS little-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_R10000
|
||||
/// </remarks>
|
||||
R10000 = 0x0168,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS little-endian WCE v2
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_WCEMIPSV2
|
||||
/// </remarks>
|
||||
WCEMIPSV2 = 0x0169,
|
||||
|
||||
/// <summary>
|
||||
/// Alpha_AXP
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_ALPHA
|
||||
/// </remarks>
|
||||
ALPHA = 0x0184,
|
||||
|
||||
/// <summary>
|
||||
/// SH3 little-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_SH3
|
||||
/// </remarks>
|
||||
SH3 = 0x01a2,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_SH3DSP
|
||||
/// </remarks>
|
||||
SH3DSP = 0x01a3,
|
||||
|
||||
/// <summary>
|
||||
/// SH3E little-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_SH3E
|
||||
/// </remarks>
|
||||
SH3E = 0x01a4,
|
||||
|
||||
/// <summary>
|
||||
/// SH4 little-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_SH4
|
||||
/// </remarks>
|
||||
SH4 = 0x01a6,
|
||||
|
||||
/// <summary>
|
||||
/// SH5
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_SH5
|
||||
/// </remarks>
|
||||
SH5 = 0x01a8,
|
||||
|
||||
/// <summary>
|
||||
/// ARM Little-Endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_ARM
|
||||
/// </remarks>
|
||||
ARM = 0x01c0,
|
||||
|
||||
/// <summary>
|
||||
/// ARM 10 Thumb family CPU.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_THUMB
|
||||
/// http://www.arm.com/armtech/ARM10_Thumb?OpenDocument&ExpandSection=2
|
||||
/// </remarks>
|
||||
THUMB = 0x01c2,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_AM33
|
||||
/// </remarks>
|
||||
AM33 = 0x01d3,
|
||||
|
||||
/// <summary>
|
||||
/// IBM PowerPC Little-Endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_POWERPC
|
||||
/// </remarks>
|
||||
POWERPC = 0x01F0,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_POWERPCFP
|
||||
/// </remarks>
|
||||
POWERPCFP = 0x01f1,
|
||||
|
||||
/// <summary>
|
||||
/// Intel 64
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_IA64
|
||||
/// </remarks>
|
||||
IA64 = 0x0200,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_MIPS16
|
||||
/// </remarks>
|
||||
MIPS16 = 0x0266,
|
||||
|
||||
/// <summary>
|
||||
/// ALPHA64
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_ALPHA64
|
||||
/// </remarks>
|
||||
ALPHA64 = 0x0284,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_MIPSFPU
|
||||
/// </remarks>
|
||||
MIPSFPU = 0x0366,
|
||||
|
||||
/// <summary>
|
||||
/// MIPS
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_MIPSFPU16
|
||||
/// </remarks>
|
||||
MIPSFPU16 = 0x0466,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_AXP64
|
||||
/// </remarks>
|
||||
AXP64 = ALPHA64,
|
||||
|
||||
/// <summary>
|
||||
/// Infineon
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_TRICORE
|
||||
/// http://www.infineon.com/tricore
|
||||
/// </remarks>
|
||||
TRICORE = 0x0520,
|
||||
|
||||
/// <summary>
|
||||
/// Common Executable Format (Windows CE).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_CEF
|
||||
/// </remarks>
|
||||
CEF = 0x0CEF,
|
||||
|
||||
/// <summary>
|
||||
/// EFI Byte Code
|
||||
/// </summary>
|
||||
EBC = 0x0EBC,
|
||||
|
||||
/// <summary>
|
||||
/// AMD64 (K8)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_AMD64
|
||||
/// </remarks>
|
||||
AMD64 = 0x8664,
|
||||
|
||||
/// <summary>
|
||||
/// M32R little-endian
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_M32R
|
||||
/// </remarks>
|
||||
M32R = 0x9104,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_FILE_MACHINE_CEE
|
||||
/// </remarks>
|
||||
CEE = 0xC0EE,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,558 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
// IMAGE_OPTIONAL_HEADER
|
||||
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct PEHeader {
|
||||
|
||||
/// <summary>
|
||||
/// Standard PE/COFF fields.
|
||||
/// </summary>
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct StdFields {
|
||||
internal short magic; // always 0x10B?
|
||||
internal byte lMajor;
|
||||
internal byte lMinor;
|
||||
internal uint codeSize;
|
||||
internal uint initDataSize;
|
||||
internal uint uninitDataSize;
|
||||
internal RVA entryRVA;
|
||||
internal RVA codeBase;
|
||||
internal RVA dataBase;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string LinkerVersion {
|
||||
get {
|
||||
return String.Format("{0}.{1}", lMajor, lMinor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString() {
|
||||
return String.Format(
|
||||
"Magic : 0x{0}" + Environment.NewLine +
|
||||
"Linker ver. : {1}" + Environment.NewLine +
|
||||
"Size of code : {2}" + Environment.NewLine +
|
||||
"Size of initialized data : {3}" + Environment.NewLine +
|
||||
"Size of uinitialized data (BSS) : {4}" + Environment.NewLine,
|
||||
magic.ToString("X"), LinkerVersion,
|
||||
codeSize, initDataSize, uninitDataSize
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Windows-specific fields.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See Partition II, 24.2.3.2
|
||||
/// </remarks>
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct NTFields {
|
||||
internal uint imgBase;
|
||||
internal uint sectAlign;
|
||||
internal uint fileAlign;
|
||||
internal short osMaj;
|
||||
internal short osMin;
|
||||
internal short imgMaj;
|
||||
internal short imgMin;
|
||||
internal short subSysMaj;
|
||||
internal short subSysMin;
|
||||
internal int reserved_win32ver;
|
||||
internal uint imgSize;
|
||||
internal uint hdrSize;
|
||||
internal uint chksum;
|
||||
internal Subsystem subSys;
|
||||
internal short dllFlags;
|
||||
internal uint stackRes;
|
||||
internal uint stackCommit;
|
||||
internal uint heapRes;
|
||||
internal uint heapCommit;
|
||||
internal uint ldrFlags;
|
||||
internal uint numDirs;
|
||||
|
||||
public string OSVersion {
|
||||
get {
|
||||
return String.Format("{0}.{1}", osMaj, osMin);
|
||||
}
|
||||
}
|
||||
|
||||
public string ImageVersion {
|
||||
get {
|
||||
return String.Format("{0}.{1}", imgMaj, imgMin);
|
||||
}
|
||||
}
|
||||
|
||||
public string SubsysVersion {
|
||||
get {
|
||||
return String.Format("{0}.{1}", subSysMaj, subSysMin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString() {
|
||||
return String.Format(
|
||||
"Image Base : 0x{0}" + Environment.NewLine +
|
||||
"Section Alignment : 0x{1}" + Environment.NewLine +
|
||||
"File Alignment : 0x{2}" + Environment.NewLine +
|
||||
"OS Version : {3}" + Environment.NewLine +
|
||||
"Image Version : {4}" + Environment.NewLine +
|
||||
"Subsystem Version : {5}" + Environment.NewLine +
|
||||
"Reserved/Win32Ver : {6}" + Environment.NewLine +
|
||||
"Image Size : {7}" + Environment.NewLine +
|
||||
"Header Size : {8}" + Environment.NewLine +
|
||||
"Checksum : 0x{9}" + Environment.NewLine +
|
||||
"Subsystem : {10}" + Environment.NewLine +
|
||||
"DLL Flags : {11}" + Environment.NewLine +
|
||||
"Stack Reserve Size : 0x{12}" + Environment.NewLine +
|
||||
"Stack Commit Size : 0x{13}" + Environment.NewLine +
|
||||
"Heap Reserve Size : 0x{14}" + Environment.NewLine +
|
||||
"Heap Commit Size : 0x{15}" + Environment.NewLine +
|
||||
"Loader Flags : {16}" + Environment.NewLine +
|
||||
"Number of Directories : {17}" + Environment.NewLine,
|
||||
imgBase.ToString("X"), sectAlign.ToString("X"), fileAlign.ToString("X"),
|
||||
OSVersion, ImageVersion, SubsysVersion,
|
||||
reserved_win32ver,
|
||||
imgSize, hdrSize, chksum.ToString("X"), subSys, dllFlags,
|
||||
stackRes.ToString("X"), stackCommit.ToString("X"), heapRes.ToString("X"), heapCommit.ToString ("X"),
|
||||
ldrFlags, numDirs
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal StdFields stdFlds;
|
||||
internal NTFields ntFlds;
|
||||
|
||||
internal DataDir exportDir;
|
||||
internal DataDir importDir;
|
||||
internal DataDir resourceDir;
|
||||
internal DataDir exceptionDir;
|
||||
internal DataDir securityDir;
|
||||
internal DataDir baseRelocDir;
|
||||
internal DataDir debugDir;
|
||||
internal DataDir copyrightDir;
|
||||
internal DataDir GPDir;
|
||||
internal DataDir TLSDir;
|
||||
internal DataDir loadCfgDir;
|
||||
internal DataDir boundImpDir;
|
||||
internal DataDir IATDir;
|
||||
internal DataDir delayImpDir;
|
||||
internal DataDir CLIHdrDir;
|
||||
internal DataDir reservedDir;
|
||||
|
||||
|
||||
public bool IsCLIImage {
|
||||
get {
|
||||
return (CLIHdrDir.virtAddr.Value != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Accessors for standard COFF fields.
|
||||
//
|
||||
|
||||
public short Magic {
|
||||
get {
|
||||
return stdFlds.magic;
|
||||
}
|
||||
set {
|
||||
stdFlds.magic = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte MajorLinkerVersion {
|
||||
get {
|
||||
return stdFlds.lMajor;
|
||||
}
|
||||
set {
|
||||
stdFlds.lMajor = value;
|
||||
}
|
||||
}
|
||||
|
||||
public byte MinorLinkerVersion {
|
||||
get {
|
||||
return stdFlds.lMinor;
|
||||
}
|
||||
set {
|
||||
stdFlds.lMinor = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfCode {
|
||||
get {
|
||||
return stdFlds.codeSize;
|
||||
}
|
||||
set {
|
||||
stdFlds.codeSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfInitializedData {
|
||||
get {
|
||||
return stdFlds.initDataSize;
|
||||
}
|
||||
set {
|
||||
stdFlds.initDataSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfUninitializedData {
|
||||
get {
|
||||
return stdFlds.uninitDataSize;
|
||||
}
|
||||
set {
|
||||
stdFlds.uninitDataSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA AddressOfEntryPoint {
|
||||
get {
|
||||
return stdFlds.entryRVA;
|
||||
}
|
||||
set {
|
||||
stdFlds.entryRVA.value = value.value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA BaseOfCode {
|
||||
get {
|
||||
return stdFlds.codeBase;
|
||||
}
|
||||
set {
|
||||
stdFlds.codeBase.value = value.value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA BaseOfData {
|
||||
get {
|
||||
return stdFlds.dataBase;
|
||||
}
|
||||
set {
|
||||
stdFlds.dataBase.value = value.value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Accessors for Windows-specific fields.
|
||||
//
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Preferred address of image when loaded into memory.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This is a linear address and not RVA,
|
||||
/// and must be a multiple of 64K.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Table in the Partition II states that for CIL images
|
||||
/// it must be 0x400000.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public uint ImageBase {
|
||||
get {
|
||||
return ntFlds.imgBase;
|
||||
}
|
||||
set {
|
||||
ntFlds.imgBase = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Alignment of section when loaded into memory.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Must be greater or equal to FileAlignment.
|
||||
/// Default is the native page size.
|
||||
/// According to specs for CIL images it must be set to 8K.
|
||||
/// </remarks>
|
||||
public uint SectionAlignment {
|
||||
get {
|
||||
return ntFlds.sectAlign;
|
||||
}
|
||||
set {
|
||||
ntFlds.sectAlign = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Byte alignment of pages in image file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Valid values are powers of 2 between 512 and 64K.
|
||||
/// For CIL images it must be either 512 or 4K.
|
||||
/// </remarks>
|
||||
public uint FileAlignment {
|
||||
get {
|
||||
return ntFlds.fileAlign;
|
||||
}
|
||||
set {
|
||||
ntFlds.fileAlign = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public short MajorOperatingSystemVersion {
|
||||
get {
|
||||
return ntFlds.osMaj;
|
||||
}
|
||||
set {
|
||||
ntFlds.osMaj = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MinorOperatingSystemVersion {
|
||||
get {
|
||||
return ntFlds.osMin;
|
||||
}
|
||||
set {
|
||||
ntFlds.osMin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MajorImageVersion {
|
||||
get {
|
||||
return ntFlds.imgMaj;
|
||||
}
|
||||
set {
|
||||
ntFlds.imgMaj = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MinorImageVersion {
|
||||
get {
|
||||
return ntFlds.imgMin;
|
||||
}
|
||||
set {
|
||||
ntFlds.imgMin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MajorSubsystemVersion {
|
||||
get {
|
||||
return ntFlds.subSysMaj;
|
||||
}
|
||||
set {
|
||||
ntFlds.subSysMaj = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short MinorSubsystemVersion {
|
||||
get {
|
||||
return ntFlds.subSysMin;
|
||||
}
|
||||
set {
|
||||
ntFlds.subSysMin = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Win32VersionValue {
|
||||
get {
|
||||
return ntFlds.reserved_win32ver;
|
||||
}
|
||||
set {
|
||||
ntFlds.reserved_win32ver = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Reserved {
|
||||
get {
|
||||
return ntFlds.reserved_win32ver;
|
||||
}
|
||||
set {
|
||||
ntFlds.reserved_win32ver = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfImage {
|
||||
get {
|
||||
return ntFlds.imgSize;
|
||||
}
|
||||
set {
|
||||
ntFlds.imgSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfHeaders {
|
||||
get {
|
||||
return ntFlds.hdrSize;
|
||||
}
|
||||
set {
|
||||
ntFlds.hdrSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint CheckSum {
|
||||
get {
|
||||
return ntFlds.chksum;
|
||||
}
|
||||
set {
|
||||
ntFlds.chksum = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Subsystem Subsystem {
|
||||
get {
|
||||
return ntFlds.subSys;
|
||||
}
|
||||
set {
|
||||
ntFlds.subSys = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short DllCharacteristics {
|
||||
get {
|
||||
return ntFlds.dllFlags;
|
||||
}
|
||||
set {
|
||||
ntFlds.dllFlags = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public uint SizeOfStackReserve {
|
||||
get {
|
||||
return ntFlds.stackRes;
|
||||
}
|
||||
set {
|
||||
ntFlds.stackRes = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfStackCommit {
|
||||
get {
|
||||
return ntFlds.stackCommit;
|
||||
}
|
||||
set {
|
||||
ntFlds.stackCommit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfHeapReserve {
|
||||
get {
|
||||
return ntFlds.heapRes;
|
||||
}
|
||||
set {
|
||||
ntFlds.heapRes = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfHeapCommit {
|
||||
get {
|
||||
return ntFlds.heapCommit;
|
||||
}
|
||||
set {
|
||||
ntFlds.heapCommit = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint LoaderFlags {
|
||||
get {
|
||||
return ntFlds.ldrFlags;
|
||||
}
|
||||
set {
|
||||
ntFlds.ldrFlags = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint NumberOfRvaAndSizes {
|
||||
get {
|
||||
return ntFlds.numDirs;
|
||||
}
|
||||
set {
|
||||
ntFlds.numDirs = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
unsafe public void Read(BinaryReader reader)
|
||||
{
|
||||
fixed (void* pThis = &this) {
|
||||
int hdrSize = sizeof (StdFields) + sizeof (NTFields);
|
||||
PEUtils.ReadStruct(reader, pThis, hdrSize);
|
||||
PEUtils.ReadStruct(reader, (byte*)pThis + hdrSize, (int) NumberOfRvaAndSizes * sizeof (DataDir));
|
||||
|
||||
if (!System.BitConverter.IsLittleEndian) {
|
||||
PEUtils.ChangeStructEndianess(pThis, typeof (PEHeader));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public void Dump(TextWriter writer)
|
||||
{
|
||||
string dirs = String.Format(
|
||||
"Export Table : {0}" + Environment.NewLine +
|
||||
"Import Table : {1}" + Environment.NewLine +
|
||||
"Win32 Resource Table : {2}" + Environment.NewLine +
|
||||
"Exception Table : {3}" + Environment.NewLine +
|
||||
"Certificate Table : {4}" + Environment.NewLine +
|
||||
"Base Relocation Table : {5}" + Environment.NewLine +
|
||||
"Debug Table : {6}" + Environment.NewLine +
|
||||
"Copyright : {7}" + Environment.NewLine +
|
||||
"MIPS Global Ptr : {8}" + Environment.NewLine +
|
||||
"TLS Table : {9}" + Environment.NewLine +
|
||||
"Load Config Table : {10}" + Environment.NewLine +
|
||||
"Bound Import : {11}" + Environment.NewLine +
|
||||
"IAT : {12}" + Environment.NewLine +
|
||||
"Delay Import Descriptor : {13}" + Environment.NewLine +
|
||||
"CLI Header : {14}" + Environment.NewLine +
|
||||
"Reserved : {15}" + Environment.NewLine,
|
||||
exportDir, importDir, resourceDir, exceptionDir,
|
||||
securityDir, baseRelocDir, debugDir, copyrightDir,
|
||||
GPDir, TLSDir, loadCfgDir, boundImpDir, IATDir, delayImpDir,
|
||||
CLIHdrDir, reservedDir
|
||||
);
|
||||
|
||||
writer.WriteLine(
|
||||
stdFlds.ToString() + Environment.NewLine +
|
||||
ntFlds.ToString() + Environment.NewLine +
|
||||
"Directories: "+ Environment.NewLine +
|
||||
dirs
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
Dump(sw);
|
||||
return sw.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- NAnt build file for Mono.PEToolkit.dll -->
|
||||
|
||||
<project name="Mono.PEToolkit" default="build">
|
||||
<property name="debug" value="false"/>
|
||||
|
||||
<target name="build">
|
||||
<mkdir dir="../lib"/>
|
||||
<csc target="library" output="../lib/Mono.PEToolkit.dll" debug="${debug}">
|
||||
<arg value="/unsafe"/>
|
||||
<arg value="/noconfig"/> <!-- don't reference ms assemblies -->
|
||||
<arg value="/lib:../lib/"/>
|
||||
|
||||
<sources>
|
||||
<includes name="**/*.cs"/>
|
||||
</sources>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
<delete file="../lib/Mono.PEToolkit.dll" failonerror="false"/>
|
||||
</target>
|
||||
</project>
|
||||
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public sealed class PEUtils {
|
||||
|
||||
private PEUtils()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reads structure from the input stream preserving its endianess.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="pStruct"></param>
|
||||
/// <param name="len"></param>
|
||||
unsafe internal static void ReadStruct(BinaryReader reader, void* pStruct, int len)
|
||||
{
|
||||
byte* p = (byte*) pStruct;
|
||||
|
||||
if (System.BitConverter.IsLittleEndian) {
|
||||
// On a little-endian machine read data in 64-bit chunks,
|
||||
// this won't work on big-endian machine because
|
||||
// BinaryReader APIs are little-endian while
|
||||
// memory writes are platform-native.
|
||||
// This seems faster than ReadBytes/Copy method
|
||||
// in the "else" clause, especially if used often
|
||||
// (no extra memory allocation for byte[]?).
|
||||
int whole = len >> 3;
|
||||
int rem = len & 7;
|
||||
|
||||
for (int i = whole; --i >= 0;) {
|
||||
long qw = reader.ReadInt64();
|
||||
Marshal.WriteInt64((IntPtr) p, qw);
|
||||
p += sizeof (long);
|
||||
}
|
||||
for (int i = rem; --i >= 0;) {
|
||||
*p++ = (byte) reader.ReadByte();
|
||||
}
|
||||
} else {
|
||||
byte [] buff = reader.ReadBytes(len);
|
||||
Marshal.Copy(buff, 0, (IntPtr) p, len);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads structure from the input stream
|
||||
/// changing its endianess if required
|
||||
/// (if running on big-endian hardware).
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="pStruct"></param>
|
||||
/// <param name="len"></param>
|
||||
/// <param name="type"></param>
|
||||
unsafe internal static void ReadStruct(BinaryReader reader, void* pStruct, int len, Type type)
|
||||
{
|
||||
ReadStruct(reader, pStruct, len);
|
||||
if (!System.BitConverter.IsLittleEndian) {
|
||||
ChangeStructEndianess(pStruct, type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsafe private static int SwapByTypeCode(byte* p, TypeCode tcode)
|
||||
{
|
||||
int inc = 0;
|
||||
switch (tcode) {
|
||||
case TypeCode.Int16 :
|
||||
short* sp = (short*) p;
|
||||
short sx = *sp;
|
||||
sx = LEBitConverter.SwapInt16(sx);
|
||||
*sp = sx;
|
||||
inc = sizeof (short);
|
||||
break;
|
||||
case TypeCode.UInt16 :
|
||||
ushort* usp = (ushort*) p;
|
||||
ushort usx = *usp;
|
||||
usx = LEBitConverter.SwapUInt16(usx);
|
||||
*usp = usx;
|
||||
inc = sizeof (ushort);
|
||||
break;
|
||||
case TypeCode.Int32 :
|
||||
int* ip = (int*) p;
|
||||
int ix = *ip;
|
||||
ix = LEBitConverter.SwapInt32(ix);
|
||||
*ip = ix;
|
||||
inc = sizeof (int);
|
||||
break;
|
||||
case TypeCode.UInt32 :
|
||||
uint* uip = (uint*) p;
|
||||
uint uix = *uip;
|
||||
uix = LEBitConverter.SwapUInt32(uix);
|
||||
*uip = uix;
|
||||
inc = sizeof (uint);
|
||||
break;
|
||||
case TypeCode.Int64 :
|
||||
long* lp = (long*) p;
|
||||
long lx = *lp;
|
||||
lx = LEBitConverter.SwapInt64(lx);
|
||||
*lp = lx;
|
||||
inc = sizeof (long);
|
||||
break;
|
||||
case TypeCode.UInt64 :
|
||||
ulong* ulp = (ulong*) p;
|
||||
ulong ulx = *ulp;
|
||||
ulx = LEBitConverter.SwapUInt64(ulx);
|
||||
*ulp = ulx;
|
||||
inc = sizeof (ulong);
|
||||
break;
|
||||
case TypeCode.Byte :
|
||||
case TypeCode.SByte :
|
||||
inc = sizeof (byte);
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
return inc;
|
||||
}
|
||||
|
||||
unsafe internal static int ChangeStructEndianess(void* pStruct, Type type)
|
||||
{
|
||||
if (type == null || !type.IsValueType) return 0;
|
||||
if (!type.IsLayoutSequential && !type.IsExplicitLayout) {
|
||||
throw new Exception("Internal error: struct must have explicit or sequential layout.");
|
||||
}
|
||||
|
||||
bool seq = type.IsLayoutSequential;
|
||||
byte* p = (byte*) pStruct;
|
||||
int offs = 0;
|
||||
int inc;
|
||||
FieldInfo [] fields = type.GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
|
||||
|
||||
foreach (FieldInfo fi in fields) {
|
||||
if (!seq) offs = Marshal.OffsetOf(type, fi.Name).ToInt32 ();
|
||||
Type ft = fi.FieldType;
|
||||
TypeCode tcode = Type.GetTypeCode(ft);
|
||||
if (tcode == TypeCode.Object) {
|
||||
// not a primitive type, process recursively.
|
||||
inc = ChangeStructEndianess(p + offs, ft);
|
||||
} else {
|
||||
inc = SwapByTypeCode(p + offs, tcode);
|
||||
}
|
||||
if (seq) offs += inc;
|
||||
}
|
||||
|
||||
return offs;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
The PEToolkit was authored by Sergey Chaban ([email protected])
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
/// <summary>
|
||||
/// Relative Virtual Address.
|
||||
/// </summary>
|
||||
public struct RVA {
|
||||
|
||||
public static readonly RVA Null;
|
||||
|
||||
public uint value;
|
||||
|
||||
static RVA()
|
||||
{
|
||||
Null = new RVA(0);
|
||||
}
|
||||
|
||||
|
||||
public RVA(uint val)
|
||||
{
|
||||
value = val;
|
||||
}
|
||||
|
||||
|
||||
public uint Value {
|
||||
get {
|
||||
return value;
|
||||
}
|
||||
set {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static implicit operator RVA (uint val)
|
||||
{
|
||||
return new RVA(val);
|
||||
}
|
||||
|
||||
public static implicit operator uint (RVA rva)
|
||||
{
|
||||
return rva.value;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (int) value;
|
||||
}
|
||||
|
||||
public override bool Equals(object o)
|
||||
{
|
||||
bool res = o is RVA;
|
||||
if (res) res = (this.value == ((RVA)o).value);
|
||||
return res;
|
||||
}
|
||||
|
||||
public static bool operator == (RVA rva1, RVA rva2)
|
||||
{
|
||||
return rva1.Equals(rva2);
|
||||
}
|
||||
|
||||
public static bool operator != (RVA rva1, RVA rva2)
|
||||
{
|
||||
return !rva1.Equals(rva2);
|
||||
}
|
||||
|
||||
public static bool operator < (RVA rva1, RVA rva2)
|
||||
{
|
||||
return (rva1.value < rva2.value);
|
||||
}
|
||||
|
||||
public static bool operator > (RVA rva1, RVA rva2) {
|
||||
return (rva1.value > rva2.value);
|
||||
}
|
||||
|
||||
public static bool operator <= (RVA rva1, RVA rva2)
|
||||
{
|
||||
return (rva1.value <= rva2.value);
|
||||
}
|
||||
|
||||
public static bool operator >= (RVA rva1, RVA rva2)
|
||||
{
|
||||
return (rva1.value >= rva2.value);
|
||||
}
|
||||
|
||||
public static RVA operator + (RVA rva, uint x)
|
||||
{
|
||||
return new RVA (rva.value + x);
|
||||
}
|
||||
|
||||
public static RVA operator - (RVA rva, uint x)
|
||||
{
|
||||
return new RVA (rva.value - x);
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (this == Null) return "NULL";
|
||||
return ("0x" + value.ToString("X"));
|
||||
}
|
||||
|
||||
unsafe public static int Size {
|
||||
get {
|
||||
return sizeof (uint);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
public class Section {
|
||||
|
||||
// IMAGE_SECTION_HEADER
|
||||
[StructLayoutAttribute(LayoutKind.Sequential)]
|
||||
public struct Header {
|
||||
internal uint phAddr_virtSize;
|
||||
internal RVA virtAddr;
|
||||
internal uint rawSize;
|
||||
internal RVA rawDataPtr;
|
||||
internal RVA relocPtr;
|
||||
internal RVA lineNumPtr;
|
||||
internal short relocNum;
|
||||
internal short linenumNum;
|
||||
internal SectionCharacteristics flags;
|
||||
}
|
||||
|
||||
private string name;
|
||||
internal Header hdr;
|
||||
|
||||
public readonly static Section Invalid;
|
||||
|
||||
static Section()
|
||||
{
|
||||
Invalid = new Section();
|
||||
}
|
||||
|
||||
public Section()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public string Name {
|
||||
get {
|
||||
return name;
|
||||
}
|
||||
set {
|
||||
name = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public uint PhysicalAddress {
|
||||
get {
|
||||
return hdr.phAddr_virtSize;
|
||||
}
|
||||
set {
|
||||
hdr.phAddr_virtSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint VirtualSize {
|
||||
get {
|
||||
return hdr.phAddr_virtSize;
|
||||
}
|
||||
set {
|
||||
hdr.phAddr_virtSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA VirtualAddress {
|
||||
get {
|
||||
return hdr.virtAddr;
|
||||
}
|
||||
set {
|
||||
hdr.virtAddr = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint SizeOfRawData {
|
||||
get {
|
||||
return hdr.rawSize;
|
||||
}
|
||||
set {
|
||||
hdr.rawSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA PointerToRawData {
|
||||
get {
|
||||
return hdr.rawDataPtr;
|
||||
}
|
||||
set {
|
||||
hdr.rawDataPtr = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA PointerToRelocations {
|
||||
get {
|
||||
return hdr.relocPtr;
|
||||
}
|
||||
set {
|
||||
hdr.relocPtr = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RVA PointerToLinenumbers {
|
||||
get {
|
||||
return hdr.lineNumPtr;
|
||||
}
|
||||
set {
|
||||
hdr.lineNumPtr = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short NumberOfRelocations {
|
||||
get {
|
||||
return hdr.relocNum;
|
||||
}
|
||||
set {
|
||||
hdr.relocNum = value;
|
||||
}
|
||||
}
|
||||
|
||||
public short NumberOfLinenumbers {
|
||||
get {
|
||||
return hdr.linenumNum;
|
||||
}
|
||||
set {
|
||||
hdr.linenumNum = value;
|
||||
}
|
||||
}
|
||||
|
||||
public SectionCharacteristics Characteristics {
|
||||
get {
|
||||
return hdr.flags;
|
||||
}
|
||||
set {
|
||||
hdr.flags = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
unsafe public void Read(BinaryReader reader)
|
||||
{
|
||||
sbyte* pName = stackalloc sbyte [8];
|
||||
sbyte* p = pName;
|
||||
|
||||
for (int i = 8; --i >=0;) {
|
||||
sbyte c = reader.ReadSByte();
|
||||
if (c == 0) break;
|
||||
*p++ = c;
|
||||
}
|
||||
|
||||
int len = (int) (p - pName);
|
||||
if (len != 0) {
|
||||
name = new string(pName, 0, len, Encoding.ASCII);
|
||||
} else {
|
||||
name = String.Empty;
|
||||
}
|
||||
|
||||
reader.BaseStream.Position += 8 - len - 1;
|
||||
|
||||
fixed (void* pHdr = &this.hdr) {
|
||||
PEUtils.ReadStruct(reader, pHdr, sizeof (Header), typeof (Header));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
[Flags]
|
||||
public enum SectionCharacteristics : uint {
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_REG = 0x00000000,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_DSECT = 0x00000001,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_NOLOAD = 0x00000002,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_GROUP = 0x00000004,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_NO_PAD = 0x00000008,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_COPY = 0x00000010,
|
||||
|
||||
/// <summary>
|
||||
/// Section contains code.
|
||||
/// </summary>
|
||||
IMAGE_SCN_CNT_CODE = 0x00000020,
|
||||
|
||||
/// <summary>
|
||||
/// Section contains initialized data.
|
||||
/// </summary>
|
||||
IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040,
|
||||
|
||||
/// <summary>
|
||||
/// Section contains uninitialized data.
|
||||
/// </summary>
|
||||
IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_LNK_OTHER = 0x00000100,
|
||||
|
||||
/// <summary>
|
||||
/// Section contains comments or some other type of information.
|
||||
/// </summary>
|
||||
IMAGE_SCN_LNK_INFO = 0x00000200,
|
||||
|
||||
/// <summary>
|
||||
/// Reserved.
|
||||
/// </summary>
|
||||
IMAGE_SCN_TYPE_OVER = 0x00000400,
|
||||
|
||||
/// <summary>
|
||||
/// Section contents will not become part of image.
|
||||
/// </summary>
|
||||
IMAGE_SCN_LNK_REMOVE = 0x00000800,
|
||||
|
||||
/// <summary>
|
||||
/// Section contents comdat.
|
||||
/// </summary>
|
||||
IMAGE_SCN_LNK_COMDAT = 0x00001000,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reset speculative exceptions handling bits in the TLB entries for this section.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SCN_MEM_PROTECTED - Obsolete.
|
||||
/// </remarks>
|
||||
IMAGE_SCN_NO_DEFER_SPEC_EXC = 0x00004000,
|
||||
|
||||
/// <summary>
|
||||
/// Section content can be accessed relative to GP (MIPS).
|
||||
/// </summary>
|
||||
IMAGE_SCN_GPREL = 0x00008000,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_FARDATA = 0x00008000,
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_PURGEABLE = 0x00020000,
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_16BIT = 0x00020000,
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_LOCKED = 0x00040000,
|
||||
|
||||
/// <summary>
|
||||
/// Obsolete.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_PRELOAD = 0x00080000,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SCN_MEM_SYSHEAP - Obsolete 0x00010000
|
||||
/// </remarks>
|
||||
IMAGE_SCN_ALIGN_1BYTES = 0x00100000,
|
||||
|
||||
IMAGE_SCN_ALIGN_2BYTES = 0x00200000,
|
||||
IMAGE_SCN_ALIGN_4BYTES = 0x00300000,
|
||||
IMAGE_SCN_ALIGN_8BYTES = 0x00400000,
|
||||
|
||||
// default alignment
|
||||
IMAGE_SCN_ALIGN_16BYTES = 0x00500000,
|
||||
|
||||
IMAGE_SCN_ALIGN_32BYTES = 0x00600000,
|
||||
IMAGE_SCN_ALIGN_64BYTES = 0x00700000,
|
||||
IMAGE_SCN_ALIGN_128BYTES = 0x00800000,
|
||||
IMAGE_SCN_ALIGN_256BYTES = 0x00900000,
|
||||
IMAGE_SCN_ALIGN_512BYTES = 0x00A00000,
|
||||
IMAGE_SCN_ALIGN_1024BYTES = 0x00B00000,
|
||||
IMAGE_SCN_ALIGN_2048BYTES = 0x00C00000,
|
||||
IMAGE_SCN_ALIGN_4096BYTES = 0x00D00000,
|
||||
IMAGE_SCN_ALIGN_8192BYTES = 0x00E00000,
|
||||
|
||||
IMAGE_SCN_ALIGN_MASK = 0x00F00000,
|
||||
|
||||
/// <summary>
|
||||
/// Section contains extended relocations.
|
||||
/// </summary>
|
||||
IMAGE_SCN_LNK_NRELOC_OVFL = 0x01000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section can be discarded.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_DISCARDABLE = 0x02000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section is not cachable.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_NOT_CACHED = 0x04000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section is not pageable.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_NOT_PAGED = 0x08000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section is shareable.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_SHARED = 0x10000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section is executable.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_EXECUTE = 0x20000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section is readable.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_READ = 0x40000000,
|
||||
|
||||
/// <summary>
|
||||
/// Section is writeable.
|
||||
/// </summary>
|
||||
IMAGE_SCN_MEM_WRITE = 0x80000000,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// TLS index is scaled.
|
||||
/// </summary>
|
||||
IMAGE_SCN_SCALE_INDEX = 0x00000001,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Sergey Chaban <[email protected]>
|
||||
*/
|
||||
|
||||
namespace Mono.PEToolkit {
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public enum Subsystem : short {
|
||||
|
||||
/// <summary>
|
||||
/// Unknown subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_UNKNOWN
|
||||
/// </remarks>
|
||||
UNKNOWN = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Image doesn't require a subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_NATIVE
|
||||
/// </remarks>
|
||||
NATIVE = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Image runs in the Windows GUI subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_WINDOWS_GUI
|
||||
/// </remarks>
|
||||
WINDOWS_GUI = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Image runs in the Windows character subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_WINDOWS_CUI
|
||||
/// </remarks>
|
||||
WINDOWS_CUI = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Image runs in the OS/2 character subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_OS2_CUI
|
||||
/// </remarks>
|
||||
OS2_CUI = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Image runs in the Posix character subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_POSIX_CUI
|
||||
/// </remarks>
|
||||
POSIX_CUI = 7,
|
||||
|
||||
/// <summary>
|
||||
/// Image is a native Win9x driver.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_NATIVE_WINDOWS
|
||||
/// </remarks>
|
||||
NATIVE_WINDOWS = 8,
|
||||
|
||||
/// <summary>
|
||||
/// Image runs in the Windows CE subsystem.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
|
||||
/// </remarks>
|
||||
WINDOWS_CE_GUI = 9,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_EFI_APPLICATION
|
||||
/// </remarks>
|
||||
EFI_APPLICATION = 10,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
|
||||
/// </remarks>
|
||||
EFI_BOOT_SERVICE_DRIVER = 11,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
|
||||
/// </remarks>
|
||||
EFI_RUNTIME_DRIVER = 12,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_EFI_ROM
|
||||
/// </remarks>
|
||||
EFI_ROM = 13,
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// IMAGE_SUBSYSTEM_XBOX
|
||||
/// </remarks>
|
||||
XBOX = 14,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Mono.PEToolkit;
|
||||
using Mono.PEToolkit.Metadata;
|
||||
|
||||
|
||||
public sealed class MDDump {
|
||||
|
||||
private MDDump() {}
|
||||
|
||||
|
||||
public static uint Dump (string peFile)
|
||||
{
|
||||
|
||||
using (Image pe = new Image (peFile)) {
|
||||
pe.Open ();
|
||||
pe.ReadHeaders ();
|
||||
|
||||
Console.WriteLine (pe);
|
||||
|
||||
if (pe.IsCLI) {
|
||||
pe.DumpStreamHeader("#~");
|
||||
pe.DumpStreamHeader("#-");
|
||||
pe.DumpStreamHeader("#Strings");
|
||||
pe.DumpStreamHeader("#US");
|
||||
pe.DumpStreamHeader("#GUID");
|
||||
pe.DumpStreamHeader("#Blob");
|
||||
|
||||
Console.WriteLine("CLI image detected, dumping metadata tables.");
|
||||
TablesHeap tabs = pe.MetaDataRoot.TablesHeap;
|
||||
|
||||
foreach (MDTable t in tabs.Tables) {
|
||||
t.Dump (Console.Out);
|
||||
}
|
||||
|
||||
/*
|
||||
MethodIL il = pe.MetaDataRoot.GetMethodBody(1);
|
||||
Console.WriteLine(il);
|
||||
il.DumpHexBytecode(Console.Out);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static void Main (string [] args) {
|
||||
if (args.Length == 0) {
|
||||
Console.WriteLine ("mddump <PE file>");
|
||||
} else {
|
||||
Dump (args [0]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project name="PET" default="all" basedir=".">
|
||||
|
||||
<target name="init">
|
||||
<tstamp/>
|
||||
<echo message="Init..."/>
|
||||
<property name="debug" value="false"/>
|
||||
<property name="src.dir" value="..\src"/>
|
||||
<property name="bin.dir" value="..\bin"/>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="compile" depends="init">
|
||||
<csc target="library" output="${bin.dir}/pet.dll" debug="${debug}">
|
||||
<arg value="/unsafe"/>
|
||||
<sources basedir="..\src\PEToolkit">
|
||||
<includes name="**/*.cs"/>
|
||||
</sources>
|
||||
</csc>
|
||||
<csc target="exe" output="${bin.dir}/mddump.exe" debug="${debug}">
|
||||
<sources>
|
||||
<includes name="mddump.cs"/>
|
||||
</sources>
|
||||
<arg value="/reference:..\bin\pet.dll"/>
|
||||
</csc>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="all" depends="init,compile">
|
||||
</target>
|
||||
|
||||
</project>
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
@echo off
|
||||
set X=cscript //nologo xslt.wsf /inFile:data\md-schema.xml
|
||||
|
||||
: dir /b /on *.cs > common.src
|
||||
:cscript //nologo xslt.wsf /inFile:bitconv-types.xml /styleFile:bitconverter.xsl
|
||||
|
||||
|
||||
%X% /styleFile:table-id.xsl > code\TableId.cs
|
||||
%X% /styleFile:coded-id.xsl > code\CodedTokenId.cs
|
||||
%X% /styleFile:elem-type.xsl > code\ElementType.cs
|
||||
%X% /styleFile:tabs-decoder.xsl > code\TabsDecoder.cs
|
||||
%X% /styleFile:tabs-base.xsl > code\TablesHeapBase.cs
|
||||
%X% /styleFile:rows.xsl > code\Rows.cs
|
||||
%X% /styleFile:tabs.xsl > code\Tables.cs
|
||||
Loaded 100 of 1200 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user