mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-11 03:49:40 +01:00
Compare commits
957 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61cac54a92 | ||
|
|
f84e5c27ae | ||
|
|
c6e94d7497 | ||
|
|
05752298fa | ||
|
|
37946da7f0 | ||
|
|
c75fdc77ac | ||
|
|
8535ebcde0 | ||
|
|
04b30b778e | ||
|
|
781c673b59 | ||
|
|
ac2b8241a3 | ||
|
|
884fa55e95 | ||
|
|
98551c5874 | ||
|
|
bdf5a70edb | ||
|
|
9fed0f85fa | ||
|
|
df056e86c7 | ||
|
|
faf975f3d3 | ||
|
|
3a5d99bd97 | ||
|
|
ef906c89ce | ||
|
|
97a6b4b6e8 | ||
|
|
b5abced08b | ||
|
|
59726118ff | ||
|
|
9425da39e5 | ||
|
|
38c494e569 | ||
|
|
77a4ce5569 | ||
|
|
6750549bb0 | ||
|
|
950ddf6143 | ||
|
|
8ce6a3fbf9 | ||
|
|
356fb57e35 | ||
|
|
4fa873392e | ||
|
|
d9b7356004 | ||
|
|
f75bc2e199 | ||
|
|
eb80cad549 | ||
|
|
713c85dda8 | ||
|
|
93a052bab3 | ||
|
|
2414951dd3 | ||
|
|
050eb5168e | ||
|
|
b72b8e194e | ||
|
|
b74c7b3808 | ||
|
|
7cd6e230ea | ||
|
|
8911e12adf | ||
|
|
ae06986c80 | ||
|
|
7ba83041b1 | ||
|
|
171e39a058 | ||
|
|
d0a89bf0ce | ||
|
|
86b46f2113 | ||
|
|
94d3e22c87 | ||
|
|
2907a0c10f | ||
|
|
d053ad2a28 | ||
|
|
918f015f18 | ||
|
|
9a87fa5db9 | ||
|
|
89d052603d | ||
|
|
236fc341a2 | ||
|
|
154d04e929 | ||
|
|
b3c7ed26d3 | ||
|
|
421567fdaa | ||
|
|
511a59c696 | ||
|
|
828d2063d2 | ||
|
|
2e4abcea23 | ||
|
|
7b22402218 | ||
|
|
35dc8be1bf | ||
|
|
943bd88ce1 | ||
|
|
593a00095a | ||
|
|
6567b83f0d | ||
|
|
35177d7db2 | ||
|
|
e261fe353f | ||
|
|
bca41270b5 | ||
|
|
c088a428f4 | ||
|
|
9ebc4f39bc | ||
|
|
128c2160bd | ||
|
|
3c9fec70eb | ||
|
|
5b2fed9809 | ||
|
|
6b708cf6e0 | ||
|
|
4e8c9ce308 | ||
|
|
db8bf59fdf | ||
|
|
8d2d630525 | ||
|
|
82f7d021b6 | ||
|
|
4606c00f0d | ||
|
|
7866abdf81 | ||
|
|
aa78ad11f8 | ||
|
|
46a623ec88 | ||
|
|
2e15c5911f | ||
|
|
f0e73ec3ba | ||
|
|
aeddcfd53b | ||
|
|
c5867cb71b | ||
|
|
b243475fd2 | ||
|
|
65206f2480 | ||
|
|
70b26044ba | ||
|
|
4d75d57692 | ||
|
|
455fe4836b | ||
|
|
31330fc47a | ||
|
|
697213ff2f | ||
|
|
4d0bc0dc58 | ||
|
|
f3e16f597b | ||
|
|
babef4b53a | ||
|
|
407bc5f8c6 | ||
|
|
5adedccb9c | ||
|
|
0412d28787 | ||
|
|
a92ce06fe1 | ||
|
|
189059a474 | ||
|
|
ae7beed0c2 | ||
|
|
9e5da0ad31 | ||
|
|
79c091f287 | ||
|
|
dbbea72a0a | ||
|
|
4de6d2c42c | ||
|
|
22e2c128a2 | ||
|
|
69ee819808 | ||
|
|
7d74801ce2 | ||
|
|
b44696200e | ||
|
|
401d1f315d | ||
|
|
c3e43ab7d5 | ||
|
|
c51ea967ce | ||
|
|
0f54c50638 | ||
|
|
454b9ff071 | ||
|
|
a5b76975f0 | ||
|
|
0d9fffd773 | ||
|
|
2f5e08742a | ||
|
|
41447ec765 | ||
|
|
475c6f42ad | ||
|
|
1e1174e0be | ||
|
|
1aa6c27298 | ||
|
|
379967b492 | ||
|
|
a181e6d505 | ||
|
|
2242377c11 | ||
|
|
d9cd2f6ad3 | ||
|
|
2ec1224ff0 | ||
|
|
fc336457e7 | ||
|
|
f73c8f1408 | ||
|
|
9db6479318 | ||
|
|
1430ceb19d | ||
|
|
a68c69fd65 | ||
|
|
addd95f165 | ||
|
|
5d0afe6210 | ||
|
|
ebdab667c3 | ||
|
|
91fe401ca7 | ||
|
|
9849742625 | ||
|
|
c7b4f35a3d | ||
|
|
6723fac299 | ||
|
|
e0a29cc0f1 | ||
|
|
83ceccf920 | ||
|
|
2849834a45 | ||
|
|
b67e4eeabf | ||
|
|
6a85dd0d01 | ||
|
|
6190b6e12e | ||
|
|
2f0d1e1f6e | ||
|
|
4cdcd6dc13 | ||
|
|
3baff284ba | ||
|
|
3662485748 | ||
|
|
867e1720c2 | ||
|
|
ceb27542a7 | ||
|
|
5e2fe0e935 | ||
|
|
b04bec8156 | ||
|
|
7d6b4b81de | ||
|
|
6c0e480427 | ||
|
|
7fe4d602a6 | ||
|
|
556ff23124 | ||
|
|
46b80b3416 | ||
|
|
010f640069 | ||
|
|
94853afaee | ||
|
|
e1f180f82e | ||
|
|
a6be16446d | ||
|
|
a65f7e7df0 | ||
|
|
4f3800def1 | ||
|
|
32091fcb1b | ||
|
|
b1d7c46e14 | ||
|
|
a99c6a7fe5 | ||
|
|
1823b93919 | ||
|
|
a4e10d2aad | ||
|
|
c9bae7b335 | ||
|
|
5b60a94e4f | ||
|
|
ef56e8fdec | ||
|
|
748083843a | ||
|
|
a9a7cc3a23 | ||
|
|
15108cd14e | ||
|
|
4bec822d40 | ||
|
|
76d8a6b8c2 | ||
|
|
5116181e1f | ||
|
|
8391257f03 | ||
|
|
3c0b52b10b | ||
|
|
db23197574 | ||
|
|
72cb4c459e | ||
|
|
2b100092d0 | ||
|
|
c5b26e35c5 | ||
|
|
0e378a1283 | ||
|
|
838b7a1706 | ||
|
|
d2b27faad4 | ||
|
|
e788a0e536 | ||
|
|
7a28d6291d | ||
|
|
3cbe22f256 | ||
|
|
d0a0df54ed | ||
|
|
7659fe9df2 | ||
|
|
4b638cf955 | ||
|
|
ff36c9800e | ||
|
|
1ba4dd5979 | ||
|
|
112317dbe3 | ||
|
|
f167bb36ab | ||
|
|
16bd2e1298 | ||
|
|
bc576240bc | ||
|
|
999837eb30 | ||
|
|
a3a42c48e8 | ||
|
|
737b863ce4 | ||
|
|
dc1c8a5cd7 | ||
|
|
e3e8231629 | ||
|
|
37aa83449e | ||
|
|
242e864599 | ||
|
|
bffaa53287 | ||
|
|
87cc6fe4e6 | ||
|
|
3a216a7fdc | ||
|
|
af6002665d | ||
|
|
4dd999e1ee | ||
|
|
4994fe0840 | ||
|
|
6190b5040a | ||
|
|
6cd495e473 | ||
|
|
715db0beb3 | ||
|
|
6c39105c60 | ||
|
|
916da4ac2c | ||
|
|
b87df9f9e1 | ||
|
|
f3236a879e | ||
|
|
0960629d28 | ||
|
|
b6a841d5a3 | ||
|
|
9abb185430 | ||
|
|
19bc54290f | ||
|
|
1909e5f9d6 | ||
|
|
9ae41399f1 | ||
|
|
817e260afc | ||
|
|
86b53b9dd7 | ||
|
|
618b36f5eb | ||
|
|
999f094f2a | ||
|
|
528aec3f18 | ||
|
|
bd2109d3fa | ||
|
|
f21ded8eea | ||
|
|
0bd26c4c5b | ||
|
|
0eab6d54ad | ||
|
|
14d7f14432 | ||
|
|
c2043f5ac9 | ||
|
|
ae0385ccc0 | ||
|
|
ae5f0fafc4 | ||
|
|
1270c69088 | ||
|
|
66c2fc6e66 | ||
|
|
f932d844c1 | ||
|
|
85067f7869 | ||
|
|
9c01455eb6 | ||
|
|
176ce8de18 | ||
|
|
f5f12c7995 | ||
|
|
e161c78dc3 | ||
|
|
02472faab5 | ||
|
|
093d1163e4 | ||
|
|
776841b1bc | ||
|
|
37cdc7b1f8 | ||
|
|
aaac35b3d7 | ||
|
|
c26ee9d321 | ||
|
|
5262142601 | ||
|
|
f5518d2c81 | ||
|
|
84144898c1 | ||
|
|
e19091b0b1 | ||
|
|
3b1ccee969 | ||
|
|
b097b0d234 | ||
|
|
c44210c971 | ||
|
|
5b7d451617 | ||
|
|
a1ade22dc0 | ||
|
|
9f8e932d41 | ||
|
|
13505fc4e5 | ||
|
|
50efb858e0 | ||
|
|
fd02968ebe | ||
|
|
b660eb6528 | ||
|
|
76fa595599 | ||
|
|
adf04b176e | ||
|
|
1caebc408d | ||
|
|
a26b355e8b | ||
|
|
899bcf76ae | ||
|
|
18e1157d3b | ||
|
|
bed9464bce | ||
|
|
98d3004bd9 | ||
|
|
7ecb0fd433 | ||
|
|
b0dc9de25e | ||
|
|
7bdfa989ff | ||
|
|
20b2cd4890 | ||
|
|
960480c53d | ||
|
|
8eaa894f7c | ||
|
|
61e56e8ead | ||
|
|
1a74b23a2f | ||
|
|
c84424d4af | ||
|
|
c52a86e9c7 | ||
|
|
4e9403c378 | ||
|
|
f5666f9a69 | ||
|
|
9f2721bfb1 | ||
|
|
8936d472bd | ||
|
|
11923f546e | ||
|
|
5c31bde4c0 | ||
|
|
b3a313fa2b | ||
|
|
944e1b9636 | ||
|
|
a04fad868e | ||
|
|
0248a98842 | ||
|
|
fe92862089 | ||
|
|
445b8d2438 | ||
|
|
f688068adf | ||
|
|
68d2d95f00 | ||
|
|
d02f5d5667 | ||
|
|
c6e54df5d6 | ||
|
|
b6a6791e0e | ||
|
|
63fe735683 | ||
|
|
38697490b4 | ||
|
|
797ef55129 | ||
|
|
2ff5bb1c92 | ||
|
|
a9754a7eb0 | ||
|
|
f58612a3ad | ||
|
|
78a060dbde | ||
|
|
6715b64842 | ||
|
|
f99a5d722e | ||
|
|
b7511e7609 | ||
|
|
d1643f1833 | ||
|
|
4dca16d202 | ||
|
|
3cc83d24ad | ||
|
|
7776fdebe7 | ||
|
|
f85789e68a | ||
|
|
c444c1faea | ||
|
|
96dbc17346 | ||
|
|
73094fada5 | ||
|
|
48a5d9cb5f | ||
|
|
1867421e9b | ||
|
|
1c711a064a | ||
|
|
8ee9639988 | ||
|
|
33ebb8d71d | ||
|
|
36b43451a7 | ||
|
|
ba7a50ebcf | ||
|
|
b8b9434a9f | ||
|
|
96495bc664 | ||
|
|
0685f8e938 | ||
|
|
a8305fc6e6 | ||
|
|
17992b9ac9 | ||
|
|
0ae708ca99 | ||
|
|
f179e269b9 | ||
|
|
98e5a4b393 | ||
|
|
2f5be3ab0d | ||
|
|
406f72e5e9 | ||
|
|
3e1c15cc0a | ||
|
|
90b971a60d | ||
|
|
7a31c1d5f3 | ||
|
|
3c22954800 | ||
|
|
6e3b8650b7 | ||
|
|
e84b39e459 | ||
|
|
bcaa703a49 | ||
|
|
ec9e303630 | ||
|
|
835c35dc91 | ||
|
|
56baa11720 | ||
|
|
b799a85392 | ||
|
|
fc7f562588 | ||
|
|
60f0c3f6fc | ||
|
|
410fa3840e | ||
|
|
b08ac437b7 | ||
|
|
fbc01baf4a | ||
|
|
4e3d30888f | ||
|
|
4b358696a6 | ||
|
|
9946dda799 | ||
|
|
5a8e8cf6b4 | ||
|
|
9ed09d08f5 | ||
|
|
9ff7a57a0f | ||
|
|
73b1aee3f4 | ||
|
|
6fd868a306 | ||
|
|
8c1621ee38 | ||
|
|
5bbf5f39fc | ||
|
|
937b7d2fba | ||
|
|
eb68b33185 | ||
|
|
1a03134bc8 | ||
|
|
53ae53637d | ||
|
|
b70f9bfef4 | ||
|
|
d56a0e26bf | ||
|
|
11cd94d40b | ||
|
|
7b43f3402c | ||
|
|
88ec03b622 | ||
|
|
e3f64880d0 | ||
|
|
9ff6dfb849 | ||
|
|
debd718fc1 | ||
|
|
556f6dfebb | ||
|
|
5eb01d191d | ||
|
|
1d1641be2f | ||
|
|
78a1d5e64b | ||
|
|
017e73cbd0 | ||
|
|
2f3d1da4f6 | ||
|
|
29658bd3b4 | ||
|
|
2d47fd6658 | ||
|
|
4a5a1e4404 | ||
|
|
09dadebbf1 | ||
|
|
2de23a8650 | ||
|
|
898ada48bb | ||
|
|
dc7cbef710 | ||
|
|
416b8fa159 | ||
|
|
bfe1255adc | ||
|
|
bfe250c236 | ||
|
|
345e7e8175 | ||
|
|
d73e2aa93f | ||
|
|
cbfc80d987 | ||
|
|
14b0e4eb6f | ||
|
|
3c21e13d68 | ||
|
|
3f1ccc821a | ||
|
|
872cd491a7 | ||
|
|
99fa0d1e99 | ||
|
|
68a3295c8b | ||
|
|
1d468be4b1 | ||
|
|
78fe727c6d | ||
|
|
b56b3bc9aa | ||
|
|
8d2a55d5b7 | ||
|
|
a97003cb22 | ||
|
|
be8f1b2b35 | ||
|
|
117010c6ec | ||
|
|
05a3bdceae | ||
|
|
301152ddb7 | ||
|
|
b5c0480f54 | ||
|
|
564d7d3add | ||
|
|
88eea092fb | ||
|
|
48fbf1ca88 | ||
|
|
8c52b75d0f | ||
|
|
49ba72c463 | ||
|
|
8bb4f96911 | ||
|
|
6e097b8776 | ||
|
|
d6a9902690 | ||
|
|
66b344c616 | ||
|
|
656949d014 | ||
|
|
8d2496d7de | ||
|
|
971f247b1b | ||
|
|
d867a3f9a8 | ||
|
|
80da999bf3 | ||
|
|
aa38d46a14 | ||
|
|
25c1411706 | ||
|
|
350c3e01c1 | ||
|
|
ccce3fa803 | ||
|
|
e6b61ae08a | ||
|
|
1439d121c2 | ||
|
|
7e8a3b3d11 | ||
|
|
bf12ddea85 | ||
|
|
2a904298d2 | ||
|
|
b6f45f1098 | ||
|
|
5265514689 | ||
|
|
9a4e9fe31e | ||
|
|
b1f72f6fd2 | ||
|
|
3a353cb8e0 | ||
|
|
7886b3e26b | ||
|
|
260e822459 | ||
|
|
e57875e8ab | ||
|
|
e0ece27387 | ||
|
|
390cc1d7a1 | ||
|
|
bf26c0a143 | ||
|
|
c64f5833d2 | ||
|
|
381aecb7c2 | ||
|
|
51da3d1337 | ||
|
|
b2a3c762ff | ||
|
|
5159c925af | ||
|
|
96300f3ad9 | ||
|
|
3611e527c8 | ||
|
|
8d24b760cd | ||
|
|
ff25ecbcbb | ||
|
|
dd9a6fc8eb | ||
|
|
fd17a4290b | ||
|
|
b9a88adb02 | ||
|
|
30058417e1 | ||
|
|
f5df2a2562 | ||
|
|
b496912ee1 | ||
|
|
e88e06a5e0 | ||
|
|
a695bef890 | ||
|
|
f8f9896cc7 | ||
|
|
1fb8213bb0 | ||
|
|
d273278133 | ||
|
|
c09d1ba6d7 | ||
|
|
5c9a25d2d2 | ||
|
|
4615442550 | ||
|
|
5287640ec6 | ||
|
|
7dc8dad176 | ||
|
|
d49ae7856e | ||
|
|
c023aba8f4 | ||
|
|
7d9a872e3f | ||
|
|
8edbed784d | ||
|
|
19f22d8bbc | ||
|
|
12ac02b1d3 | ||
|
|
e2244526fa | ||
|
|
b6991ff139 | ||
|
|
a433a8918d | ||
|
|
95bd43cd0a | ||
|
|
f5e3306d75 | ||
|
|
2fd9426c20 | ||
|
|
d258e2c069 | ||
|
|
32bced14f5 | ||
|
|
14251d6480 | ||
|
|
08c118806c | ||
|
|
827f8f788b | ||
|
|
2e048c5ce6 | ||
|
|
78687c4aaf | ||
|
|
0b69873d73 | ||
|
|
ff4bbcd501 | ||
|
|
07c7afeaac | ||
|
|
ee65d32c20 | ||
|
|
469a44bcd6 | ||
|
|
1db22b304c | ||
|
|
f95919ab1e | ||
|
|
8952875c84 | ||
|
|
6aeeee6b63 | ||
|
|
85c55a2aa4 | ||
|
|
af9c882b95 | ||
|
|
82f8cef55c | ||
|
|
bf91374f3f | ||
|
|
7c466c84eb | ||
|
|
20bc6a3d8c | ||
|
|
022533a749 | ||
|
|
c2f4ba73be | ||
|
|
2fb38081d5 | ||
|
|
9f6e3f08f2 | ||
|
|
9b523dc375 | ||
|
|
187c4688e0 | ||
|
|
20987e6144 | ||
|
|
1930d1f090 | ||
|
|
24b144ccd9 | ||
|
|
a8dfb771d1 | ||
|
|
ba9cf66b48 | ||
|
|
db31a896d8 | ||
|
|
61363dfe99 | ||
|
|
4c2a4c9b4a | ||
|
|
56014d30fc | ||
|
|
0691bb6c06 | ||
|
|
48a592be5a | ||
|
|
8f58ebc261 | ||
|
|
3bfd774a99 | ||
|
|
264f4dbe27 | ||
|
|
21e48ed16d | ||
|
|
403e23ec70 | ||
|
|
8ccde1a96e | ||
|
|
a89fa83b32 | ||
|
|
034705ee13 | ||
|
|
fdcad628a4 | ||
|
|
3d55cc1e02 | ||
|
|
959ddfce4a | ||
|
|
42b8720bef | ||
|
|
f44592861c | ||
|
|
dfdd79f3ee | ||
|
|
ecc2be22e3 | ||
|
|
30a25e41d2 | ||
|
|
b8d10c0a0e | ||
|
|
e0eba88c1b | ||
|
|
14c0c8eed8 | ||
|
|
bcbdbf9996 | ||
|
|
d1b60c9f04 | ||
|
|
b26473a6cf | ||
|
|
05b1c69fc0 | ||
|
|
0a5d02aaa6 | ||
|
|
5a2e0c4105 | ||
|
|
2373a63188 | ||
|
|
ab4a830be8 | ||
|
|
71666c4c5a | ||
|
|
05d4ff0383 | ||
|
|
7d28698730 | ||
|
|
464abcb4fa | ||
|
|
13c5c423d6 | ||
|
|
4e7de85e4d | ||
|
|
1ec5dfafe0 | ||
|
|
7ca3c9dd84 | ||
|
|
e7cdd4a93a | ||
|
|
73c043f49e | ||
|
|
ef7aa05f20 | ||
|
|
851ae93451 | ||
|
|
9bdfca5e56 | ||
|
|
232b814f68 | ||
|
|
c401bf065d | ||
|
|
d50e3823e4 | ||
|
|
b98a77d26c | ||
|
|
024075fabb | ||
|
|
e8d53ad94a | ||
|
|
048185ef4c | ||
|
|
b21082a545 | ||
|
|
527b0d661a | ||
|
|
44e3518c32 | ||
|
|
faea95b8d3 | ||
|
|
46677b6d86 | ||
|
|
1e1537c13f | ||
|
|
212f30a18e | ||
|
|
43c01fd8b6 | ||
|
|
710f06674d | ||
|
|
b30e5c6313 | ||
|
|
ee53020f94 | ||
|
|
6a910ea8f2 | ||
|
|
231bbf39f4 | ||
|
|
1e2b7bcabb | ||
|
|
15d1949971 | ||
|
|
ef59a25f71 | ||
|
|
4e766f0ef1 | ||
|
|
c3e1c6d07b | ||
|
|
410876d0ee | ||
|
|
fc6a9c2d07 | ||
|
|
6ff685b4c8 | ||
|
|
2fd28ebb43 | ||
|
|
59bf14707f | ||
|
|
6c172dae73 | ||
|
|
32d71c7cb9 | ||
|
|
a6fefc1cae | ||
|
|
e563c0ecf4 | ||
|
|
92053d4fb2 | ||
|
|
59318f1b2e | ||
|
|
561631ea44 | ||
|
|
bba9417038 | ||
|
|
8cf98587f7 | ||
|
|
f1442d8261 | ||
|
|
ac1a75df8c | ||
|
|
3ae3ac4f87 | ||
|
|
e1d6f09bba | ||
|
|
9cad40fca6 | ||
|
|
4f0f5861ed | ||
|
|
45f09caa8d | ||
|
|
2683bbdf2f | ||
|
|
b0b7e821de | ||
|
|
2ac871a5a1 | ||
|
|
a68198e6bc | ||
|
|
0813162608 | ||
|
|
268a4d605c | ||
|
|
3479e4412a | ||
|
|
f2dc010c16 | ||
|
|
37905fb387 | ||
|
|
b247ddfcc3 | ||
|
|
d5cad58ba3 | ||
|
|
c88c3bb683 | ||
|
|
fb6927c36c | ||
|
|
8ef946f380 | ||
|
|
285249963c | ||
|
|
62b85e6a17 | ||
|
|
b74073c0db | ||
|
|
249b55b573 | ||
|
|
be1edfbb6f | ||
|
|
83b9b38fc5 | ||
|
|
8a4107ab64 | ||
|
|
76953b4d1e | ||
|
|
d8233ec657 | ||
|
|
724f325f44 | ||
|
|
826105d548 | ||
|
|
ea5819f8d3 | ||
|
|
19982b2e80 | ||
|
|
925fe9142b | ||
|
|
218dc713ff | ||
|
|
58d8702881 | ||
|
|
574897c629 | ||
|
|
57ef7ce075 | ||
|
|
574016d0d3 | ||
|
|
305cf1f98b | ||
|
|
ac96c41fe8 | ||
|
|
681e6c377e | ||
|
|
0336a57511 | ||
|
|
c572f25040 | ||
|
|
5900e641b0 | ||
|
|
c95d492268 | ||
|
|
dab327e501 | ||
|
|
4eee363f14 | ||
|
|
e84e88f4c9 | ||
|
|
919ef8e0df | ||
|
|
8f73f7d041 | ||
|
|
3720c9565f | ||
|
|
2023570fb1 | ||
|
|
62634823f9 | ||
|
|
fb8617f293 | ||
|
|
050d7c9d90 | ||
|
|
ceb2baae92 | ||
|
|
2a4bf8ddd8 | ||
|
|
ce66b0aad0 | ||
|
|
23ca241597 | ||
|
|
36a5ccb73f | ||
|
|
873c276a26 | ||
|
|
a0a52a2b85 | ||
|
|
67dea32d8c | ||
|
|
d9a61c7ea3 | ||
|
|
076aeb3106 | ||
|
|
bab241d2e7 | ||
|
|
750e587f23 | ||
|
|
8985a7c2ac | ||
|
|
c2bb152e6c | ||
|
|
292a819b53 | ||
|
|
014d9489bb | ||
|
|
99468dc6c0 | ||
|
|
ac9ca521ad | ||
|
|
3d09f6b621 | ||
|
|
11036fb4d5 | ||
|
|
85c0519ca6 | ||
|
|
be500502ec | ||
|
|
631c9a9bad | ||
|
|
d1a58e452a | ||
|
|
de47c5722f | ||
|
|
6101f88a80 | ||
|
|
dea2648931 | ||
|
|
7a0ded349d | ||
|
|
329bc97900 | ||
|
|
31aa060b11 | ||
|
|
ea33ae6c4d | ||
|
|
05a047b442 | ||
|
|
920d11993c | ||
|
|
4d8014cefa | ||
|
|
581f36e1cc | ||
|
|
eb1726c151 | ||
|
|
2cc65f1eb7 | ||
|
|
3b65d23bc8 | ||
|
|
0b84b16b84 | ||
|
|
1333948266 | ||
|
|
e13466742d | ||
|
|
78b547afa7 | ||
|
|
83473ea55d | ||
|
|
db8ced219f | ||
|
|
233a9042cf | ||
|
|
37d83019d0 | ||
|
|
16990e896a | ||
|
|
ddbfa5fe53 | ||
|
|
5712b216b4 | ||
|
|
7add1f152d | ||
|
|
8b7a8d75b3 | ||
|
|
bd2303d9e4 | ||
|
|
ab34438938 | ||
|
|
1831def9cc | ||
|
|
58f1fb6ecd | ||
|
|
da5499f4ed | ||
|
|
eaa663b241 | ||
|
|
2b800f01d9 | ||
|
|
fe5aed65c2 | ||
|
|
2708349f7c | ||
|
|
f13dbb00cf | ||
|
|
6c6a537471 | ||
|
|
812262d16b | ||
|
|
3562a0b06d | ||
|
|
302a583c08 | ||
|
|
eea117f3e5 | ||
|
|
3f02516d3e | ||
|
|
a4a897ce52 | ||
|
|
a9f424c887 | ||
|
|
e618b1556c | ||
|
|
898965f458 | ||
|
|
b61bb15030 | ||
|
|
8734c66d55 | ||
|
|
82206bd7f5 | ||
|
|
ac8a131b61 | ||
|
|
4bc9ed2c1f | ||
|
|
2195d1d5e4 | ||
|
|
8da1d4a40c | ||
|
|
81a6d7fb01 | ||
|
|
7eb8af5534 | ||
|
|
0050c5b4fb | ||
|
|
26b2bbe306 | ||
|
|
9d47280d2a | ||
|
|
111ddcc827 | ||
|
|
bae6c82c7a | ||
|
|
d701ede8bb | ||
|
|
854e269f20 | ||
|
|
c2e77030a1 | ||
|
|
7cadb57785 | ||
|
|
8f90cd0025 | ||
|
|
d907dfa21e | ||
|
|
4a1c674d5b | ||
|
|
a2966dd62d | ||
|
|
6b4b68a145 | ||
|
|
7ee6242d0c | ||
|
|
81e9d881ca | ||
|
|
01ea5d17ec | ||
|
|
38f3a59c9a | ||
|
|
97d1424b48 | ||
|
|
d0830009e8 | ||
|
|
932c29e08e | ||
|
|
da8ccb9375 | ||
|
|
823c749bd1 | ||
|
|
9bf4d2f978 | ||
|
|
64ef3bfccc | ||
|
|
71b457cb97 | ||
|
|
b543c19bac | ||
|
|
4f2891ca8d | ||
|
|
2ccecb9e10 | ||
|
|
79896f3eaf | ||
|
|
7c22c50e9e | ||
|
|
34d99c6b39 | ||
|
|
545ef0e5fe | ||
|
|
7ecc657cee | ||
|
|
f9329eb66f | ||
|
|
0c6cb9cdc2 | ||
|
|
f7f0768c22 | ||
|
|
15cde403c4 | ||
|
|
ad121b14cb | ||
|
|
6b6febce98 | ||
|
|
665fca9d60 | ||
|
|
320ce960ce | ||
|
|
757d9cdeb9 | ||
|
|
4484857b50 | ||
|
|
9101ca61f5 | ||
|
|
907f0724ce | ||
|
|
b3fa7187ae | ||
|
|
7d2ccf3a21 | ||
|
|
c78a8aad38 | ||
|
|
40c0ad3990 | ||
|
|
fe52eb5992 | ||
|
|
018fbffe54 | ||
|
|
bdcffc23f7 | ||
|
|
d843dec3b7 | ||
|
|
2b389730e2 | ||
|
|
c2b707c559 | ||
|
|
ba0917c531 | ||
|
|
676769c08f | ||
|
|
45c58805e7 | ||
|
|
9f5b40123d | ||
|
|
34e1726860 | ||
|
|
c3cd43825b | ||
|
|
ebc0ebf54d | ||
|
|
fcd28bdcc5 | ||
|
|
411b70d54a | ||
|
|
8cd63a75f2 | ||
|
|
30b950d2d2 | ||
|
|
b342e3c536 | ||
|
|
ae80adfc10 | ||
|
|
e8860a177b | ||
|
|
b29b479461 | ||
|
|
0b9014a9d6 | ||
|
|
733d5fdd65 | ||
|
|
97a071dc3d | ||
|
|
cb255a0269 | ||
|
|
b28f16c910 | ||
|
|
2447f369f6 | ||
|
|
daaeb20eff | ||
|
|
a320378fac | ||
|
|
3f92d0764c | ||
|
|
b5148d30e2 | ||
|
|
0a2347e0ba | ||
|
|
7d8f623180 | ||
|
|
89b8658977 | ||
|
|
6c80586b40 | ||
|
|
1a9e6be809 | ||
|
|
a25db953cc | ||
|
|
fe8363948e | ||
|
|
93b845e21b | ||
|
|
327a6cf1b7 | ||
|
|
fc0efc91c8 | ||
|
|
f3c57efb11 | ||
|
|
0c7d523859 | ||
|
|
25189c1a6a | ||
|
|
19303cc71d | ||
|
|
020fe75e67 | ||
|
|
fad9c0e89c | ||
|
|
7303280ef5 | ||
|
|
7cb8f824d3 | ||
|
|
27c881b2fb | ||
|
|
deceb833bf | ||
|
|
4de970006b | ||
|
|
9bb5656e4b | ||
|
|
83321b989a | ||
|
|
5231fef61c | ||
|
|
c2bdb49b75 | ||
|
|
d9ecc2ea0c | ||
|
|
d3f071dc73 | ||
|
|
67db0ba236 | ||
|
|
c727c73cce | ||
|
|
251a9ff39c | ||
|
|
77ebf3cbc1 | ||
|
|
ff7575383f | ||
|
|
e39be2cb45 | ||
|
|
2c17d50a8b | ||
|
|
63fd60257c | ||
|
|
698fba94ef | ||
|
|
99039568f9 | ||
|
|
4135674f92 | ||
|
|
26936d0600 | ||
|
|
8b799721ae | ||
|
|
dfb3ff9459 | ||
|
|
7014b0cced | ||
|
|
15d98b74e9 | ||
|
|
245ec829ff | ||
|
|
739b531642 | ||
|
|
fe173efccd | ||
|
|
a23a1a942b | ||
|
|
3ca765dfbd | ||
|
|
50ccbb6018 | ||
|
|
99f3285106 | ||
|
|
945d6e8f23 | ||
|
|
08f31d5198 | ||
|
|
017fe2d002 | ||
|
|
acaee2a2f4 | ||
|
|
2f7185008f | ||
|
|
c4c9a281f3 | ||
|
|
caf667de05 | ||
|
|
bd4ebc07d8 | ||
|
|
2c52089918 | ||
|
|
2b742e4081 | ||
|
|
993b92c985 | ||
|
|
7784f11d28 | ||
|
|
cef1f6c50b | ||
|
|
07484149d6 | ||
|
|
e1e509319e | ||
|
|
71e9d57ee3 | ||
|
|
d35ae9ab05 | ||
|
|
c6c424f27a | ||
|
|
a2efb1b4f5 | ||
|
|
311e57397d | ||
|
|
0c53c5de50 | ||
|
|
246e4e8daf | ||
|
|
f36a46aea4 | ||
|
|
7e7ea2a295 | ||
|
|
a8b9e9a36d | ||
|
|
8bbf26bc89 | ||
|
|
3243aaf47a | ||
|
|
ddf4b86c57 | ||
|
|
164350cecf | ||
|
|
643a6b824c | ||
|
|
3d269485fc | ||
|
|
ff9829969f | ||
|
|
12801c40c5 | ||
|
|
e40b456a27 | ||
|
|
dd47345d51 | ||
|
|
df21b0860f | ||
|
|
3cb7831567 | ||
|
|
eb0f10508f | ||
|
|
d8e79f1ce1 | ||
|
|
51ceb76240 | ||
|
|
b501e8fdc4 | ||
|
|
569e8ef170 | ||
|
|
24e583d55f | ||
|
|
311f43d5a6 | ||
|
|
33e2b39ed3 | ||
|
|
440f8df1ec | ||
|
|
6f5991fa38 | ||
|
|
dca6998949 | ||
|
|
98762d6ee0 | ||
|
|
958099576a | ||
|
|
be64e9b087 | ||
|
|
d1398dfca7 | ||
|
|
3780f56b0f | ||
|
|
07d6fc6bd1 | ||
|
|
d093c6fbb6 | ||
|
|
f92370665e | ||
|
|
eb67f3f1da | ||
|
|
7dde39f4f5 | ||
|
|
6ddbe35ee2 | ||
|
|
b9b5963522 | ||
|
|
103aa32912 | ||
|
|
52caa8646b | ||
|
|
7749e896e7 | ||
|
|
1d3d850ee0 | ||
|
|
695e6ab2e0 | ||
|
|
39edc8d2b5 | ||
|
|
90f2168fa2 | ||
|
|
8e50f0daf9 | ||
|
|
e3b2bdd16f | ||
|
|
ec9f5edf2f | ||
|
|
c1be65b49c | ||
|
|
d3ccd20d1f | ||
|
|
f50507bccf | ||
|
|
25e301ca19 | ||
|
|
526b1f405c | ||
|
|
df49c04239 | ||
|
|
cb3cb72e07 | ||
|
|
1cb7e050ff | ||
|
|
d936c96d3b | ||
|
|
42cf97b02f | ||
|
|
64bb35a5c6 | ||
|
|
c8ebc97b44 | ||
|
|
1193ef2418 | ||
|
|
2414c54cc1 | ||
|
|
f9122bd3fd | ||
|
|
ef7ede903e | ||
|
|
0c4da1ece1 | ||
|
|
1ee5b4509e | ||
|
|
e2a34e4d9e | ||
|
|
c4f31fd22e | ||
|
|
f36ef09388 | ||
|
|
69a6be0305 | ||
|
|
db7a00335a |
7
.hgtags
7
.hgtags
@@ -196,3 +196,10 @@ a41ada2ed4ef735449531c6ebe6cec593d890a1c jdk8-b71
|
||||
6725b3961f987cf40f446d1c11cd324a3bec545f jdk8-b72
|
||||
fe94b40ffd9390f6cffcdf51c0389b0e6dde0c13 jdk8-b73
|
||||
f627eff819628822a0777af8062244352f2a29cf jdk8-b74
|
||||
f1478a6d25fddd311a84dcbfac50824cc1858bdd jdk8-b75
|
||||
f407160c280d1c5b00d314c535441ac26f195fee jdk8-b76
|
||||
d17eb2e13e362085e866d46235314c50cc4661cc jdk8-b77
|
||||
6d3dcd34b5b962ea1ef9eed0dafdee9e812401bc jdk8-b78
|
||||
a1313a8d90d17d363a3b2a645dc4030ec204b168 jdk8-b79
|
||||
3fa21fbf9be7e6b482af43aacb6a09acfa30bdb6 jdk8-b80
|
||||
e41d716405b209d3eddef8bd4240cec2bd34dcca jdk8-b81
|
||||
|
||||
@@ -196,3 +196,10 @@ cdb401a60cea6ad5ef3f498725ed1decf8dda1ea jdk8-b68
|
||||
c1be681d80a1f1c848dc671d664fccb19e046a12 jdk8-b72
|
||||
93b9664f97eeb6f89397a8842318ebacaac9feb9 jdk8-b73
|
||||
b43aa5bd8ca5c8121336495382d35ecfa7a71536 jdk8-b74
|
||||
2a713921952cbd77a1e699626976cb6cdfe3e57e jdk8-b75
|
||||
278af9fc67e7eba2884936b49ec07345f423aabb jdk8-b76
|
||||
3933eebc659d58c597aa8cb4b3e58f2250ce3e1a jdk8-b77
|
||||
fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78
|
||||
91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
|
||||
907a926d3c96472f357617b48b6b968ea855c23c jdk8-b80
|
||||
145dbc56f931c134e837b675b9e6e7bf08902e93 jdk8-b81
|
||||
|
||||
7
Makefile
7
Makefile
@@ -90,6 +90,7 @@ include ./make/corba-rules.gmk
|
||||
include ./make/jaxp-rules.gmk
|
||||
include ./make/jaxws-rules.gmk
|
||||
include ./make/jdk-rules.gmk
|
||||
include ./make/nashorn-rules.gmk
|
||||
include ./make/install-rules.gmk
|
||||
include ./make/sponsors-rules.gmk
|
||||
include ./make/deploy-rules.gmk
|
||||
@@ -174,6 +175,11 @@ ifeq ($(BUILD_JDK), true)
|
||||
clobber:: jdk-clobber
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_NASHORN), true)
|
||||
generic_build_repo_series:: $(NASHORN)
|
||||
clobber:: nashorn-clobber
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_DEPLOY), true)
|
||||
generic_build_repo_series:: $(DEPLOY)
|
||||
clobber:: deploy-clobber
|
||||
@@ -336,6 +342,7 @@ deploy_fastdebug_only:
|
||||
BUILD_HOTSPOT=false \
|
||||
BUILD_JDK=false \
|
||||
BUILD_LANGTOOLS=false \
|
||||
BUILD_NASHORN=false \
|
||||
BUILD_CORBA=false \
|
||||
BUILD_JAXP=false \
|
||||
BUILD_JAXWS=false \
|
||||
|
||||
@@ -96,6 +96,7 @@ help:
|
||||
$(info . make all # Compile everything, all repos and images)
|
||||
$(info . make images # Create complete j2sdk and j2re images)
|
||||
$(info . make overlay-images # Create limited images for sparc 64 bit platforms)
|
||||
$(info . make profiles # Create complete j2re compact profile images)
|
||||
$(info . make bootcycle-images # Build images twice, second time with newly build JDK)
|
||||
$(info . make install # Install the generated images locally)
|
||||
$(info . make clean # Remove all files generated by make, but not those)
|
||||
|
||||
39
README
39
README
@@ -1,45 +1,40 @@
|
||||
README:
|
||||
This file should be located at the top of the OpenJDK Mercurial root
|
||||
repository. This root repository will include a "make" directory,
|
||||
and a Makefile for building the entire OpenJDK.
|
||||
A full OpenJDK repository set (forest) should also include the following
|
||||
6 nested repositories:
|
||||
repository. A full OpenJDK repository set (forest) should also include
|
||||
the following 6 nested repositories:
|
||||
"jdk", "hotspot", "langtools", "corba", "jaxws" and "jaxp".
|
||||
There are also several source downloads for the jax* repositories that
|
||||
will be needed.
|
||||
|
||||
This one root repository can be obtained with something like:
|
||||
|
||||
The root repository can be obtained with something like:
|
||||
hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
|
||||
|
||||
To make sure you have all the nested repositories, you can run the
|
||||
get_source.sh script located in the same respository as this file:
|
||||
|
||||
You can run the get_source.sh script located in the root repository to get
|
||||
the other needed repositories:
|
||||
cd openjdk8 && sh ./get_source.sh
|
||||
|
||||
People unfamiliar with Mercurial should read the first few chapters of
|
||||
the Mercurial book: http://hgbook.red-bean.com/read/
|
||||
|
||||
See http://openjdk.java.net/ for more information about the OpenJDK.
|
||||
See http://openjdk.java.net/ for more information about OpenJDK.
|
||||
|
||||
Simple Build Instructions:
|
||||
|
||||
0. Get the necessary system software/packages installed on your system, see
|
||||
http://hg.openjdk.java.net/jdk8/build/raw-file/tip/README-builds.html
|
||||
http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
|
||||
|
||||
1. If you don't have a jdk6 installed, download and install a JDK 6 from
|
||||
1. If you don't have a jdk7u7 or newer jdk, download and install it from
|
||||
http://java.sun.com/javase/downloads/index.jsp
|
||||
Set the environment variable ALT_BOOTDIR to the location of JDK 6.
|
||||
Add the /bin directory of this installation to your PATH environment
|
||||
variable.
|
||||
|
||||
2. Check the sanity of doing a build with your current system:
|
||||
make sanity
|
||||
See README-builds.html if you run into problems.
|
||||
2. Configure the build:
|
||||
bash ./configure
|
||||
|
||||
3. Do a complete build of the OpenJDK:
|
||||
3. Build the OpenJDK:
|
||||
make all
|
||||
The resulting JDK image should be found in build/*/j2sdk-image
|
||||
The resulting JDK image should be found in build/*/images/j2sdk-image
|
||||
|
||||
where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually
|
||||
is 3.81 or newer.
|
||||
is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".
|
||||
|
||||
Complete details are available in README-builds.html.
|
||||
Complete details are available in the file:
|
||||
http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
|
||||
|
||||
4480
README-builds.html
4480
README-builds.html
File diff suppressed because it is too large
Load Diff
@@ -47,10 +47,6 @@ AC_DEFUN([BPERF_CHECK_CORES],
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
# For c/c++ code we run twice as many concurrent build
|
||||
# jobs than we have cores, otherwise we will stall on io.
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
|
||||
if test "x$FOUND_CORES" = xyes; then
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
else
|
||||
@@ -98,32 +94,62 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_CORES],
|
||||
[
|
||||
# How many cores do we have on this build system?
|
||||
AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores],
|
||||
# How many cores do we have on this build system?
|
||||
AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores],
|
||||
[number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])])
|
||||
if test "x$with_num_cores" = x; then
|
||||
if test "x$with_num_cores" = x; then
|
||||
# The number of cores were not specified, try to probe them.
|
||||
BPERF_CHECK_CORES
|
||||
else
|
||||
else
|
||||
NUM_CORES=$with_num_cores
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
fi
|
||||
AC_SUBST(NUM_CORES)
|
||||
AC_SUBST(CONCURRENT_BUILD_JOBS)
|
||||
fi
|
||||
AC_SUBST(NUM_CORES)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_MEMORY],
|
||||
[
|
||||
# How much memory do we have on this build system?
|
||||
AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size],
|
||||
# How much memory do we have on this build system?
|
||||
AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size],
|
||||
[memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])])
|
||||
if test "x$with_memory_size" = x; then
|
||||
if test "x$with_memory_size" = x; then
|
||||
# The memory size was not specified, try to probe it.
|
||||
BPERF_CHECK_MEMORY_SIZE
|
||||
else
|
||||
else
|
||||
MEMORY_SIZE=$with_memory_size
|
||||
fi
|
||||
AC_SUBST(MEMORY_SIZE)
|
||||
fi
|
||||
AC_SUBST(MEMORY_SIZE)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
|
||||
[
|
||||
# Provide a decent default number of parallel jobs for make depending on
|
||||
# number of cores, amount of memory and machine architecture.
|
||||
AC_ARG_WITH(jobs, [AS_HELP_STRING([--with-jobs],
|
||||
[number of parallel jobs to let make run @<:@calculated based on cores and memory@:>@])])
|
||||
if test "x$with_jobs" = x; then
|
||||
# Number of jobs was not specified, calculate.
|
||||
AC_MSG_CHECKING([for appropriate number of jobs to run in parallel])
|
||||
# Approximate memory in GB, rounding up a bit.
|
||||
memory_gb=`expr $MEMORY_SIZE / 1100`
|
||||
# Pick the lowest of memory in gb and number of cores.
|
||||
if test "$memory_gb" -lt "$NUM_CORES"; then
|
||||
JOBS="$memory_gb"
|
||||
else
|
||||
JOBS="$NUM_CORES"
|
||||
# On bigger machines, leave some room for other processes to run
|
||||
if test "$JOBS" -gt "4"; then
|
||||
JOBS=`expr $JOBS '*' 90 / 100`
|
||||
fi
|
||||
fi
|
||||
# Cap number of jobs to 16
|
||||
if test "$JOBS" -gt "16"; then
|
||||
JOBS=16
|
||||
fi
|
||||
AC_MSG_RESULT([$JOBS])
|
||||
else
|
||||
JOBS=$with_jobs
|
||||
fi
|
||||
AC_SUBST(JOBS)
|
||||
])
|
||||
|
||||
AC_DEFUN([BPERF_SETUP_CCACHE],
|
||||
|
||||
@@ -194,6 +194,7 @@ BASIC_COMPILE_FIXPATH
|
||||
###############################################################################
|
||||
|
||||
JDKOPT_SETUP_BUILD_TWEAKS
|
||||
JDKOPT_DETECT_INTREE_EC
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@@ -204,6 +205,7 @@ JDKOPT_SETUP_BUILD_TWEAKS
|
||||
|
||||
BPERF_SETUP_BUILD_CORES
|
||||
BPERF_SETUP_BUILD_MEMORY
|
||||
BPERF_SETUP_BUILD_JOBS
|
||||
|
||||
# Setup smart javac (after cores and memory have been setup)
|
||||
BPERF_SETUP_SMART_JAVAC
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -174,7 +174,7 @@ printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n"
|
||||
|
||||
printf "\n"
|
||||
printf "Build performance summary:\n"
|
||||
printf "* Cores to use: $NUM_CORES\n"
|
||||
printf "* Cores to use: $JOBS\n"
|
||||
printf "* Memory limit: $MEMORY_SIZE MB\n"
|
||||
printf "* ccache status: $CCACHE_STATUS\n"
|
||||
printf "\n"
|
||||
|
||||
@@ -80,7 +80,7 @@ ALT_EXPORT_PATH=$(HOTSPOT_DIST)
|
||||
|
||||
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@
|
||||
# This is used from the libjvm build for C/C++ code.
|
||||
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
HOTSPOT_BUILD_JOBS:=$(JOBS)
|
||||
# Control wether Hotspot runs Queens test after building
|
||||
TEST_IN_BUILD=@TEST_IN_BUILD@
|
||||
|
||||
|
||||
@@ -364,6 +364,25 @@ else
|
||||
fi
|
||||
AC_SUBST(UNLIMITED_CRYPTO)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Enable or disable the elliptic curve crypto implementation
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
|
||||
[
|
||||
AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
|
||||
|
||||
if test -d "${SRC_ROOT}/jdk/src/share/native/sun/security/ec/impl"; then
|
||||
ENABLE_INTREE_EC=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
ENABLE_INTREE_EC=no
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_SUBST(ENABLE_INTREE_EC)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Compress jars
|
||||
|
||||
@@ -182,7 +182,7 @@ CFLAGS="$CFLAGS $X_CFLAGS"
|
||||
# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
|
||||
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h],
|
||||
[X11_A_OK=yes],
|
||||
[X11_A_OK=no],
|
||||
[X11_A_OK=no; break],
|
||||
[ # include <X11/Xlib.h>
|
||||
# include <X11/Xutil.h>
|
||||
])
|
||||
|
||||
@@ -33,12 +33,14 @@ CORBA_TOPDIR="$SRC_ROOT/corba"
|
||||
JAXP_TOPDIR="$SRC_ROOT/jaxp"
|
||||
JAXWS_TOPDIR="$SRC_ROOT/jaxws"
|
||||
HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
|
||||
NASHORN_TOPDIR="$SRC_ROOT/nashorn"
|
||||
JDK_TOPDIR="$SRC_ROOT/jdk"
|
||||
AC_SUBST(LANGTOOLS_TOPDIR)
|
||||
AC_SUBST(CORBA_TOPDIR)
|
||||
AC_SUBST(JAXP_TOPDIR)
|
||||
AC_SUBST(JAXWS_TOPDIR)
|
||||
AC_SUBST(HOTSPOT_TOPDIR)
|
||||
AC_SUBST(NASHORN_TOPDIR)
|
||||
AC_SUBST(JDK_TOPDIR)
|
||||
])
|
||||
|
||||
@@ -233,7 +235,18 @@ if test "x$with_override_hotspot" != x; then
|
||||
fi
|
||||
AC_MSG_CHECKING([if hotspot should be overridden])
|
||||
AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
|
||||
fi
|
||||
fi
|
||||
if test "x$with_override_nashorn" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_nashorn"
|
||||
NASHORN_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $NASHORN_TOPDIR/makefiles/BuildNashorn.gmk; then
|
||||
AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if nashorn should be overridden])
|
||||
AC_MSG_RESULT([yes with $NASHORN_TOPDIR])
|
||||
fi
|
||||
if test "x$with_override_jdk" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_jdk"
|
||||
|
||||
@@ -141,6 +141,7 @@ CORBA_TOPDIR:=@CORBA_TOPDIR@
|
||||
JAXP_TOPDIR:=@JAXP_TOPDIR@
|
||||
JAXWS_TOPDIR:=@JAXWS_TOPDIR@
|
||||
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
|
||||
NASHORN_TOPDIR:=@NASHORN_TOPDIR@
|
||||
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
|
||||
|
||||
# Location where build customization files may be found
|
||||
@@ -230,6 +231,7 @@ JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
|
||||
JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
|
||||
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
|
||||
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
|
||||
NASHORN_OUTPUTDIR=$(BUILD_OUTPUT)/nashorn
|
||||
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
|
||||
JCE_OUTPUTDIR=$(BUILD_OUTPUT)/jce-release
|
||||
|
||||
@@ -238,6 +240,7 @@ CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
|
||||
JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
|
||||
JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
|
||||
HOTSPOT_DIST=@HOTSPOT_DIST@
|
||||
NASHORN_DIST=$(NASHORN_OUTPUTDIR)/dist
|
||||
|
||||
BUILD_HOTSPOT=@BUILD_HOTSPOT@
|
||||
|
||||
@@ -260,6 +263,9 @@ ENABLE_SJAVAC:=@ENABLE_SJAVAC@
|
||||
# the sjavac server log files.
|
||||
SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
|
||||
|
||||
# Number of parallel jobs to use for compilation
|
||||
JOBS?=@JOBS@
|
||||
|
||||
# The OpenJDK makefiles should be changed to using the standard
|
||||
# configure output ..._CFLAGS and ..._LIBS. In the meantime we
|
||||
# extract the information here.
|
||||
@@ -282,6 +288,13 @@ X_CFLAGS:=@X_CFLAGS@
|
||||
X_LIBS:=@X_LIBS@
|
||||
OPENWIN_HOME:=@OPENWIN_HOME@
|
||||
|
||||
# DirectX SDK
|
||||
DXSDK_LIB_PATH=@DXSDK_LIB_PATH@
|
||||
DXSDK_INCLUDE_PATH=@DXSDK_INCLUDE_PATH@
|
||||
|
||||
# The lowest required version of macosx to enforce compatiblity for
|
||||
MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
|
||||
|
||||
# There are two types: CC or CL
|
||||
# CC is gcc and others behaving reasonably similar.
|
||||
# CL is cl.exe only.
|
||||
@@ -434,6 +447,12 @@ NATIVE2ASCII=@FIXPATH@ $(BOOT_JDK)/bin/native2ascii
|
||||
|
||||
JARSIGNER=@FIXPATH@ $(BOOT_JDK)/bin/jarsigner
|
||||
|
||||
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
|
||||
BOOTSTRAP_JAVAC_JAR:=$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar
|
||||
BOOTSTRAP_JAVAC_ARGS:="-Xbootclasspath/p:$(BOOTSTRAP_JAVAC_JAR)" -cp $(BOOTSTRAP_JAVAC_JAR)
|
||||
NEW_JAVAC = $(BOOTSTRAP_JAVAC_ARGS) com.sun.tools.javac.Main
|
||||
NEW_JAVADOC = $(BOOTSTRAP_JAVAC_ARGS) com.sun.tools.javadoc.Main
|
||||
|
||||
# Base flags for RC
|
||||
# Guarding this against resetting value. Legacy make files include spec multiple
|
||||
# times.
|
||||
@@ -520,6 +539,7 @@ endif
|
||||
|
||||
# Build setup
|
||||
ENABLE_JFR=@ENABLE_JFR@
|
||||
ENABLE_INTREE_EC=@ENABLE_INTREE_EC@
|
||||
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
||||
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
|
||||
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
|
||||
|
||||
@@ -176,6 +176,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
|
||||
TOOLCHAIN_SETUP_DXSDK
|
||||
fi
|
||||
|
||||
AC_SUBST(MSVCR_DLL)
|
||||
@@ -248,30 +249,38 @@ fi
|
||||
|
||||
### Locate C compiler (CC)
|
||||
|
||||
# gcc is almost always present, but on Windows we
|
||||
# prefer cl.exe and on Solaris we prefer CC.
|
||||
# Thus test for them in this order.
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# Do not probe for cc on MacOSX.
|
||||
COMPILER_CHECK_LIST="cl gcc"
|
||||
# On windows, only cl.exe is supported.
|
||||
# On Solaris, cc is preferred to gcc.
|
||||
# Elsewhere, gcc is preferred to cc.
|
||||
|
||||
if test "x$CC" != x; then
|
||||
COMPILER_CHECK_LIST="$CC"
|
||||
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
COMPILER_CHECK_LIST="cl"
|
||||
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
COMPILER_CHECK_LIST="cc gcc"
|
||||
else
|
||||
COMPILER_CHECK_LIST="cl cc gcc"
|
||||
COMPILER_CHECK_LIST="gcc cc"
|
||||
fi
|
||||
|
||||
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
|
||||
# Now that we have resolved CC ourself, let autoconf have it's go at it
|
||||
# Now that we have resolved CC ourself, let autoconf have its go at it
|
||||
AC_PROG_CC([$CC])
|
||||
|
||||
### Locate C++ compiler (CXX)
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# Do not probe for CC on MacOSX.
|
||||
COMPILER_CHECK_LIST="cl g++"
|
||||
if test "x$CXX" != x; then
|
||||
COMPILER_CHECK_LIST="$CXX"
|
||||
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
COMPILER_CHECK_LIST="cl"
|
||||
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
COMPILER_CHECK_LIST="CC g++"
|
||||
else
|
||||
COMPILER_CHECK_LIST="cl CC g++"
|
||||
COMPILER_CHECK_LIST="g++ CC"
|
||||
fi
|
||||
|
||||
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
|
||||
# Now that we have resolved CXX ourself, let autoconf have it's go at it
|
||||
# Now that we have resolved CXX ourself, let autoconf have its go at it
|
||||
AC_PROG_CXX([$CXX])
|
||||
|
||||
### Locate other tools
|
||||
@@ -876,6 +885,17 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
|
||||
# Setting these parameters makes it an error to link to macosx APIs that are
|
||||
# newer than the given OS version and makes the linked binaries compatible even
|
||||
# if built on a newer version of the OS.
|
||||
# The expected format is X.Y.Z
|
||||
MACOSX_VERSION_MIN=10.7.0
|
||||
AC_SUBST(MACOSX_VERSION_MIN)
|
||||
# The macro takes the version with no dots, ex: 1070
|
||||
# Let the flags variables get resolved in make for easier override on make
|
||||
# command line.
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
|
||||
|
||||
@@ -262,3 +262,61 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
||||
AC_MSG_RESULT([$MSVCR_DLL])
|
||||
BASIC_FIXUP_PATH(MSVCR_DLL)
|
||||
])
|
||||
|
||||
|
||||
# Setup the DXSDK paths
|
||||
AC_DEFUN([TOOLCHAIN_SETUP_DXSDK],
|
||||
[
|
||||
AC_ARG_WITH(dxsdk, [AS_HELP_STRING([--with-dxsdk],
|
||||
[the DirectX SDK (Windows only) @<:@probed@:>@])])
|
||||
AC_ARG_WITH(dxsdk-lib, [AS_HELP_STRING([--with-dxsdk-lib],
|
||||
[the DirectX SDK lib directory (Windows only) @<:@probed@:>@])])
|
||||
AC_ARG_WITH(dxsdk-include, [AS_HELP_STRING([--with-dxsdk-include],
|
||||
[the DirectX SDK include directory (Windows only) @<:@probed@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([for DirectX SDK])
|
||||
|
||||
if test "x$with_dxsdk" != x; then
|
||||
dxsdk_path="$with_dxsdk"
|
||||
elif test "x$DXSDK_DIR" != x; then
|
||||
dxsdk_path="$DXSDK_DIR"
|
||||
elif test -d "C:/DXSDK"; then
|
||||
dxsdk_path="C:/DXSDK"
|
||||
else
|
||||
AC_MSG_ERROR([Could not find the DirectX SDK])
|
||||
fi
|
||||
AC_MSG_RESULT([$dxsdk_path])
|
||||
BASIC_FIXUP_PATH(dxsdk_path)
|
||||
|
||||
AC_MSG_CHECKING([for DirectX SDK lib dir])
|
||||
if test "x$with_dxsdk_lib" != x; then
|
||||
DXSDK_LIB_PATH="$with_dxsdk_lib"
|
||||
elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
|
||||
DXSDK_LIB_PATH="$dxsdk_path/Lib/x64"
|
||||
else
|
||||
DXSDK_LIB_PATH="$dxsdk_path/Lib"
|
||||
fi
|
||||
# dsound.lib is linked to in jsoundds
|
||||
if test ! -f "$DXSDK_LIB_PATH/dsound.lib"; then
|
||||
AC_MSG_ERROR([Invalid DirectX SDK lib dir])
|
||||
fi
|
||||
AC_MSG_RESULT([$DXSDK_LIB_PATH])
|
||||
BASIC_FIXUP_PATH(DXSDK_LIB_PATH)
|
||||
|
||||
AC_MSG_CHECKING([for DirectX SDK include dir])
|
||||
if test "x$with_dxsdk_include" != x; then
|
||||
DXSDK_INCLUDE_PATH="$with_dxsdk_include"
|
||||
else
|
||||
DXSDK_INCLUDE_PATH="$dxsdk_path/Include"
|
||||
fi
|
||||
# dsound.h is included in jsoundds
|
||||
if test ! -f "$DXSDK_INCLUDE_PATH/dsound.h"; then
|
||||
AC_MSG_ERROR([Invalid DirectX SDK lib dir])
|
||||
fi
|
||||
AC_MSG_RESULT([$DXSDK_INCLUDE_PATH])
|
||||
BASIC_FIXUP_PATH(DXSDK_INCLUDE_PATH)
|
||||
|
||||
AC_SUBST(DXSDK_LIB_PATH)
|
||||
AC_SUBST(DXSDK_INCLUDE_PATH)
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -libpath:$DXSDK_LIB_PATH"
|
||||
])
|
||||
|
||||
@@ -64,39 +64,39 @@ rm -f -r ${tmp}
|
||||
mkdir -p ${tmp}
|
||||
|
||||
safe_interrupt () {
|
||||
if [ -d ${tmp} ]; then
|
||||
if [ "`ls ${tmp}`" != "" ]; then
|
||||
echo "Waiting for processes ( `cat ${tmp}/* | tr '\n' ' '`) to terminate nicely!"
|
||||
if [ -d ${tmp} ]; then
|
||||
if [ "`ls ${tmp}/*.pid`" != "" ]; then
|
||||
echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!"
|
||||
sleep 1
|
||||
# Pipe stderr to dev/null to silence kill, that complains when trying to kill
|
||||
# a subprocess that has already exited.
|
||||
kill -TERM `cat ${tmp}/* | tr '\n' ' '` 2> /dev/null
|
||||
wait
|
||||
echo Interrupt complete!
|
||||
fi
|
||||
kill -TERM `cat ${tmp}/*.pid | tr '\n' ' '` 2> /dev/null
|
||||
wait
|
||||
echo Interrupt complete!
|
||||
fi
|
||||
fi
|
||||
rm -f -r ${tmp}
|
||||
exit 1
|
||||
}
|
||||
|
||||
nice_exit () {
|
||||
if [ -d ${tmp} ]; then
|
||||
if [ "`ls ${tmp}`" != "" ]; then
|
||||
wait
|
||||
fi
|
||||
if [ -d ${tmp} ]; then
|
||||
if [ "`ls ${tmp}`" != "" ]; then
|
||||
wait
|
||||
fi
|
||||
fi
|
||||
rm -f -r ${tmp}
|
||||
}
|
||||
|
||||
trap 'safe_interrupt' INT QUIT
|
||||
trap 'nice_exit' EXIT
|
||||
|
||||
|
||||
# Only look in specific locations for possible forests (avoids long searches)
|
||||
pull_default=""
|
||||
repos=""
|
||||
repos_extra=""
|
||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||
subrepos="corba jaxp jaxws langtools jdk hotspot"
|
||||
subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
|
||||
if [ -f .hg/hgrc ] ; then
|
||||
pull_default=`hg paths default`
|
||||
if [ "${pull_default}" = "" ] ; then
|
||||
@@ -172,14 +172,26 @@ for i in ${repos} ${repos_extra} ; do
|
||||
if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
|
||||
pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
|
||||
echo ${hg} clone ${pull_newrepo} ${i}
|
||||
${hg} clone ${pull_newrepo} ${i} &
|
||||
path="`dirname ${i}`"
|
||||
if [ "${path}" != "." ] ; then
|
||||
times=0
|
||||
while [ ! -d "${path}" ] ## nested repo, ensure containing dir exists
|
||||
do
|
||||
times=`expr ${times} '+' 1`
|
||||
if [ `expr ${times} '%' 10` -eq 0 ] ; then
|
||||
echo ${path} still not created, waiting...
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
(${hg} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
|
||||
else
|
||||
echo "cd ${i} && ${hg} $*"
|
||||
cd ${i} && ${hg} "$@" &
|
||||
fi
|
||||
cd ${i} && (${hg} "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
|
||||
fi
|
||||
echo $! > ${tmp}/${repopidfile}.pid
|
||||
) 2>&1 | sed -e "s@^@${reponame}: @") &
|
||||
|
||||
|
||||
if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
|
||||
sleep 2
|
||||
echo Waiting 5 secs before spawning next background command.
|
||||
@@ -189,6 +201,15 @@ done
|
||||
# Wait for all hg commands to complete
|
||||
wait
|
||||
|
||||
# Terminate with exit 0 all the time (hard to know when to say "failed")
|
||||
exit 0
|
||||
|
||||
# Terminate with exit 0 only if all subprocesses were successful
|
||||
ec=0
|
||||
if [ -d ${tmp} ]; then
|
||||
for rc in ${tmp}/*.pid.rc ; do
|
||||
exit_code=`cat ${rc} | tr -d ' \n\r'`
|
||||
if [ "${exit_code}" != "0" ] ; then
|
||||
echo "WARNING: ${rc} exited abnormally."
|
||||
ec=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
exit ${ec}
|
||||
|
||||
@@ -71,7 +71,7 @@ define add_idl_package
|
||||
$4
|
||||
$(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
|
||||
$(CP) -rp $3/$$($4_TMPDIR)/* $3
|
||||
($(CD) $3/$$($4_TMPDIR); find . -type f | sed 's!\./!$3/!g' | awk '{ print $$$$1 ": $4" }' > $5)
|
||||
($(CD) $3/$$($4_TMPDIR) && $(FIND) . -type f | $(SED) 's!\./!$3/!g' | $(NAWK) '{ print $$$$1 ": $4" }' > $5)
|
||||
$(RM) -rf $3/$$($4_TMPDIR)
|
||||
endef
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ endif
|
||||
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
|
||||
|
||||
define SetupJavaCompiler
|
||||
# param 1 is for example BOOT_JAVAC or NEW_JAVAC
|
||||
# This is the name later used to decide which java compiler to use.
|
||||
# param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE
|
||||
# This is the name of the compiler setup.
|
||||
# param 2-9 are named args.
|
||||
# JVM:=The jvm used to run the javac/javah command
|
||||
# JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out
|
||||
@@ -143,8 +143,8 @@ define SetupArchive
|
||||
ifneq (,$2)
|
||||
$1_DEPS:=$2
|
||||
else
|
||||
$1_DEPS:=$$(filter $$(addprefix %,$$($1_FIND_PATTERNS)),\
|
||||
$$(call CacheFind $$($1_SRCS)))
|
||||
$1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)),\
|
||||
$$(call CacheFind,$$($1_SRCS)))
|
||||
ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
|
||||
$1_DEPS:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPS))
|
||||
endif
|
||||
@@ -487,10 +487,10 @@ define SetupJavaCompilation
|
||||
# Using sjavac to compile.
|
||||
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state
|
||||
|
||||
# Create SJAVAC variable,
|
||||
# expects $1_JAVAC to be "bootclasspathprepend -jar ...javac.jar"
|
||||
# and it is rewritten into "bootclasspathprepend com.sun.tools.sjavac.Main"
|
||||
$1_SJAVAC:=$$(word 1,$$($1_JAVAC)) -cp $$(word 3,$$($1_JAVAC)) com.sun.tools.sjavac.Main
|
||||
# Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be
|
||||
# "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
|
||||
# and javac is simply replaced with sjavac.
|
||||
$1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
|
||||
|
||||
# Set the $1_REMOTE to spawn a background javac server.
|
||||
$1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
|
||||
@@ -501,7 +501,7 @@ define SetupJavaCompilation
|
||||
$(ECHO) Compiling $1
|
||||
($$($1_JVM) $$($1_SJAVAC) \
|
||||
$$($1_REMOTE) \
|
||||
-j $(NUM_CORES) \
|
||||
-j $(JOBS) \
|
||||
--permit-unidentified-artifacts \
|
||||
--permit-sources-without-package \
|
||||
--compare-found-sources $$($1_BIN)/_the.batch.tmp \
|
||||
|
||||
@@ -179,27 +179,52 @@ jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
|
||||
$(JPRT_ARCHIVE_BUNDLE): bundles
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) $@
|
||||
$(CP) $(BUILD_OUTPUT)/bundles/j2sdk-image.zip $@
|
||||
$(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
|
||||
|
||||
# This target must be called in the context of a SPEC file
|
||||
bundles: all
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
|
||||
SRC_JDK_IMAGE_DIR := $(JDK_OVERLAY_IMAGE_DIR)
|
||||
SRC_JRE_IMAGE_DIR := $(JRE_OVERLAY_IMAGE_DIR)
|
||||
else
|
||||
SRC_JDK_IMAGE_DIR := $(JDK_IMAGE_DIR)
|
||||
SRC_JRE_IMAGE_DIR := $(JRE_IMAGE_DIR)
|
||||
endif
|
||||
SRC_JDK_BUNDLE_DIR := $(JDK_BUNDLE_DIR)
|
||||
SRC_JRE_BUNDLE_DIR := $(JRE_BUNDLE_DIR)
|
||||
|
||||
# Bundle up the images
|
||||
bundles: all bundles-only
|
||||
bundles-only: start-make
|
||||
@$(call TargetEnter)
|
||||
$(MKDIR) -p $(BUILD_OUTPUT)/bundles
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
|
||||
$(CD) $(JDK_OVERLAY_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2sdk-image.zip .
|
||||
$(CD) $(JRE_OVERLAY_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2re-image.zip .
|
||||
else
|
||||
$(CD) $(JDK_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2sdk-image.zip .
|
||||
$(CD) $(JRE_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/j2re-image.zip .
|
||||
$(CD) $(SRC_JDK_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip .
|
||||
$(CD) $(SRC_JRE_IMAGE_DIR) && $(ZIP) -q -r $(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
|
||||
if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
|
||||
$(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -q -r $(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
|
||||
fi
|
||||
@$(call TargetExit)
|
||||
|
||||
# Copy images to one unified location regardless of platform etc.
|
||||
final-images: all final-images-only
|
||||
final-images-only: start-make
|
||||
@$(call TargetEnter)
|
||||
$(RM) -r $(BUILD_OUTPUT)/final-images
|
||||
$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)
|
||||
$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)
|
||||
$(CP) -R -P $(SRC_JDK_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_IMAGE_SUBDIR)/
|
||||
$(CP) -R -P $(SRC_JRE_IMAGE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_IMAGE_SUBDIR)/
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)
|
||||
$(MKDIR) -p $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)
|
||||
$(CP) -R -P $(SRC_JDK_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JDK_BUNDLE_SUBDIR)/
|
||||
$(CP) -R -P $(SRC_JRE_BUNDLE_DIR)/* $(BUILD_OUTPUT)/final-images/$(JRE_BUNDLE_SUBDIR)/
|
||||
endif
|
||||
@$(call TargetExit)
|
||||
|
||||
|
||||
# Keep track of phony targets
|
||||
PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
|
||||
jprt_build_generic bundles jprt_bundle
|
||||
jprt_build_generic bundles jprt_bundle \
|
||||
final-images final-images-only
|
||||
|
||||
###########################################################################
|
||||
# Phony targets
|
||||
|
||||
@@ -58,9 +58,6 @@ $(eval $(call ResetAllTimers))
|
||||
|
||||
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
|
||||
# hence this workaround.
|
||||
ifeq ($(JOBS),)
|
||||
JOBS=$(NUM_CORES)
|
||||
endif
|
||||
MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS)
|
||||
|
||||
### Main targets
|
||||
@@ -75,7 +72,14 @@ ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
|
||||
all: overlay-images
|
||||
endif
|
||||
|
||||
start-make:
|
||||
# Setup a rule for SPEC file that fails if executed. This check makes sure the configuration
|
||||
# is up to date after changes to configure
|
||||
$(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
|
||||
@$(ECHO) ERROR: $(SPEC) is not up to date
|
||||
@$(ECHO) Please rerun configure!
|
||||
@if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
|
||||
|
||||
start-make: $(SPEC)
|
||||
@$(call AtMakeStart)
|
||||
|
||||
langtools: langtools-only
|
||||
@@ -116,13 +120,21 @@ jdk-only: start-make
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
|
||||
@$(call TargetExit)
|
||||
|
||||
nashorn: jdk nashorn-only
|
||||
nashorn-only: start-make
|
||||
@$(call TargetEnter)
|
||||
@($(CD) $(NASHORN_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
|
||||
@$(call TargetExit)
|
||||
|
||||
demos: jdk demos-only
|
||||
demos-only: start-make
|
||||
@$(call TargetEnter)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos)
|
||||
@$(call TargetExit)
|
||||
|
||||
images: source-tips demos images-only
|
||||
# Note: This double-colon rule is intentional, to support
|
||||
# custom make file integration.
|
||||
images:: source-tips demos nashorn images-only
|
||||
images-only: start-make
|
||||
@$(call TargetEnter)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
|
||||
@@ -134,6 +146,17 @@ overlay-images-only: start-make
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
|
||||
@$(call TargetExit)
|
||||
|
||||
profiles: profiles-oscheck source-tips jdk hotspot profiles-only
|
||||
profiles-only: start-make
|
||||
@$(call TargetEnter)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
|
||||
@$(call TargetExit)
|
||||
|
||||
profiles-oscheck:
|
||||
ifneq ($(OPENJDK_TARGET_OS), linux)
|
||||
@echo "Error: The Java SE 8 Compact Profiles are only implemented for Linux at this time" && exit 1
|
||||
endif
|
||||
|
||||
install: images install-only
|
||||
install-only: start-make
|
||||
@$(call TargetEnter)
|
||||
@@ -158,9 +181,10 @@ bootcycle-images:
|
||||
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
|
||||
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
|
||||
|
||||
test: start-make
|
||||
test: images test-only
|
||||
test-only: start-make
|
||||
@$(call TargetEnter)
|
||||
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) MAKEFLAGS= -j1 PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
|
||||
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
|
||||
@$(call TargetExit)
|
||||
|
||||
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
|
||||
@@ -173,7 +197,7 @@ $(OUTPUT_ROOT)/source_tips: FRC
|
||||
|
||||
|
||||
# Remove everything, except the output from configure.
|
||||
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build clean-docs
|
||||
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs
|
||||
@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
|
||||
@$(ECHO) Cleaned all build artifacts.
|
||||
|
||||
@@ -203,6 +227,8 @@ clean-hotspot:
|
||||
$(call CleanComponent,hotspot)
|
||||
clean-jdk:
|
||||
$(call CleanComponent,jdk)
|
||||
clean-nashorn:
|
||||
$(call CleanComponent,nashorn)
|
||||
clean-images:
|
||||
$(call CleanComponent,images)
|
||||
clean-overlay-images:
|
||||
@@ -213,9 +239,10 @@ clean-docs:
|
||||
$(call CleanComponent,docs)
|
||||
$(call CleanComponent,docstemp)
|
||||
|
||||
.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install
|
||||
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only
|
||||
.PHONY: langtools corba jaxp jaxws hotspot jdk nashorn images overlay-images install
|
||||
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only nashorn-only images-only overlay-images-only install-only
|
||||
.PHONY: all test clean dist-clean bootcycle-images start-make
|
||||
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build
|
||||
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build
|
||||
.PHONY: profiles profiles-only profiles-oscheck
|
||||
|
||||
FRC: # Force target
|
||||
|
||||
@@ -51,8 +51,9 @@ decompress_paths=$(SED) -f $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-
|
||||
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
|
||||
-e 's|X00|X|g' | tr '\n' '$2'
|
||||
|
||||
# Subst in an extra $ to prevent it from disappearing.
|
||||
define ListPathsSafely_If
|
||||
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(wordlist $3,$4,$($1)))))
|
||||
$(if $(word $3,$($1)),$(eval $1_LPS$3:=$(call compress_paths,$(subst $$,$$$$,$(wordlist $3,$4,$($1))))))
|
||||
endef
|
||||
|
||||
define ListPathsSafely_Printf
|
||||
|
||||
@@ -128,9 +128,9 @@ CORE_PKGS = \
|
||||
java.text \
|
||||
java.text.spi \
|
||||
java.time \
|
||||
java.time.temporal \
|
||||
java.time.calendar \
|
||||
java.time.chrono \
|
||||
java.time.format \
|
||||
java.time.temporal \
|
||||
java.time.zone \
|
||||
java.util \
|
||||
java.util.concurrent \
|
||||
|
||||
@@ -46,14 +46,11 @@ HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_OUTPUTDIR)/docs
|
||||
|
||||
BUILD_NUMBER=$(JDK_BUILD_NUMBER)
|
||||
|
||||
BOOT_JAVA_CMD=$(JAVA)
|
||||
|
||||
JAVADOC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javadoc.jar
|
||||
JAVADOC_CMD = $(BOOT_JAVA_CMD) \
|
||||
JAVADOC_CMD = $(JAVA) \
|
||||
-Xmx1024m \
|
||||
-Djava.awt.headless=true \
|
||||
"-Xbootclasspath/p:$(JAVADOC_JAR)" \
|
||||
-jar $(JAVADOC_JAR) -bootclasspath $(JDK_OUTPUTDIR)/classes
|
||||
$(NEW_JAVADOC) \
|
||||
-bootclasspath $(JDK_OUTPUTDIR)/classes
|
||||
|
||||
# Copyright year for beginning of Java and some of the apis
|
||||
# (Needed when creating the javadocs)
|
||||
@@ -270,6 +267,7 @@ COMMON_JAVADOCFLAGS = \
|
||||
-use \
|
||||
-keywords \
|
||||
-Xdoclint:none \
|
||||
-Xprofilespath $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt \
|
||||
$(ADDITIONAL_JAVADOCFLAGS)
|
||||
|
||||
ifdef OPENJDK
|
||||
|
||||
@@ -80,7 +80,8 @@ JCONSOLE_PKGS = com.sun.tools.jconsole
|
||||
|
||||
TREEAPI_PKGS = com.sun.source.doctree \
|
||||
com.sun.source.tree \
|
||||
com.sun.source.util
|
||||
com.sun.source.util \
|
||||
jdk
|
||||
|
||||
SMARTCARDIO_PKGS = javax.smartcardio
|
||||
|
||||
@@ -93,6 +94,8 @@ APPLE_EXT_PKGS = com.apple.concurrent \
|
||||
com.apple.eio
|
||||
endif
|
||||
|
||||
JDK_PKGS = jdk
|
||||
|
||||
# non-core packages in rt.jar
|
||||
NON_CORE_PKGS = $(DOMAPI_PKGS) \
|
||||
$(MGMT_PKGS) \
|
||||
@@ -103,5 +106,5 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \
|
||||
$(HTTPSERVER_PKGS) \
|
||||
$(SMARTCARDIO_PKGS) \
|
||||
$(SCTPAPI_PKGS) \
|
||||
$(APPLE_EXT_PKGS)
|
||||
|
||||
$(APPLE_EXT_PKGS) \
|
||||
$(JDK_PKGS)
|
||||
|
||||
@@ -196,3 +196,10 @@ d54dc53e223ed9ce7d5f4d2cd02ad9d5def3c2db jdk8-b59
|
||||
cb40427f47145b01b7e53c3e02b38ff7625efbda jdk8-b72
|
||||
191afde59e7be0e1a1d76d06f2a32ff17444f0ec jdk8-b73
|
||||
2132845cf5f717ff5c240a2431c0c0e03e66e3a5 jdk8-b74
|
||||
d4e68ce17795601017ac2f952baad7272942c36e jdk8-b75
|
||||
58be6ca3c0603882a1ec478724e337aac85e0da0 jdk8-b76
|
||||
35684a40c5845782324dbcc9ac8969528020ff61 jdk8-b77
|
||||
27d6368ae8ba570c31c2f0e696d39c99fa2f4538 jdk8-b78
|
||||
e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79
|
||||
5f3d4a6bdd027a1631d97e2dfff63fd5e46987a4 jdk8-b80
|
||||
2a00aeeb466b9dee22508f6261f63b70f9c696fe jdk8-b81
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@@ -29,10 +29,6 @@ com_sun_corba_se_impl_orbutil_java = \
|
||||
com/sun/corba/se/impl/orbutil/DenseIntMapImpl.java \
|
||||
com/sun/corba/se/impl/orbutil/GetPropertyAction.java \
|
||||
com/sun/corba/se/impl/orbutil/HexOutputStream.java \
|
||||
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3.java \
|
||||
com/sun/corba/se/impl/orbutil/IIOPInputStream_1_3_1.java \
|
||||
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3.java \
|
||||
com/sun/corba/se/impl/orbutil/IIOPOutputStream_1_3_1.java \
|
||||
com/sun/corba/se/impl/orbutil/LegacyHookGetFields.java \
|
||||
com/sun/corba/se/impl/orbutil/LegacyHookPutFields.java \
|
||||
com/sun/corba/se/impl/orbutil/LogKeywords.java \
|
||||
@@ -45,19 +41,11 @@ com_sun_corba_se_impl_orbutil_java = \
|
||||
com/sun/corba/se/impl/orbutil/ORBUtility.java \
|
||||
com/sun/corba/se/impl/orbutil/ORBClassLoader.java \
|
||||
com/sun/corba/se/impl/orbutil/RepIdDelegator.java \
|
||||
com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3.java \
|
||||
com/sun/corba/se/impl/orbutil/RepIdDelegator_1_3_1.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryId_1_3.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryIdFactory.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryIdStrings.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryIdUtility.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryIdInterface.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryIdCache_1_3_1.java \
|
||||
com/sun/corba/se/impl/orbutil/RepositoryId_1_3_1.java \
|
||||
com/sun/corba/se/impl/orbutil/StackImpl.java \
|
||||
com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3_1.java \
|
||||
com/sun/corba/se/impl/orbutil/ValueHandlerImpl_1_3.java \
|
||||
com/sun/corba/se/impl/orbutil/closure/Future.java \
|
||||
com/sun/corba/se/impl/orbutil/closure/Constant.java \
|
||||
com/sun/corba/se/impl/orbutil/concurrent/Sync.java \
|
||||
|
||||
@@ -35,8 +35,6 @@ include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include IdlCompilation.gmk
|
||||
|
||||
JAVAC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar" \
|
||||
-jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar
|
||||
# The Corba sources are old and generates a LOT of warnings.
|
||||
# Disable these using Xlint, until someone cares to fix them.
|
||||
DISABLE_CORBA_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,-cast,-rawtypes,-static,-dep-ann
|
||||
@@ -46,7 +44,7 @@ DISABLE_CORBA_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-serial,-fallthrough,
|
||||
# Thus we force the target bytecode to the boot jdk bytecode.
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\
|
||||
JVM:=$(JAVA),\
|
||||
JAVAC:=$(JAVAC_JARS),\
|
||||
JAVAC:=$(NEW_JAVAC),\
|
||||
FLAGS:=$(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_CORBA_WARNINGS),\
|
||||
SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
|
||||
SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
|
||||
@@ -56,7 +54,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE,\
|
||||
# cannot necessarily be run with the boot jdk.
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE,\
|
||||
JVM:=$(JAVA),\
|
||||
JAVAC:=$(JAVAC_JARS),\
|
||||
JAVAC:=$(NEW_JAVAC),\
|
||||
FLAGS:=-cp $(BOOT_TOOLSJAR) -XDignore.symbol.file=true $(DISABLE_CORBA_WARNINGS),\
|
||||
SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
|
||||
SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -322,9 +322,9 @@ class ServerCallback extends
|
||||
com.sun.corba.se.spi.activation._ServerImplBase
|
||||
{
|
||||
private ORB orb;
|
||||
private Method installMethod ;
|
||||
private Method uninstallMethod ;
|
||||
private Method shutdownMethod ;
|
||||
private transient Method installMethod ;
|
||||
private transient Method uninstallMethod ;
|
||||
private transient Method shutdownMethod ;
|
||||
private Object methodArgs[] ;
|
||||
|
||||
ServerCallback(ORB orb, Method installMethod, Method uninstallMethod,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -1218,7 +1218,7 @@ public class AnyImpl extends Any
|
||||
// See bug 4391648 for more info about the tcORB in this
|
||||
// case.
|
||||
RepositoryIdStrings repStrs
|
||||
= RepositoryIdFactory.getRepIdStringsFactory(tcORB);
|
||||
= RepositoryIdFactory.getRepIdStringsFactory();
|
||||
|
||||
|
||||
// Assertion: c instanceof Serializable?
|
||||
@@ -1251,7 +1251,7 @@ public class AnyImpl extends Any
|
||||
// Anything else
|
||||
// We know that this is a TypeCodeImpl since it is our ORB
|
||||
classTC = (TypeCodeImpl)ValueUtility.createTypeCodeForClass(
|
||||
tcORB, c, ORBUtility.createValueHandler(tcORB));
|
||||
tcORB, c, ORBUtility.createValueHandler());
|
||||
// Intruct classTC to store its buffer
|
||||
classTC.setCaching(true);
|
||||
// Update the cache
|
||||
|
||||
@@ -2189,10 +2189,7 @@ public final class TypeCodeImpl extends TypeCode
|
||||
|
||||
if (labelIndex == _unionLabels.length) {
|
||||
// check if label has not been found
|
||||
if (_defaultIndex == -1)
|
||||
// throw exception if default was not expected
|
||||
throw wrapper.unexpectedUnionDefault() ;
|
||||
else
|
||||
if (_defaultIndex != -1)
|
||||
// must be of the default branch type
|
||||
_memberTypes[_defaultIndex].copy(src, dst);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -269,8 +269,8 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
||||
|
||||
private final void createRepositoryIdHandlers()
|
||||
{
|
||||
repIdUtil = RepositoryIdFactory.getRepIdUtility(orb);
|
||||
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory(orb);
|
||||
repIdUtil = RepositoryIdFactory.getRepIdUtility();
|
||||
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory();
|
||||
}
|
||||
|
||||
public GIOPVersion getGIOPVersion() {
|
||||
@@ -564,10 +564,7 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
||||
|
||||
checkForNegativeLength(len);
|
||||
|
||||
if (orb != null && ORBUtility.isLegacyORB((ORB)orb))
|
||||
return legacyReadString(len);
|
||||
else
|
||||
return internalReadString(len);
|
||||
return internalReadString(len);
|
||||
}
|
||||
|
||||
private final String internalReadString(int len) {
|
||||
@@ -588,54 +585,6 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
||||
return new String(result, 0, getCharConverter().getNumChars());
|
||||
}
|
||||
|
||||
private final String legacyReadString(int len) {
|
||||
|
||||
//
|
||||
// Workaround for ORBs which send string lengths of
|
||||
// zero to mean empty string.
|
||||
//
|
||||
//
|
||||
// IMPORTANT: Do not replace 'new String("")' with "", it may result
|
||||
// in a Serialization bug (See serialization.zerolengthstring) and
|
||||
// bug id: 4728756 for details
|
||||
if (len == 0)
|
||||
return new String("");
|
||||
|
||||
len--;
|
||||
char[] c = new char[len];
|
||||
|
||||
int n = 0;
|
||||
while (n < len) {
|
||||
int avail;
|
||||
int bytes;
|
||||
int wanted;
|
||||
|
||||
avail = bbwi.buflen - bbwi.position();
|
||||
if (avail <= 0) {
|
||||
grow(1, 1);
|
||||
avail = bbwi.buflen - bbwi.position();
|
||||
}
|
||||
wanted = len - n;
|
||||
bytes = (wanted < avail) ? wanted : avail;
|
||||
// Microbenchmarks are showing a loop of ByteBuffer.get(int) being
|
||||
// faster than ByteBuffer.get(byte[], int, int).
|
||||
for (int i=0; i<bytes; i++) {
|
||||
c[n+i] = (char) (bbwi.byteBuffer.get(bbwi.position()+i) & 0xFF);
|
||||
}
|
||||
bbwi.position(bbwi.position() + bytes);
|
||||
n += bytes;
|
||||
}
|
||||
|
||||
//
|
||||
// Skip past terminating null byte
|
||||
//
|
||||
if (bbwi.position() + 1 > bbwi.buflen)
|
||||
alignAndCheck(1, 1);
|
||||
bbwi.position(bbwi.position() + 1);
|
||||
|
||||
return new String(c);
|
||||
}
|
||||
|
||||
public final String read_string() {
|
||||
return readStringOrIndirection(false);
|
||||
}
|
||||
@@ -1045,7 +994,7 @@ public class CDRInputStream_1_0 extends CDRInputStreamBase
|
||||
|
||||
try {
|
||||
if (valueHandler == null)
|
||||
valueHandler = ORBUtility.createValueHandler(orb);
|
||||
valueHandler = ORBUtility.createValueHandler();
|
||||
|
||||
value = valueHandler.readValue(parent,
|
||||
indirection,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -189,18 +189,8 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
|
||||
|
||||
private final void createRepositoryIdHandlers()
|
||||
{
|
||||
if (orb != null) {
|
||||
// Get the appropriate versions based on the ORB version. The
|
||||
// ORB versioning info is only in the core ORB.
|
||||
repIdUtil
|
||||
= RepositoryIdFactory.getRepIdUtility(orb);
|
||||
repIdStrs
|
||||
= RepositoryIdFactory.getRepIdStringsFactory(orb);
|
||||
} else {
|
||||
// Get the latest versions
|
||||
repIdUtil = RepositoryIdFactory.getRepIdUtility();
|
||||
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory();
|
||||
}
|
||||
repIdUtil = RepositoryIdFactory.getRepIdUtility();
|
||||
repIdStrs = RepositoryIdFactory.getRepIdStringsFactory();
|
||||
}
|
||||
|
||||
public BufferManagerWrite getBufferManager()
|
||||
@@ -705,7 +695,7 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
|
||||
private void writeArray(Serializable array, Class clazz) {
|
||||
|
||||
if (valueHandler == null)
|
||||
valueHandler = ORBUtility.createValueHandler(orb); //d11638
|
||||
valueHandler = ORBUtility.createValueHandler(); //d11638
|
||||
|
||||
// Write value_tag
|
||||
int indirection = writeValueTag(mustChunk, true,
|
||||
@@ -768,7 +758,7 @@ public class CDROutputStream_1_0 extends CDROutputStreamBase
|
||||
|
||||
private void writeRMIIIOPValueType(Serializable object, Class clazz) {
|
||||
if (valueHandler == null)
|
||||
valueHandler = ORBUtility.createValueHandler(orb); //d11638
|
||||
valueHandler = ORBUtility.createValueHandler(); //d11638
|
||||
|
||||
Serializable key = object;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -86,7 +86,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
|
||||
// default to using the current ORB version in case the
|
||||
// vhandler is not set
|
||||
if (vhandler == null) {
|
||||
vhandler = new ValueHandlerImpl(false);
|
||||
vhandler = ValueHandlerImpl.getInstance(false);
|
||||
}
|
||||
|
||||
// Util.getCodebase may return null which would
|
||||
@@ -120,7 +120,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
|
||||
// default to using the current ORB version in case the
|
||||
// vhandler is not set
|
||||
if (vhandler == null) {
|
||||
vhandler = new ValueHandlerImpl(false);
|
||||
vhandler = ValueHandlerImpl.getInstance(false);
|
||||
}
|
||||
|
||||
try{
|
||||
@@ -161,7 +161,7 @@ public class FVDCodeBaseImpl extends _CodeBaseImplBase
|
||||
// default to using the current ORB version in case the
|
||||
// vhandler is not set
|
||||
if (vhandler == null) {
|
||||
vhandler = new ValueHandlerImpl(false);
|
||||
vhandler = ValueHandlerImpl.getInstance(false);
|
||||
}
|
||||
|
||||
Stack repIds = new Stack();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,7 +25,7 @@
|
||||
/*
|
||||
* Licensed Materials - Property of IBM
|
||||
* RMI-IIOP v1.0
|
||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
||||
* Copyright IBM Corp. 1998 2012 All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,6 @@ import java.io.Serializable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Hashtable;
|
||||
|
||||
import com.sun.corba.se.impl.util.RepositoryId;
|
||||
|
||||
@@ -83,8 +82,6 @@ public class ObjectStreamClass implements java.io.Serializable {
|
||||
private static Object noArgsList[] = {};
|
||||
private static Class noTypesList[] = {};
|
||||
|
||||
private static Hashtable translatedFields;
|
||||
|
||||
/** true if represents enum type */
|
||||
private boolean isEnum;
|
||||
|
||||
@@ -384,6 +381,42 @@ public class ObjectStreamClass implements java.io.Serializable {
|
||||
*/
|
||||
}
|
||||
|
||||
private static final class PersistentFieldsValue
|
||||
extends ClassValue<ObjectStreamField[]> {
|
||||
PersistentFieldsValue() { }
|
||||
|
||||
protected ObjectStreamField[] computeValue(Class<?> type) {
|
||||
try {
|
||||
Field pf = type.getDeclaredField("serialPersistentFields");
|
||||
int mods = pf.getModifiers();
|
||||
if (Modifier.isPrivate(mods) && Modifier.isStatic(mods) &&
|
||||
Modifier.isFinal(mods)) {
|
||||
pf.setAccessible(true);
|
||||
java.io.ObjectStreamField[] fields =
|
||||
(java.io.ObjectStreamField[])pf.get(type);
|
||||
return translateFields(fields);
|
||||
}
|
||||
} catch (NoSuchFieldException | IllegalAccessException |
|
||||
IllegalArgumentException | ClassCastException e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static ObjectStreamField[] translateFields(
|
||||
java.io.ObjectStreamField[] fields) {
|
||||
ObjectStreamField[] translation =
|
||||
new ObjectStreamField[fields.length];
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
translation[i] = new ObjectStreamField(fields[i].getName(),
|
||||
fields[i].getType());
|
||||
}
|
||||
return translation;
|
||||
}
|
||||
}
|
||||
|
||||
private static final PersistentFieldsValue persistentFieldsValue =
|
||||
new PersistentFieldsValue();
|
||||
|
||||
/*
|
||||
* Initialize class descriptor. This method is only invoked on class
|
||||
* descriptors created via calls to lookupInternal(). This method is kept
|
||||
@@ -416,35 +449,7 @@ public class ObjectStreamClass implements java.io.Serializable {
|
||||
* If it is declared, use the declared serialPersistentFields.
|
||||
* Otherwise, extract the fields from the class itself.
|
||||
*/
|
||||
try {
|
||||
Field pf = cl.getDeclaredField("serialPersistentFields");
|
||||
// serial bug 7; the serialPersistentFields were not
|
||||
// being read and stored as Accessible bit was not set
|
||||
pf.setAccessible(true);
|
||||
// serial bug 7; need to find if the field is of type
|
||||
// java.io.ObjectStreamField
|
||||
java.io.ObjectStreamField[] f =
|
||||
(java.io.ObjectStreamField[])pf.get(cl);
|
||||
int mods = pf.getModifiers();
|
||||
if ((Modifier.isPrivate(mods)) &&
|
||||
(Modifier.isStatic(mods)) &&
|
||||
(Modifier.isFinal(mods)))
|
||||
{
|
||||
fields = (ObjectStreamField[])translateFields((Object[])pf.get(cl));
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
fields = null;
|
||||
} catch (IllegalAccessException e) {
|
||||
fields = null;
|
||||
} catch (IllegalArgumentException e) {
|
||||
fields = null;
|
||||
} catch (ClassCastException e) {
|
||||
/* Thrown if a field serialPersistentField exists
|
||||
* but it is not of type ObjectStreamField.
|
||||
*/
|
||||
fields = null;
|
||||
}
|
||||
|
||||
fields = persistentFieldsValue.get(cl);
|
||||
|
||||
if (fields == null) {
|
||||
/* Get all of the declared fields for this
|
||||
@@ -641,43 +646,6 @@ public class ObjectStreamClass implements java.io.Serializable {
|
||||
superclass = null;
|
||||
}
|
||||
|
||||
private static Object[] translateFields(Object objs[])
|
||||
throws NoSuchFieldException {
|
||||
try{
|
||||
java.io.ObjectStreamField fields[] = (java.io.ObjectStreamField[])objs;
|
||||
Object translation[] = null;
|
||||
|
||||
if (translatedFields == null)
|
||||
translatedFields = new Hashtable();
|
||||
|
||||
translation = (Object[])translatedFields.get(fields);
|
||||
|
||||
if (translation != null)
|
||||
return translation;
|
||||
else {
|
||||
Class osfClass = Class.forName("com.sun.corba.se.impl.io.ObjectStreamField");
|
||||
translation = (Object[])java.lang.reflect.Array.newInstance(osfClass, objs.length);
|
||||
Object arg[] = new Object[2];
|
||||
Class types[] = {String.class, Class.class};
|
||||
Constructor constructor = osfClass.getDeclaredConstructor(types);
|
||||
for (int i = fields.length -1; i >= 0; i--){
|
||||
arg[0] = fields[i].getName();
|
||||
arg[1] = fields[i].getType();
|
||||
|
||||
translation[i] = constructor.newInstance(arg);
|
||||
}
|
||||
translatedFields.put(fields, translation);
|
||||
|
||||
}
|
||||
|
||||
return (Object[])translation;
|
||||
}
|
||||
catch(Throwable t){
|
||||
NoSuchFieldException nsfe = new NoSuchFieldException();
|
||||
nsfe.initCause( t ) ;
|
||||
throw nsfe ;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the class this version descriptor matches.
|
||||
@@ -1555,8 +1523,8 @@ public class ObjectStreamClass implements java.io.Serializable {
|
||||
private boolean hasExternalizableBlockData;
|
||||
Method writeObjectMethod;
|
||||
Method readObjectMethod;
|
||||
private Method writeReplaceObjectMethod;
|
||||
private Method readResolveObjectMethod;
|
||||
private transient Method writeReplaceObjectMethod;
|
||||
private transient Method readResolveObjectMethod;
|
||||
private Constructor cons ;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -53,7 +53,7 @@ import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
import com.sun.corba.se.impl.logging.OMGSystemException;
|
||||
import com.sun.corba.se.impl.logging.UtilSystemException;
|
||||
|
||||
public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat {
|
||||
public final class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat {
|
||||
|
||||
// Property to override our maximum stream format version
|
||||
public static final String FORMAT_VERSION_PROPERTY
|
||||
@@ -150,14 +150,22 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
writeValueWithVersion(out, value, streamFormatVersion);
|
||||
}
|
||||
|
||||
public ValueHandlerImpl(){}
|
||||
private ValueHandlerImpl(){}
|
||||
|
||||
public ValueHandlerImpl(boolean isInputStream) {
|
||||
private ValueHandlerImpl(boolean isInputStream) {
|
||||
this();
|
||||
useHashtables = false;
|
||||
this.isInputStream = isInputStream;
|
||||
}
|
||||
|
||||
static ValueHandlerImpl getInstance() {
|
||||
return new ValueHandlerImpl();
|
||||
}
|
||||
|
||||
static ValueHandlerImpl getInstance(boolean isInputStream) {
|
||||
return new ValueHandlerImpl(isInputStream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the value to the stream using java semantics.
|
||||
* @param out The stream to write the value to
|
||||
@@ -458,12 +466,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
return ObjectStreamClass.lookup(value.getClass()).writeReplace(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulates writing of Java char arrays so that the 1.3 subclass
|
||||
* can override it without exposing internals across packages. This
|
||||
* is a fix for bug 4367783.
|
||||
*/
|
||||
protected void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out,
|
||||
private void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out,
|
||||
char[] array,
|
||||
int offset,
|
||||
int length)
|
||||
@@ -576,12 +579,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encapsulates reading of Java char arrays so that the 1.3 subclass
|
||||
* can override it without exposing internals across packages. This
|
||||
* is a fix for bug 4367783.
|
||||
*/
|
||||
protected void readCharArray(org.omg.CORBA_2_3.portable.InputStream in,
|
||||
private void readCharArray(org.omg.CORBA_2_3.portable.InputStream in,
|
||||
char[] array,
|
||||
int offset,
|
||||
int length)
|
||||
@@ -795,7 +793,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
return RepositoryId.cache.getId(repId).isSequence();
|
||||
}
|
||||
|
||||
protected String getOutputStreamClassName() {
|
||||
private String getOutputStreamClassName() {
|
||||
return "com.sun.corba.se.impl.io.IIOPOutputStream";
|
||||
}
|
||||
|
||||
@@ -843,29 +841,11 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
private IIOPOutputStream createOutputStreamBuiltInNoPriv(
|
||||
final String name
|
||||
) throws IOException {
|
||||
return
|
||||
name.equals(
|
||||
IIOPOutputStream
|
||||
.class.getName()
|
||||
) ?
|
||||
new IIOPOutputStream() :
|
||||
|
||||
name.equals(
|
||||
com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3
|
||||
.class.getName()
|
||||
) ?
|
||||
new com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3() :
|
||||
|
||||
name.equals(
|
||||
com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1
|
||||
.class.getName()
|
||||
) ?
|
||||
new com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1() :
|
||||
|
||||
null;
|
||||
return name.equals(IIOPOutputStream.class.getName()) ?
|
||||
new IIOPOutputStream() : null;
|
||||
}
|
||||
|
||||
protected String getInputStreamClassName() {
|
||||
private String getInputStreamClassName() {
|
||||
return "com.sun.corba.se.impl.io.IIOPInputStream";
|
||||
}
|
||||
|
||||
@@ -913,26 +893,8 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
private IIOPInputStream createInputStreamBuiltInNoPriv(
|
||||
final String name
|
||||
) throws IOException {
|
||||
return
|
||||
name.equals(
|
||||
IIOPInputStream
|
||||
.class.getName()
|
||||
) ?
|
||||
new IIOPInputStream() :
|
||||
|
||||
name.equals(
|
||||
com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3
|
||||
.class.getName()
|
||||
) ?
|
||||
new com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3() :
|
||||
|
||||
name.equals(
|
||||
com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1
|
||||
.class.getName()
|
||||
) ?
|
||||
new com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1() :
|
||||
|
||||
null;
|
||||
return name.equals(IIOPInputStream.class.getName()) ?
|
||||
new IIOPInputStream() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -958,12 +920,7 @@ public class ValueHandlerImpl implements javax.rmi.CORBA.ValueHandlerMultiFormat
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
|
||||
* The correct behavior is for a Java char to map to a CORBA wchar,
|
||||
* but our older code mapped it to a CORBA char.
|
||||
*/
|
||||
protected TCKind getJavaCharTCKind() {
|
||||
TCKind getJavaCharTCKind() {
|
||||
return TCKind.tk_wchar;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -93,6 +93,14 @@ public class ValueUtility {
|
||||
null, // tk_abstract_interface 32
|
||||
};
|
||||
|
||||
static {
|
||||
sun.corba.SharedSecrets.setJavaCorbaAccess(new sun.corba.JavaCorbaAccess() {
|
||||
public ValueHandlerImpl newValueHandlerImpl() {
|
||||
return ValueHandlerImpl.getInstance();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static String getSignature(ValueMember member)
|
||||
throws ClassNotFoundException {
|
||||
|
||||
|
||||
@@ -112,6 +112,9 @@ import com.sun.corba.se.impl.util.JDKBridge;
|
||||
import com.sun.corba.se.impl.orbutil.ORBClassLoader;
|
||||
import com.sun.corba.se.impl.logging.UtilSystemException;
|
||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
import sun.corba.SharedSecrets;
|
||||
import sun.corba.JavaCorbaAccess;
|
||||
|
||||
|
||||
/**
|
||||
* Provides utility methods that can be used by stubs and ties to
|
||||
@@ -125,7 +128,8 @@ public class Util implements javax.rmi.CORBA.UtilDelegate
|
||||
// Maps targets to ties.
|
||||
private static IdentityHashtable exportedServants = new IdentityHashtable();
|
||||
|
||||
private static ValueHandlerImpl valueHandlerSingleton = new ValueHandlerImpl();
|
||||
private static final ValueHandlerImpl valueHandlerSingleton =
|
||||
SharedSecrets.getJavaCorbaAccess().newValueHandlerImpl();
|
||||
|
||||
private UtilSystemException utilWrapper = UtilSystemException.get(
|
||||
CORBALogDomains.RPC_ENCODING);
|
||||
|
||||
@@ -840,7 +840,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
// backward compatability 4365188
|
||||
CodeBase cb;
|
||||
|
||||
ValueHandler vh = ORBUtility.createValueHandler(this);
|
||||
ValueHandler vh = ORBUtility.createValueHandler();
|
||||
|
||||
cb = (CodeBase)vh.getRunTimeCodeBase();
|
||||
return ORBUtility.connectAndGetIOR( this, cb ) ;
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* Implements legacy behavior from before Ladybird to maintain
|
||||
* backwards compatibility.
|
||||
*/
|
||||
public class IIOPOutputStream_1_3 extends com.sun.corba.se.impl.io.IIOPOutputStream
|
||||
{
|
||||
// We can't assume that the superclass's putFields
|
||||
// member will be non-private. We must allow
|
||||
// the RI to run on JDK 1.3.1 FCS as well as
|
||||
// the JDK 1.3.1_01 patch.
|
||||
private ObjectOutputStream.PutField putFields_1_3;
|
||||
|
||||
// The newer version in the io package correctly writes a wstring instead.
|
||||
// This concerns bug 4379597.
|
||||
protected void internalWriteUTF(org.omg.CORBA.portable.OutputStream stream,
|
||||
String data)
|
||||
{
|
||||
stream.write_string(data);
|
||||
}
|
||||
|
||||
public IIOPOutputStream_1_3()
|
||||
throws java.io.IOException {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Before JDK 1.3.1_01, the PutField/GetField implementation
|
||||
* actually sent a Hashtable.
|
||||
*/
|
||||
public ObjectOutputStream.PutField putFields()
|
||||
throws IOException {
|
||||
putFields_1_3 = new LegacyHookPutFields();
|
||||
return putFields_1_3;
|
||||
}
|
||||
|
||||
public void writeFields()
|
||||
throws IOException {
|
||||
putFields_1_3.write(this);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -160,44 +160,12 @@ public final class ORBUtility {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the correct ValueHandler for the given ORB,
|
||||
* querying ORBVersion information. If the ORB or
|
||||
* ORBVersion is null, gets the ValueHandler from
|
||||
* Util.createValueHandler.
|
||||
* Return default ValueHandler
|
||||
*/
|
||||
public static ValueHandler createValueHandler(ORB orb) {
|
||||
|
||||
if (orb == null)
|
||||
return Util.createValueHandler();
|
||||
|
||||
ORBVersion version = orb.getORBVersion();
|
||||
|
||||
if (version == null)
|
||||
return Util.createValueHandler();
|
||||
|
||||
if (version.equals(ORBVersionFactory.getOLD()))
|
||||
return new ValueHandlerImpl_1_3();
|
||||
if (version.equals(ORBVersionFactory.getNEW()))
|
||||
return new ValueHandlerImpl_1_3_1();
|
||||
|
||||
public static ValueHandler createValueHandler() {
|
||||
return Util.createValueHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given ORB could accurately be determined to be a
|
||||
* Kestrel or earlier ORB. Note: If passed the ORBSingleton, this will return
|
||||
* false.
|
||||
*/
|
||||
public static boolean isLegacyORB(ORB orb)
|
||||
{
|
||||
try {
|
||||
ORBVersion currentORB = orb.getORBVersion();
|
||||
return currentORB.equals( ORBVersionFactory.getOLD() ) ;
|
||||
} catch (SecurityException se) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if it was accurately determined that the remote ORB is
|
||||
* a foreign (non-JavaSoft) ORB. Note: If passed the ORBSingleton, this
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -1119,8 +1119,8 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
|
||||
private boolean hasExternalizableBlockData;
|
||||
Method writeObjectMethod;
|
||||
Method readObjectMethod;
|
||||
private Method writeReplaceObjectMethod;
|
||||
private Method readResolveObjectMethod;
|
||||
private transient Method writeReplaceObjectMethod;
|
||||
private transient Method readResolveObjectMethod;
|
||||
|
||||
/*
|
||||
* ObjectStreamClass_1_3_1 that this one was built from.
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import org.omg.CORBA.ORB;
|
||||
import java.io.Serializable;
|
||||
import java.util.Hashtable;
|
||||
import java.net.MalformedURLException;
|
||||
import com.sun.corba.se.impl.io.TypeMismatchException;
|
||||
import com.sun.corba.se.impl.util.RepositoryId;
|
||||
|
||||
/**
|
||||
* Delegates to the RepositoryId_1_3 implementation in
|
||||
* com.sun.corba.se.impl.orbutil. This is necessary to
|
||||
* overcome the fact that many of RepositoryId's methods
|
||||
* are static.
|
||||
*/
|
||||
public final class RepIdDelegator_1_3
|
||||
implements RepositoryIdStrings,
|
||||
RepositoryIdUtility,
|
||||
RepositoryIdInterface
|
||||
{
|
||||
// RepositoryIdFactory methods
|
||||
|
||||
public String createForAnyType(Class type) {
|
||||
return RepositoryId_1_3.createForAnyType(type);
|
||||
}
|
||||
|
||||
public String createForJavaType(Serializable ser)
|
||||
throws TypeMismatchException
|
||||
{
|
||||
return RepositoryId_1_3.createForJavaType(ser);
|
||||
}
|
||||
|
||||
public String createForJavaType(Class clz)
|
||||
throws TypeMismatchException
|
||||
{
|
||||
return RepositoryId_1_3.createForJavaType(clz);
|
||||
}
|
||||
|
||||
public String createSequenceRepID(java.lang.Object ser) {
|
||||
return RepositoryId_1_3.createSequenceRepID(ser);
|
||||
}
|
||||
|
||||
public String createSequenceRepID(Class clazz) {
|
||||
return RepositoryId_1_3.createSequenceRepID(clazz);
|
||||
}
|
||||
|
||||
public RepositoryIdInterface getFromString(String repIdString) {
|
||||
return new RepIdDelegator_1_3(RepositoryId_1_3.cache.getId(repIdString));
|
||||
}
|
||||
|
||||
// RepositoryIdUtility methods
|
||||
|
||||
public boolean isChunkedEncoding(int valueTag) {
|
||||
return RepositoryId.isChunkedEncoding(valueTag);
|
||||
}
|
||||
|
||||
public boolean isCodeBasePresent(int valueTag) {
|
||||
return RepositoryId.isCodeBasePresent(valueTag);
|
||||
}
|
||||
|
||||
public String getClassDescValueRepId() {
|
||||
return RepositoryId_1_3.kClassDescValueRepID;
|
||||
}
|
||||
|
||||
public String getWStringValueRepId() {
|
||||
return RepositoryId_1_3.kWStringValueRepID;
|
||||
}
|
||||
|
||||
public int getTypeInfo(int valueTag) {
|
||||
return RepositoryId.getTypeInfo(valueTag);
|
||||
}
|
||||
|
||||
public int getStandardRMIChunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIChunked_NoRep;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIChunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked_NoRep;
|
||||
}
|
||||
|
||||
public int getStandardRMIChunkedId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIChunked;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIChunkedId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked;
|
||||
}
|
||||
|
||||
public int getStandardRMIUnchunkedId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIUnchunked;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIUnchunkedId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked;
|
||||
}
|
||||
|
||||
public int getStandardRMIUnchunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIUnchunked_NoRep;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIUnchunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
|
||||
}
|
||||
|
||||
// RepositoryIdInterface methods
|
||||
|
||||
public Class getClassFromType() throws ClassNotFoundException {
|
||||
return delegate.getClassFromType();
|
||||
}
|
||||
|
||||
public Class getClassFromType(String codebaseURL)
|
||||
throws ClassNotFoundException, MalformedURLException
|
||||
{
|
||||
return delegate.getClassFromType(codebaseURL);
|
||||
}
|
||||
|
||||
public Class getClassFromType(Class expectedType,
|
||||
String codebaseURL)
|
||||
throws ClassNotFoundException, MalformedURLException
|
||||
{
|
||||
return delegate.getClassFromType(expectedType, codebaseURL);
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return delegate.getClassName();
|
||||
}
|
||||
|
||||
// Constructor used for factory/utility cases
|
||||
public RepIdDelegator_1_3() {}
|
||||
|
||||
// Constructor used by getIdFromString. All non-static
|
||||
// RepositoryId methods will use the provided delegate.
|
||||
private RepIdDelegator_1_3(RepositoryId_1_3 _delegate) {
|
||||
this.delegate = _delegate;
|
||||
}
|
||||
|
||||
private RepositoryId_1_3 delegate = null;
|
||||
|
||||
public String toString() {
|
||||
if (delegate != null)
|
||||
return delegate.toString();
|
||||
else
|
||||
return this.getClass().getName();
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (delegate != null)
|
||||
return delegate.equals(obj);
|
||||
else
|
||||
return super.equals(obj);
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import org.omg.CORBA.ORB;
|
||||
import java.io.Serializable;
|
||||
import java.util.Hashtable;
|
||||
import java.net.MalformedURLException;
|
||||
import com.sun.corba.se.impl.io.TypeMismatchException;
|
||||
import com.sun.corba.se.impl.util.RepositoryId;
|
||||
|
||||
/**
|
||||
* Delegates to the RepositoryId_1_3_1 implementation in
|
||||
* com.sun.corba.se.impl.orbutil. This is necessary to
|
||||
* overcome the fact that many of RepositoryId's methods
|
||||
* are static.
|
||||
*/
|
||||
public final class RepIdDelegator_1_3_1
|
||||
implements RepositoryIdStrings,
|
||||
RepositoryIdUtility,
|
||||
RepositoryIdInterface
|
||||
{
|
||||
// RepositoryIdFactory methods
|
||||
|
||||
public String createForAnyType(Class type) {
|
||||
return RepositoryId_1_3_1.createForAnyType(type);
|
||||
}
|
||||
|
||||
public String createForJavaType(Serializable ser)
|
||||
throws TypeMismatchException
|
||||
{
|
||||
return RepositoryId_1_3_1.createForJavaType(ser);
|
||||
}
|
||||
|
||||
public String createForJavaType(Class clz)
|
||||
throws TypeMismatchException
|
||||
{
|
||||
return RepositoryId_1_3_1.createForJavaType(clz);
|
||||
}
|
||||
|
||||
public String createSequenceRepID(java.lang.Object ser) {
|
||||
return RepositoryId_1_3_1.createSequenceRepID(ser);
|
||||
}
|
||||
|
||||
public String createSequenceRepID(Class clazz) {
|
||||
return RepositoryId_1_3_1.createSequenceRepID(clazz);
|
||||
}
|
||||
|
||||
public RepositoryIdInterface getFromString(String repIdString) {
|
||||
return new RepIdDelegator_1_3_1(RepositoryId_1_3_1.cache.getId(repIdString));
|
||||
}
|
||||
|
||||
// RepositoryIdUtility methods
|
||||
|
||||
public boolean isChunkedEncoding(int valueTag) {
|
||||
return RepositoryId.isChunkedEncoding(valueTag);
|
||||
}
|
||||
|
||||
public boolean isCodeBasePresent(int valueTag) {
|
||||
return RepositoryId.isCodeBasePresent(valueTag);
|
||||
}
|
||||
|
||||
public String getClassDescValueRepId() {
|
||||
return RepositoryId_1_3_1.kClassDescValueRepID;
|
||||
}
|
||||
|
||||
public String getWStringValueRepId() {
|
||||
return RepositoryId_1_3_1.kWStringValueRepID;
|
||||
}
|
||||
|
||||
public int getTypeInfo(int valueTag) {
|
||||
return RepositoryId.getTypeInfo(valueTag);
|
||||
}
|
||||
|
||||
public int getStandardRMIChunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIChunked_NoRep;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIChunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked_NoRep;
|
||||
}
|
||||
|
||||
public int getStandardRMIChunkedId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIChunked;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIChunkedId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIChunked;
|
||||
}
|
||||
|
||||
public int getStandardRMIUnchunkedId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIUnchunked;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIUnchunkedId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked;
|
||||
}
|
||||
|
||||
public int getStandardRMIUnchunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_StandardRMIUnchunked_NoRep;
|
||||
}
|
||||
|
||||
public int getCodeBaseRMIUnchunkedNoRepStrId() {
|
||||
return RepositoryId.kPreComputed_CodeBaseRMIUnchunked_NoRep;
|
||||
}
|
||||
|
||||
// RepositoryIdInterface methods
|
||||
|
||||
public Class getClassFromType() throws ClassNotFoundException {
|
||||
return delegate.getClassFromType();
|
||||
}
|
||||
|
||||
public Class getClassFromType(String codebaseURL)
|
||||
throws ClassNotFoundException, MalformedURLException
|
||||
{
|
||||
return delegate.getClassFromType(codebaseURL);
|
||||
}
|
||||
|
||||
public Class getClassFromType(Class expectedType,
|
||||
String codebaseURL)
|
||||
throws ClassNotFoundException, MalformedURLException
|
||||
{
|
||||
return delegate.getClassFromType(expectedType, codebaseURL);
|
||||
}
|
||||
|
||||
public String getClassName() {
|
||||
return delegate.getClassName();
|
||||
}
|
||||
|
||||
// Constructor used for factory/utility cases
|
||||
public RepIdDelegator_1_3_1() {}
|
||||
|
||||
// Constructor used by getIdFromString. All non-static
|
||||
// RepositoryId methods will use the provided delegate.
|
||||
private RepIdDelegator_1_3_1(RepositoryId_1_3_1 _delegate) {
|
||||
this.delegate = _delegate;
|
||||
}
|
||||
|
||||
private RepositoryId_1_3_1 delegate = null;
|
||||
|
||||
public String toString() {
|
||||
if (delegate != null)
|
||||
return delegate.toString();
|
||||
else
|
||||
return this.getClass().getName();
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (delegate != null)
|
||||
return delegate.equals(obj);
|
||||
else
|
||||
return super.equals(obj);
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
/*
|
||||
* Licensed Materials - Property of IBM
|
||||
* RMI-IIOP v1.0
|
||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import java.util.Stack;
|
||||
import java.util.Hashtable;
|
||||
import java.util.EmptyStackException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
// Really limited pool - in this case just creating several at a time...
|
||||
class RepositoryIdPool_1_3 extends Stack {
|
||||
|
||||
private static int MAX_CACHE_SIZE = 4;
|
||||
private RepositoryIdCache_1_3 cache;
|
||||
|
||||
public final synchronized RepositoryId_1_3 popId() {
|
||||
|
||||
try {
|
||||
return (RepositoryId_1_3)super.pop();
|
||||
}
|
||||
catch(EmptyStackException e) {
|
||||
increasePool(5);
|
||||
return (RepositoryId_1_3)super.pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Pool management
|
||||
final void increasePool(int size) {
|
||||
//if (cache.size() <= MAX_CACHE_SIZE)
|
||||
for (int i = size; i > 0; i--)
|
||||
push(new RepositoryId_1_3());
|
||||
/*
|
||||
// _REVISIT_ This will not work w/out either thread tracing or weak references. I am
|
||||
// betting that thread tracing almost completely negates benefit of reuse. Until either
|
||||
// 1.2 only inclusion or proof to the contrary, I'll leave it this way...
|
||||
else {
|
||||
int numToReclaim = cache.size() / 2;
|
||||
Enumeration keys = cache.keys();
|
||||
Enumeration elements = cache.elements();
|
||||
for (int i = numToReclaim; i > 0; i--) {
|
||||
Object key = keys.nextElement();
|
||||
Object element = elements.nextElement();
|
||||
|
||||
push(element);
|
||||
cache.remove(key);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
final void setCaches(RepositoryIdCache_1_3 cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class RepositoryIdCache_1_3 extends Hashtable {
|
||||
|
||||
private RepositoryIdPool_1_3 pool = new RepositoryIdPool_1_3();
|
||||
|
||||
public RepositoryIdCache_1_3() {
|
||||
pool.setCaches(this);
|
||||
}
|
||||
|
||||
public final synchronized RepositoryId_1_3 getId(String key) {
|
||||
RepositoryId_1_3 repId = (RepositoryId_1_3)super.get(key);
|
||||
|
||||
if (repId != null)
|
||||
return repId;
|
||||
else {
|
||||
//repId = pool.popId().init(key);
|
||||
repId = new RepositoryId_1_3(key);
|
||||
put(key, repId);
|
||||
return repId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import java.util.Stack;
|
||||
import java.util.Hashtable;
|
||||
import java.util.EmptyStackException;
|
||||
import java.util.Enumeration;
|
||||
|
||||
// Really limited pool - in this case just creating several at a time...
|
||||
class RepositoryIdPool_1_3_1 extends Stack {
|
||||
|
||||
private static int MAX_CACHE_SIZE = 4;
|
||||
private RepositoryIdCache_1_3_1 cache;
|
||||
|
||||
public final synchronized RepositoryId_1_3_1 popId() {
|
||||
|
||||
try {
|
||||
return (RepositoryId_1_3_1)super.pop();
|
||||
}
|
||||
catch(EmptyStackException e) {
|
||||
increasePool(5);
|
||||
return (RepositoryId_1_3_1)super.pop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Pool management
|
||||
final void increasePool(int size) {
|
||||
//if (cache.size() <= MAX_CACHE_SIZE)
|
||||
for (int i = size; i > 0; i--)
|
||||
push(new RepositoryId_1_3_1());
|
||||
/*
|
||||
// _REVISIT_ This will not work w/out either thread tracing or weak references. I am
|
||||
// betting that thread tracing almost completely negates benefit of reuse. Until either
|
||||
// 1.2 only inclusion or proof to the contrary, I'll leave it this way...
|
||||
else {
|
||||
int numToReclaim = cache.size() / 2;
|
||||
Enumeration keys = cache.keys();
|
||||
Enumeration elements = cache.elements();
|
||||
for (int i = numToReclaim; i > 0; i--) {
|
||||
Object key = keys.nextElement();
|
||||
Object element = elements.nextElement();
|
||||
|
||||
push(element);
|
||||
cache.remove(key);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
final void setCaches(RepositoryIdCache_1_3_1 cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class RepositoryIdCache_1_3_1 extends Hashtable {
|
||||
|
||||
private RepositoryIdPool_1_3_1 pool = new RepositoryIdPool_1_3_1();
|
||||
|
||||
public RepositoryIdCache_1_3_1() {
|
||||
pool.setCaches(this);
|
||||
}
|
||||
|
||||
public final synchronized RepositoryId_1_3_1 getId(String key) {
|
||||
RepositoryId_1_3_1 repId = (RepositoryId_1_3_1)super.get(key);
|
||||
|
||||
if (repId != null)
|
||||
return repId;
|
||||
else {
|
||||
//repId = pool.popId().init(key);
|
||||
repId = new RepositoryId_1_3_1(key);
|
||||
put(key, repId);
|
||||
return repId;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -30,12 +30,6 @@ import com.sun.corba.se.spi.orb.ORB;
|
||||
|
||||
public abstract class RepositoryIdFactory
|
||||
{
|
||||
private static final RepIdDelegator_1_3 legacyDelegator
|
||||
= new RepIdDelegator_1_3();
|
||||
|
||||
private static final RepIdDelegator_1_3_1 ladybirdDelegator
|
||||
= new RepIdDelegator_1_3_1();
|
||||
|
||||
private static final RepIdDelegator currentDelegator
|
||||
= new RepIdDelegator();
|
||||
|
||||
@@ -47,29 +41,6 @@ public abstract class RepositoryIdFactory
|
||||
return currentDelegator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the version of the ORB and returns the appropriate
|
||||
* RepositoryIdStrings instance.
|
||||
*/
|
||||
public static RepositoryIdStrings getRepIdStringsFactory(ORB orb)
|
||||
{
|
||||
if (orb != null) {
|
||||
switch (orb.getORBVersion().getORBType()) {
|
||||
case ORBVersion.NEWER:
|
||||
case ORBVersion.FOREIGN:
|
||||
case ORBVersion.JDK1_3_1_01:
|
||||
return currentDelegator;
|
||||
case ORBVersion.OLD:
|
||||
return legacyDelegator;
|
||||
case ORBVersion.NEW:
|
||||
return ladybirdDelegator;
|
||||
default:
|
||||
return currentDelegator;
|
||||
}
|
||||
} else
|
||||
return currentDelegator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the latest version RepositoryIdUtility instance
|
||||
*/
|
||||
@@ -78,26 +49,4 @@ public abstract class RepositoryIdFactory
|
||||
return currentDelegator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the version of the ORB and returns the appropriate
|
||||
* RepositoryIdUtility instance.
|
||||
*/
|
||||
public static RepositoryIdUtility getRepIdUtility(ORB orb)
|
||||
{
|
||||
if (orb != null) {
|
||||
switch (orb.getORBVersion().getORBType()) {
|
||||
case ORBVersion.NEWER:
|
||||
case ORBVersion.FOREIGN:
|
||||
case ORBVersion.JDK1_3_1_01:
|
||||
return currentDelegator;
|
||||
case ORBVersion.OLD:
|
||||
return legacyDelegator;
|
||||
case ORBVersion.NEW:
|
||||
return ladybirdDelegator;
|
||||
default:
|
||||
return currentDelegator;
|
||||
}
|
||||
} else
|
||||
return currentDelegator;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,990 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
/*
|
||||
* Licensed Materials - Property of IBM
|
||||
* RMI-IIOP v1.0
|
||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.Hashtable;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
// Imports for using codebase URL to load class
|
||||
import java.net.MalformedURLException;
|
||||
import org.omg.CORBA.portable.ValueBase;
|
||||
import org.omg.CORBA.portable.IDLEntity;
|
||||
|
||||
import com.sun.corba.se.impl.util.JDKBridge;
|
||||
import com.sun.corba.se.impl.util.Utility;
|
||||
import com.sun.corba.se.impl.util.PackagePrefixChecker;
|
||||
import com.sun.corba.se.impl.util.IdentityHashtable;
|
||||
import com.sun.corba.se.impl.io.ObjectStreamClass;
|
||||
|
||||
import javax.rmi.CORBA.Util;
|
||||
|
||||
// keeping the original RepositoryId class that was shipped in
|
||||
// JDK 1.3. It has interoperability bugs
|
||||
|
||||
public class RepositoryId_1_3 {
|
||||
|
||||
// Legal IDL Identifier characters (1 = legal). Note
|
||||
// that '.' (2E) is marked as legal even though it is
|
||||
// not legal in IDL. This allows us to treat a fully
|
||||
// qualified Java name with '.' package separators
|
||||
// uniformly, and is safe because that is the only
|
||||
// legal use of '.' in a Java name.
|
||||
|
||||
public static final RepositoryIdCache_1_3 cache = new RepositoryIdCache_1_3();
|
||||
private static final byte[] IDL_IDENTIFIER_CHARS = {
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 00-0f
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 10-1f
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,0, // 20-2f
|
||||
1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0, // 30-3f
|
||||
0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 40-4f
|
||||
1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,1, // 50-5f
|
||||
0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // 60-6f
|
||||
1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0, // 70-7f
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 80-8f
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 90-9f
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // a0-af
|
||||
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // b0-bf
|
||||
1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // c0-cf
|
||||
0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // d0-df
|
||||
1,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1, // e0-ef
|
||||
0,1,1,1, 1,1,1,0, 1,1,1,1, 1,0,0,1, // f0-ff
|
||||
};
|
||||
|
||||
private static String defaultServerURL = null;
|
||||
private static boolean useCodebaseOnly = false;
|
||||
|
||||
static {
|
||||
if (defaultServerURL == null)
|
||||
defaultServerURL = (String)JDKBridge.getLocalCodebase();
|
||||
useCodebaseOnly = JDKBridge.useCodebaseOnly();
|
||||
|
||||
}
|
||||
|
||||
private static IdentityHashtable classToRepStr = new IdentityHashtable();
|
||||
private static IdentityHashtable classIDLToRepStr = new IdentityHashtable();
|
||||
private static IdentityHashtable classSeqToRepStr = new IdentityHashtable();
|
||||
|
||||
private static IdentityHashtable repStrToByteArray = new IdentityHashtable();
|
||||
private static Hashtable repStrToClass = new Hashtable();
|
||||
|
||||
private String repId = null;
|
||||
private boolean isSupportedFormat = true;
|
||||
private String typeString = null;
|
||||
private String versionString = null;
|
||||
private boolean isSequence = false;
|
||||
private boolean isRMIValueType = false;
|
||||
private boolean isIDLType = false;
|
||||
private String completeClassName = null;
|
||||
private String unqualifiedName = null;
|
||||
private String definedInId = null;
|
||||
private Class clazz = null;
|
||||
private String suid = null, actualSuid = null;
|
||||
private long suidLong = ObjectStreamClass.kDefaultUID, actualSuidLong = ObjectStreamClass.kDefaultUID;
|
||||
|
||||
// Repository ID fragments
|
||||
private static final String kValuePrefix = "RMI:";
|
||||
private static final String kIDLPrefix = "IDL:";
|
||||
private static final String kIDLNamePrefix = "omg.org/";
|
||||
private static final String kIDLClassnamePrefix = "org.omg.";
|
||||
private static final String kSequencePrefix = "[";
|
||||
private static final String kCORBAPrefix = "CORBA/";
|
||||
private static final String kArrayPrefix = kValuePrefix + kSequencePrefix + kCORBAPrefix;
|
||||
private static final int kValuePrefixLength = kValuePrefix.length();
|
||||
private static final int kIDLPrefixLength = kIDLPrefix.length();
|
||||
private static final int kSequencePrefixLength = kSequencePrefix.length();
|
||||
private static final String kInterfaceHashCode = ":0000000000000000";
|
||||
private static final String kInterfaceOnlyHashStr = "0000000000000000";
|
||||
private static final String kExternalizableHashStr = "0000000000000001";
|
||||
|
||||
// Value tag utility methods and constants
|
||||
public static final int kInitialValueTag= 0x7fffff00;
|
||||
public static final int kNoTypeInfo = 0;
|
||||
public static final int kSingleRepTypeInfo = 0x02;
|
||||
public static final int kPartialListTypeInfo = 0x06;
|
||||
public static final int kChunkedMask = 0x08;
|
||||
|
||||
// Public, well known repository IDs
|
||||
|
||||
// _REVISIT_ : A table structure with a good search routine for all of this
|
||||
// would be more efficient and easier to maintain...
|
||||
|
||||
// String
|
||||
public static final String kWStringValueVersion = "1.0";
|
||||
public static final String kWStringValueHash = ":"+kWStringValueVersion;
|
||||
public static final String kWStringStubValue = "WStringValue";
|
||||
public static final String kWStringTypeStr = "omg.org/CORBA/"+kWStringStubValue;
|
||||
public static final String kWStringValueRepID = kIDLPrefix + kWStringTypeStr + kWStringValueHash;
|
||||
|
||||
// Any
|
||||
public static final String kAnyRepID = kIDLPrefix + "omg.org/CORBA/Any";
|
||||
|
||||
// Class
|
||||
public static final String kClassDescValueHash = ":" + Long.toHexString(
|
||||
ObjectStreamClass.getSerialVersionUID(javax.rmi.CORBA.ClassDesc.class));
|
||||
public static final String kClassDescStubValue = "ClassDesc";
|
||||
public static final String kClassDescTypeStr = "javax.rmi.CORBA."+kClassDescStubValue;
|
||||
public static final String kClassDescValueRepID = kValuePrefix + kClassDescTypeStr + kClassDescValueHash;
|
||||
|
||||
// Object
|
||||
public static final String kObjectValueHash = ":1.0";
|
||||
public static final String kObjectStubValue = "Object";
|
||||
|
||||
// Sequence
|
||||
public static final String kSequenceValueHash = ":1.0";
|
||||
public static final String kPrimitiveSequenceValueHash = ":0000000000000000";
|
||||
|
||||
// Serializable
|
||||
public static final String kSerializableValueHash = ":1.0";
|
||||
public static final String kSerializableStubValue = "Serializable";
|
||||
|
||||
// Externalizable
|
||||
public static final String kExternalizableValueHash = ":1.0";
|
||||
public static final String kExternalizableStubValue = "Externalizable";
|
||||
|
||||
// Remote (The empty string is used for java.rmi.Remote)
|
||||
public static final String kRemoteValueHash = "";
|
||||
public static final String kRemoteStubValue = "";
|
||||
public static final String kRemoteTypeStr = "";
|
||||
public static final String kRemoteValueRepID = "";
|
||||
|
||||
private static final Hashtable kSpecialArrayTypeStrings = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialArrayTypeStrings.put("CORBA.WStringValue", new StringBuffer(java.lang.String.class.getName()));
|
||||
kSpecialArrayTypeStrings.put("javax.rmi.CORBA.ClassDesc", new StringBuffer(java.lang.Class.class.getName()));
|
||||
kSpecialArrayTypeStrings.put("CORBA.Object", new StringBuffer(java.rmi.Remote.class.getName()));
|
||||
|
||||
}
|
||||
|
||||
private static final Hashtable kSpecialCasesRepIDs = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialCasesRepIDs.put(java.lang.String.class, kWStringValueRepID);
|
||||
kSpecialCasesRepIDs.put(java.lang.Class.class, kClassDescValueRepID);
|
||||
kSpecialCasesRepIDs.put(java.rmi.Remote.class, kRemoteValueRepID);
|
||||
}
|
||||
|
||||
private static final Hashtable kSpecialCasesStubValues = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialCasesStubValues.put(java.lang.String.class, kWStringStubValue);
|
||||
kSpecialCasesStubValues.put(java.lang.Class.class, kClassDescStubValue);
|
||||
kSpecialCasesStubValues.put(java.lang.Object.class, kObjectStubValue);
|
||||
kSpecialCasesStubValues.put(java.io.Serializable.class, kSerializableStubValue);
|
||||
kSpecialCasesStubValues.put(java.io.Externalizable.class, kExternalizableStubValue);
|
||||
kSpecialCasesStubValues.put(java.rmi.Remote.class, kRemoteStubValue);
|
||||
}
|
||||
|
||||
|
||||
private static final Hashtable kSpecialCasesVersions = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialCasesVersions.put(java.lang.String.class, kWStringValueHash);
|
||||
kSpecialCasesVersions.put(java.lang.Class.class, kClassDescValueHash);
|
||||
kSpecialCasesVersions.put(java.lang.Object.class, kObjectValueHash);
|
||||
kSpecialCasesVersions.put(java.io.Serializable.class, kSerializableValueHash);
|
||||
kSpecialCasesVersions.put(java.io.Externalizable.class, kExternalizableValueHash);
|
||||
kSpecialCasesVersions.put(java.rmi.Remote.class, kRemoteValueHash);
|
||||
}
|
||||
|
||||
private static final Hashtable kSpecialCasesClasses = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialCasesClasses.put(kWStringTypeStr, java.lang.String.class);
|
||||
kSpecialCasesClasses.put(kClassDescTypeStr, java.lang.Class.class);
|
||||
kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
|
||||
|
||||
kSpecialCasesClasses.put("org.omg.CORBA.WStringValue", java.lang.String.class);
|
||||
kSpecialCasesClasses.put("javax.rmi.CORBA.ClassDesc", java.lang.Class.class);
|
||||
//kSpecialCasesClasses.put(kRemoteTypeStr, java.rmi.Remote.class);
|
||||
}
|
||||
|
||||
private static final Hashtable kSpecialCasesArrayPrefix = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialCasesArrayPrefix.put(java.lang.String.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
|
||||
kSpecialCasesArrayPrefix.put(java.lang.Class.class, kValuePrefix + kSequencePrefix + "javax/rmi/CORBA/");
|
||||
kSpecialCasesArrayPrefix.put(java.lang.Object.class, kValuePrefix + kSequencePrefix + "java/lang/");
|
||||
kSpecialCasesArrayPrefix.put(java.io.Serializable.class, kValuePrefix + kSequencePrefix + "java/io/");
|
||||
kSpecialCasesArrayPrefix.put(java.io.Externalizable.class, kValuePrefix + kSequencePrefix + "java/io/");
|
||||
kSpecialCasesArrayPrefix.put(java.rmi.Remote.class, kValuePrefix + kSequencePrefix + kCORBAPrefix);
|
||||
}
|
||||
|
||||
private static final Hashtable kSpecialPrimitives = new Hashtable();
|
||||
|
||||
static {
|
||||
kSpecialPrimitives.put("int","long");
|
||||
kSpecialPrimitives.put("long","longlong");
|
||||
kSpecialPrimitives.put("byte","octet");
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to convert ascii to hex.
|
||||
*/
|
||||
private static final byte ASCII_HEX[] = {
|
||||
(byte)'0',
|
||||
(byte)'1',
|
||||
(byte)'2',
|
||||
(byte)'3',
|
||||
(byte)'4',
|
||||
(byte)'5',
|
||||
(byte)'6',
|
||||
(byte)'7',
|
||||
(byte)'8',
|
||||
(byte)'9',
|
||||
(byte)'A',
|
||||
(byte)'B',
|
||||
(byte)'C',
|
||||
(byte)'D',
|
||||
(byte)'E',
|
||||
(byte)'F',
|
||||
};
|
||||
|
||||
|
||||
// Interface Rep ID Strings
|
||||
public static final String kjava_rmi_Remote = createForAnyType(java.rmi.Remote.class);
|
||||
public static final String korg_omg_CORBA_Object = createForAnyType(org.omg.CORBA.Object.class);
|
||||
|
||||
// Dummy arguments for getIdFromHelper method
|
||||
public static final Class kNoParamTypes[] ={};
|
||||
public static final Object kNoArgs[] = {};
|
||||
|
||||
|
||||
RepositoryId_1_3(){}
|
||||
|
||||
RepositoryId_1_3(String aRepId){
|
||||
init(aRepId);
|
||||
}
|
||||
|
||||
RepositoryId_1_3 init(String aRepId){
|
||||
|
||||
this.repId = aRepId;
|
||||
|
||||
// Special case for remote
|
||||
if (aRepId.length() == 0) {
|
||||
clazz = java.rmi.Remote.class;
|
||||
typeString = "";
|
||||
isRMIValueType = true;
|
||||
suid = kInterfaceOnlyHashStr;
|
||||
return this;
|
||||
}
|
||||
else if (aRepId.equals(kWStringValueRepID)) {
|
||||
clazz = java.lang.String.class;
|
||||
typeString = kWStringTypeStr;
|
||||
isIDLType = true;
|
||||
versionString = kWStringValueVersion;
|
||||
return this;
|
||||
}
|
||||
else {
|
||||
|
||||
String repId = convertFromISOLatin1(aRepId);
|
||||
|
||||
versionString = repId.substring(repId.indexOf(':', repId.indexOf(':')+1));
|
||||
if (repId.startsWith(kIDLPrefix)) {
|
||||
typeString =
|
||||
repId.substring(kIDLPrefixLength, repId.indexOf(':', kIDLPrefixLength));
|
||||
isIDLType = true;
|
||||
if (typeString.startsWith(kIDLNamePrefix))
|
||||
completeClassName = kIDLClassnamePrefix +
|
||||
typeString.substring(kIDLNamePrefix.length()).replace('/','.');
|
||||
else completeClassName = typeString.replace('/','.');
|
||||
|
||||
}
|
||||
else if (repId.startsWith(kValuePrefix)) {
|
||||
typeString =
|
||||
repId.substring(kValuePrefixLength, repId.indexOf(':', kValuePrefixLength));
|
||||
isRMIValueType = true;
|
||||
|
||||
if (versionString.indexOf('.') == -1) {
|
||||
actualSuid = versionString.substring(1);
|
||||
suid = actualSuid; // default if not explicitly specified
|
||||
|
||||
if (actualSuid.indexOf(':') != -1){
|
||||
// we have a declared hash also
|
||||
int pos = actualSuid.indexOf(':')+1;
|
||||
// actualSuid = suid.substring(pos);
|
||||
// suid = suid.substring(0, pos-1);
|
||||
suid = actualSuid.substring(pos);
|
||||
actualSuid = actualSuid.substring(0, pos-1);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
// _REVISIT_ : Special case version failure ?
|
||||
}
|
||||
}
|
||||
else isSupportedFormat = false;
|
||||
|
||||
if (typeString.startsWith(kSequencePrefix)) {
|
||||
isSequence = true;
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public final String getUnqualifiedName() {
|
||||
if (unqualifiedName == null){
|
||||
String className = getClassName();
|
||||
int index = (className != null) ? className.lastIndexOf('.') : -1;
|
||||
if (index == -1){
|
||||
unqualifiedName = className;
|
||||
definedInId = "IDL::1.0";
|
||||
}
|
||||
else {
|
||||
unqualifiedName = className.substring(index);
|
||||
definedInId = "IDL:" + className.substring(0, index).replace('.','/') + ":1.0";
|
||||
}
|
||||
}
|
||||
|
||||
return unqualifiedName;
|
||||
}
|
||||
|
||||
public final String getDefinedInId() {
|
||||
if (definedInId == null){
|
||||
getUnqualifiedName();
|
||||
}
|
||||
|
||||
return definedInId;
|
||||
}
|
||||
|
||||
public final String getTypeString() {
|
||||
return typeString;
|
||||
}
|
||||
|
||||
public final String getVersionString() {
|
||||
return versionString;
|
||||
}
|
||||
|
||||
public final String getSerialVersionUID() {
|
||||
return suid;
|
||||
}
|
||||
|
||||
public final String getActualSerialVersionUID() {
|
||||
return actualSuid;
|
||||
}
|
||||
public final long getSerialVersionUIDAsLong() {
|
||||
return suidLong;
|
||||
}
|
||||
|
||||
public final long getActualSerialVersionUIDAsLong() {
|
||||
return actualSuidLong;
|
||||
}
|
||||
|
||||
public final boolean isRMIValueType() {
|
||||
return isRMIValueType;
|
||||
}
|
||||
|
||||
public final boolean isIDLType() {
|
||||
return isIDLType;
|
||||
}
|
||||
|
||||
public final String getRepositoryId() {
|
||||
return repId;
|
||||
}
|
||||
|
||||
public static byte[] getByteArray(String repStr) {
|
||||
synchronized (repStrToByteArray){
|
||||
return (byte[]) repStrToByteArray.get(repStr);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setByteArray(String repStr, byte[] repStrBytes) {
|
||||
synchronized (repStrToByteArray){
|
||||
repStrToByteArray.put(repStr, repStrBytes);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean isSequence() {
|
||||
return isSequence;
|
||||
}
|
||||
|
||||
public final boolean isSupportedFormat() {
|
||||
return isSupportedFormat;
|
||||
}
|
||||
|
||||
|
||||
// This method will return the classname from the typestring OR if the classname turns out to be
|
||||
// a special class "pseudo" name, then the matching real classname is returned.
|
||||
public final String getClassName() {
|
||||
|
||||
if (isRMIValueType)
|
||||
return typeString;
|
||||
else if (isIDLType)
|
||||
return completeClassName;
|
||||
else return null;
|
||||
|
||||
}
|
||||
|
||||
// This method calls getClazzFromType() and falls back to the repStrToClass
|
||||
// cache if no class was found. It's used where any class matching the
|
||||
// given repid is an acceptable result.
|
||||
public final Class getAnyClassFromType() throws ClassNotFoundException {
|
||||
try {
|
||||
return getClassFromType();
|
||||
} catch (ClassNotFoundException cnfe) {
|
||||
Class clz = (Class)repStrToClass.get(repId);
|
||||
if (clz != null)
|
||||
return clz;
|
||||
else
|
||||
throw cnfe;
|
||||
}
|
||||
}
|
||||
|
||||
public final Class getClassFromType()
|
||||
throws ClassNotFoundException {
|
||||
if (clazz != null)
|
||||
return clazz;
|
||||
|
||||
Class specialCase = (Class)kSpecialCasesClasses.get(getClassName());
|
||||
|
||||
if (specialCase != null){
|
||||
clazz = specialCase;
|
||||
return specialCase;
|
||||
}
|
||||
else
|
||||
{
|
||||
try{
|
||||
return Util.loadClass(getClassName(), null, null);
|
||||
}
|
||||
catch(ClassNotFoundException cnfe){
|
||||
if (defaultServerURL != null) {
|
||||
try{
|
||||
return getClassFromType(defaultServerURL);
|
||||
}
|
||||
catch(MalformedURLException mue){
|
||||
throw cnfe;
|
||||
}
|
||||
}
|
||||
else throw cnfe;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final Class getClassFromType(Class expectedType, String codebase)
|
||||
throws ClassNotFoundException {
|
||||
if (clazz != null)
|
||||
return clazz;
|
||||
|
||||
Class specialCase = (Class)kSpecialCasesClasses.get(getClassName());
|
||||
|
||||
if (specialCase != null){
|
||||
clazz = specialCase;
|
||||
return specialCase;
|
||||
} else {
|
||||
ClassLoader expectedTypeClassLoader = (expectedType == null ? null : expectedType.getClassLoader());
|
||||
return loadClassOfType(getClassName(),
|
||||
codebase,
|
||||
expectedTypeClassLoader,
|
||||
expectedType,
|
||||
expectedTypeClassLoader);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final Class getClassFromType(String url)
|
||||
throws ClassNotFoundException, MalformedURLException {
|
||||
return Util.loadClass(getClassName(), url, null);
|
||||
}
|
||||
|
||||
public final String toString() {
|
||||
return repId;
|
||||
}
|
||||
|
||||
private static String createHashString(java.io.Serializable ser) {
|
||||
|
||||
return createHashString(ser.getClass());
|
||||
}
|
||||
|
||||
private static String createHashString(java.lang.Class clazz) {
|
||||
|
||||
if (clazz.isInterface() || !java.io.Serializable.class.isAssignableFrom(clazz))
|
||||
return kInterfaceHashCode;
|
||||
|
||||
|
||||
long actualLong = ObjectStreamClassUtil_1_3.computeStructuralUID(false, clazz);
|
||||
String hash = null;
|
||||
if (actualLong == 0)
|
||||
hash = kInterfaceOnlyHashStr;
|
||||
else if (actualLong == 1)
|
||||
hash = kExternalizableHashStr;
|
||||
else
|
||||
hash = Long.toHexString(actualLong).toUpperCase();
|
||||
while(hash.length() < 16){
|
||||
hash = "0" + hash;
|
||||
}
|
||||
|
||||
long declaredLong = ObjectStreamClassUtil_1_3.computeSerialVersionUID(clazz);
|
||||
String declared = null;
|
||||
if (declaredLong == 0)
|
||||
declared = kInterfaceOnlyHashStr;
|
||||
else if (declaredLong == 1)
|
||||
declared = kExternalizableHashStr;
|
||||
else
|
||||
declared = Long.toHexString(declaredLong).toUpperCase();
|
||||
while (declared.length() < 16){
|
||||
declared = "0" + declared;
|
||||
}
|
||||
hash = hash + ":" + declared;
|
||||
|
||||
return ":" + hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a repository ID for a sequence. This is for expert users only as
|
||||
* this method assumes the object passed is an array. If passed an object
|
||||
* that is not an array, it will produce a rep id for a sequence of zero
|
||||
* length. This would be an error.
|
||||
* @param ser The Java object to create a repository ID for
|
||||
**/
|
||||
public static String createSequenceRepID(java.lang.Object ser){
|
||||
return createSequenceRepID(ser.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a repository ID for a sequence. This is for expert users only as
|
||||
* this method assumes the object passed is an array. If passed an object
|
||||
* that is not an array, it will produce a malformed rep id.
|
||||
* @param clazz The Java class to create a repository ID for
|
||||
**/
|
||||
public static String createSequenceRepID(java.lang.Class clazz){
|
||||
synchronized (classSeqToRepStr){
|
||||
|
||||
String repid = (String)classSeqToRepStr.get(clazz);
|
||||
if (repid != null)
|
||||
return repid;
|
||||
|
||||
Class originalClazz = clazz;
|
||||
|
||||
Class type = null;
|
||||
int numOfDims = 0;
|
||||
|
||||
while ((type = clazz.getComponentType()) != null) {
|
||||
numOfDims++;
|
||||
clazz = type;
|
||||
}
|
||||
|
||||
if (clazz.isPrimitive())
|
||||
repid = kValuePrefix + originalClazz.getName() + kPrimitiveSequenceValueHash;
|
||||
else {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append(kValuePrefix);
|
||||
while(numOfDims-- > 0) {
|
||||
buf.append("[");
|
||||
}
|
||||
buf.append("L");
|
||||
buf.append(convertToISOLatin1(clazz.getName()));
|
||||
buf.append(";");
|
||||
buf.append(createHashString(clazz));
|
||||
repid = buf.toString();
|
||||
}
|
||||
classSeqToRepStr.put(originalClazz,repid);
|
||||
return repid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String createForSpecialCase(java.lang.Class clazz){
|
||||
if (clazz.isArray()){
|
||||
return createSequenceRepID(clazz);
|
||||
}
|
||||
else {
|
||||
return (String)kSpecialCasesRepIDs.get(clazz);
|
||||
}
|
||||
}
|
||||
|
||||
public static String createForSpecialCase(java.io.Serializable ser){
|
||||
Class clazz = ser.getClass();
|
||||
if (clazz.isArray()){
|
||||
return createSequenceRepID(ser);
|
||||
}
|
||||
else
|
||||
return createForSpecialCase(clazz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a repository ID for a normal Java Type.
|
||||
* @param ser The Java object to create a repository ID for
|
||||
* @exception com.sun.corba.se.impl.io.TypeMismatchException if ser implements the
|
||||
* org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type.
|
||||
**/
|
||||
public static String createForJavaType(java.io.Serializable ser)
|
||||
throws com.sun.corba.se.impl.io.TypeMismatchException
|
||||
{
|
||||
synchronized (classToRepStr) {
|
||||
String repid = createForSpecialCase(ser);
|
||||
if (repid != null)
|
||||
return repid;
|
||||
Class clazz = ser.getClass();
|
||||
repid = (String)classToRepStr.get(clazz);
|
||||
|
||||
if (repid != null)
|
||||
return repid;
|
||||
|
||||
repid = kValuePrefix + convertToISOLatin1(clazz.getName()) +
|
||||
createHashString(clazz);
|
||||
|
||||
classToRepStr.put(clazz, repid);
|
||||
repStrToClass.put(repid, clazz);
|
||||
return repid;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a repository ID for a normal Java Type.
|
||||
* @param clz The Java class to create a repository ID for
|
||||
* @exception com.sun.corba.se.impl.io.TypeMismatchException if ser implements the
|
||||
* org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type.
|
||||
**/
|
||||
public static String createForJavaType(Class clz)
|
||||
throws com.sun.corba.se.impl.io.TypeMismatchException
|
||||
{
|
||||
synchronized (classToRepStr){
|
||||
String repid = createForSpecialCase(clz);
|
||||
if (repid != null)
|
||||
return repid;
|
||||
|
||||
repid = (String)classToRepStr.get(clz);
|
||||
if (repid != null)
|
||||
return repid;
|
||||
|
||||
repid = kValuePrefix + convertToISOLatin1(clz.getName()) +
|
||||
createHashString(clz);
|
||||
|
||||
classToRepStr.put(clz, repid);
|
||||
repStrToClass.put(repid, clz);
|
||||
return repid;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a repository ID for an IDL Java Type.
|
||||
* @param ser The IDL Value object to create a repository ID for
|
||||
* @param major The major version number
|
||||
* @param minor The minor version number
|
||||
* @exception com.sun.corba.se.impl.io.TypeMismatchException if ser does not implement the
|
||||
* org.omg.CORBA.portable.IDLEntity interface which indicates it is an IDL Value type.
|
||||
**/
|
||||
public static String createForIDLType(Class ser, int major, int minor)
|
||||
throws com.sun.corba.se.impl.io.TypeMismatchException
|
||||
{
|
||||
synchronized (classIDLToRepStr){
|
||||
String repid = (String)classIDLToRepStr.get(ser);
|
||||
if (repid != null)
|
||||
return repid;
|
||||
|
||||
repid = kIDLPrefix + convertToISOLatin1(ser.getName()).replace('.','/') +
|
||||
":" + major + "." + minor;
|
||||
classIDLToRepStr.put(ser, repid);
|
||||
return repid;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getIdFromHelper(Class clazz){
|
||||
try {
|
||||
Class helperClazz = Utility.loadClassForClass(clazz.getName()+"Helper", null,
|
||||
clazz.getClassLoader(), clazz, clazz.getClassLoader());
|
||||
Method idMethod = helperClazz.getDeclaredMethod("id", kNoParamTypes);
|
||||
return (String)idMethod.invoke(null, kNoArgs);
|
||||
}
|
||||
catch(java.lang.ClassNotFoundException cnfe)
|
||||
{
|
||||
throw new org.omg.CORBA.MARSHAL(cnfe.toString());
|
||||
}
|
||||
catch(java.lang.NoSuchMethodException nsme)
|
||||
{
|
||||
throw new org.omg.CORBA.MARSHAL(nsme.toString());
|
||||
}
|
||||
catch(java.lang.reflect.InvocationTargetException ite)
|
||||
{
|
||||
throw new org.omg.CORBA.MARSHAL(ite.toString());
|
||||
}
|
||||
catch(java.lang.IllegalAccessException iae)
|
||||
{
|
||||
throw new org.omg.CORBA.MARSHAL(iae.toString());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Createa a repository ID for the type if it is either a java type
|
||||
* or an IDL type.
|
||||
* @param type The type to create rep. id for
|
||||
* @return The rep. id.
|
||||
**/
|
||||
public static String createForAnyType(Class type) {
|
||||
try{
|
||||
if (type.isArray())
|
||||
return createSequenceRepID(type);
|
||||
else if (IDLEntity.class.isAssignableFrom(type))
|
||||
{
|
||||
try{
|
||||
return getIdFromHelper(type);
|
||||
}
|
||||
catch(Throwable t) {
|
||||
return createForIDLType(type, 1, 0);
|
||||
}
|
||||
}
|
||||
else return createForJavaType(type);
|
||||
}
|
||||
catch(com.sun.corba.se.impl.io.TypeMismatchException e){
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static boolean isAbstractBase(Class clazz) {
|
||||
return (clazz.isInterface() &&
|
||||
IDLEntity.class.isAssignableFrom(clazz) &&
|
||||
(!ValueBase.class.isAssignableFrom(clazz)) &&
|
||||
(!org.omg.CORBA.Object.class.isAssignableFrom(clazz)));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert strings with illegal IDL identifier characters.
|
||||
* <p>
|
||||
* Section 5.5.7 of OBV spec.
|
||||
*/
|
||||
private static String convertToISOLatin1 (String name) {
|
||||
|
||||
int length = name.length();
|
||||
if (length == 0) {
|
||||
return name;
|
||||
}
|
||||
StringBuffer buffer = null;
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
|
||||
char c = name.charAt(i);
|
||||
|
||||
if (c > 255 || IDL_IDENTIFIER_CHARS[c] == 0) {
|
||||
|
||||
// We gotta convert. Have we already started?
|
||||
|
||||
if (buffer == null) {
|
||||
|
||||
// No, so get set up...
|
||||
|
||||
buffer = new StringBuffer(name.substring(0,i));
|
||||
}
|
||||
|
||||
// Convert the character into the IDL escape syntax...
|
||||
buffer.append(
|
||||
"\\U" +
|
||||
(char)ASCII_HEX[(c & 0xF000) >>> 12] +
|
||||
(char)ASCII_HEX[(c & 0x0F00) >>> 8] +
|
||||
(char)ASCII_HEX[(c & 0x00F0) >>> 4] +
|
||||
(char)ASCII_HEX[(c & 0x000F)]);
|
||||
|
||||
} else {
|
||||
if (buffer != null) {
|
||||
buffer.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer != null) {
|
||||
name = buffer.toString();
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert strings with ISO Latin 1 escape sequences back to original strings.
|
||||
* <p>
|
||||
* Section 5.5.7 of OBV spec.
|
||||
*/
|
||||
private static String convertFromISOLatin1 (String name) {
|
||||
|
||||
int index = -1;
|
||||
StringBuffer buf = new StringBuffer(name);
|
||||
|
||||
while ((index = buf.toString().indexOf("\\U")) != -1){
|
||||
String str = "0000" + buf.toString().substring(index+2, index+6);
|
||||
|
||||
// Convert Hexadecimal
|
||||
byte[] buffer = new byte[(str.length() - 4) / 2];
|
||||
for (int i=4, j=0; i < str.length(); i +=2, j++) {
|
||||
buffer[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << 4) & 0xF0);
|
||||
buffer[j] |= (byte)((ORBUtility.hexOf(str.charAt(i+1)) << 0) & 0x0F);
|
||||
}
|
||||
buf = new StringBuffer(delete(buf.toString(), index, index+6));
|
||||
buf.insert(index, (char)buffer[1]);
|
||||
}
|
||||
|
||||
return buf.toString();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static String delete(String str, int from, int to)
|
||||
{
|
||||
return str.substring(0, from) + str.substring(to, str.length());
|
||||
}
|
||||
|
||||
private static String replace(String target, String arg, String source)
|
||||
{
|
||||
int i = 0;
|
||||
i = target.indexOf(arg);
|
||||
|
||||
while(i != -1)
|
||||
{
|
||||
String left = target.substring(0, i);
|
||||
String right = target.substring(i+arg.length());
|
||||
target = new String(left+source+right);
|
||||
i = target.indexOf(arg);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
/*
|
||||
* Load a class and check that it is assignable to a given type.
|
||||
* @param className the class name.
|
||||
* @param remoteCodebase the codebase to use. May be null.
|
||||
* @param loader the class loader of last resort. May be null.
|
||||
* @param expectedType the expected type. May be null.
|
||||
* @return the loaded class.
|
||||
*/
|
||||
private Class loadClassOfType (String className,
|
||||
String remoteCodebase,
|
||||
ClassLoader loader,
|
||||
Class expectedType,
|
||||
ClassLoader expectedTypeClassLoader)
|
||||
throws ClassNotFoundException {
|
||||
|
||||
Class loadedClass = null;
|
||||
|
||||
try {
|
||||
//Sequence finding of the stubs according to spec
|
||||
try{
|
||||
//If-else is put here for speed up of J2EE.
|
||||
//According to the OMG spec, the if clause is not dead code.
|
||||
//It can occur if some compiler has allowed generation
|
||||
//into org.omg.stub hierarchy for non-offending
|
||||
//classes. This will encourage people to
|
||||
//produce non-offending class stubs in their own hierarchy.
|
||||
if(!PackagePrefixChecker
|
||||
.hasOffendingPrefix(PackagePrefixChecker
|
||||
.withoutPackagePrefix(className))){
|
||||
loadedClass = Util.loadClass
|
||||
(PackagePrefixChecker.withoutPackagePrefix(className),
|
||||
remoteCodebase,
|
||||
loader);
|
||||
} else {
|
||||
loadedClass = Util.loadClass
|
||||
(className,
|
||||
remoteCodebase,
|
||||
loader);
|
||||
}
|
||||
} catch (ClassNotFoundException cnfe) {
|
||||
loadedClass = Util.loadClass
|
||||
(className,
|
||||
remoteCodebase,
|
||||
loader);
|
||||
}
|
||||
if (expectedType == null)
|
||||
return loadedClass;
|
||||
} catch (ClassNotFoundException cnfe) {
|
||||
if (expectedType == null)
|
||||
throw cnfe;
|
||||
}
|
||||
|
||||
// If no class was not loaded, or if the loaded class is not of the
|
||||
// correct type, make a further attempt to load the correct class
|
||||
// using the classloader of the expected type.
|
||||
// _REVISIT_ Is this step necessary, or should the Util,loadClass
|
||||
// algorithm always produce a valid class if the setup is correct?
|
||||
// Does the OMG standard algorithm need to be changed to include
|
||||
// this step?
|
||||
if (loadedClass == null || !expectedType.isAssignableFrom(loadedClass)) {
|
||||
if (expectedType.getClassLoader() != expectedTypeClassLoader)
|
||||
throw new IllegalArgumentException("expectedTypeClassLoader not class loader of expectedType.");
|
||||
|
||||
if (expectedTypeClassLoader != null)
|
||||
loadedClass = expectedTypeClassLoader.loadClass(className);
|
||||
else
|
||||
loadedClass = ORBClassLoader.loadClass(className);
|
||||
}
|
||||
|
||||
return loadedClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the FullValueDescription should be retrieved.
|
||||
* @exception Throws IOException if suids do not match or if the repositoryID
|
||||
* is not an RMIValueType
|
||||
*/
|
||||
public static boolean useFullValueDescription(Class clazz, String repositoryID)
|
||||
throws IOException{
|
||||
|
||||
String clazzRepIDStr = createForAnyType(clazz);
|
||||
|
||||
if (clazzRepIDStr.equals(repositoryID))
|
||||
return false;
|
||||
|
||||
RepositoryId_1_3 targetRepid;
|
||||
RepositoryId_1_3 clazzRepid;
|
||||
|
||||
synchronized(cache) {
|
||||
// to avoid race condition where multiple threads could be
|
||||
// accessing this method, and their access to the cache may
|
||||
// be interleaved giving unexpected results
|
||||
|
||||
targetRepid = cache.getId(repositoryID);
|
||||
clazzRepid = cache.getId(clazzRepIDStr);
|
||||
}
|
||||
|
||||
if ((targetRepid.isRMIValueType()) && (clazzRepid.isRMIValueType())){
|
||||
if (!targetRepid.getSerialVersionUID().equals(clazzRepid.getSerialVersionUID())) {
|
||||
|
||||
String mssg = "Mismatched serialization UIDs : Source (Rep. ID" +
|
||||
clazzRepid + ") = " +
|
||||
clazzRepid.getSerialVersionUID() + " whereas Target (Rep. ID " + repositoryID +
|
||||
") = " + targetRepid.getSerialVersionUID();
|
||||
throw new IOException(mssg);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
||||
throw new IOException("The repository ID is not of an RMI value type (Expected ID = " + clazzRepIDStr + "; Received ID = " + repositoryID +")");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,251 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
/*
|
||||
* Licensed Materials - Property of IBM
|
||||
* RMI-IIOP v1.0
|
||||
* Copyright IBM Corp. 1998 1999 All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import javax.rmi.CORBA.Util;
|
||||
import javax.rmi.PortableRemoteObject;
|
||||
|
||||
import java.util.Hashtable;
|
||||
import java.util.Stack;
|
||||
import java.io.IOException;
|
||||
import java.util.EmptyStackException;
|
||||
|
||||
import com.sun.corba.se.impl.util.Utility;
|
||||
import com.sun.corba.se.impl.io.IIOPInputStream;
|
||||
import com.sun.corba.se.impl.io.IIOPOutputStream;
|
||||
import com.sun.corba.se.impl.util.RepositoryId;
|
||||
import com.sun.corba.se.impl.util.Utility;
|
||||
|
||||
import org.omg.CORBA.TCKind;
|
||||
import org.omg.CORBA.MARSHAL;
|
||||
import org.omg.CORBA.CompletionStatus;
|
||||
import org.omg.CORBA.portable.IndirectionException;
|
||||
import com.sun.org.omg.SendingContext.CodeBase;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
|
||||
/**
|
||||
* This class overrides behavior of our current ValueHandlerImpl to
|
||||
* provide backwards compatibility with JDK 1.3.0.
|
||||
*/
|
||||
public class ValueHandlerImpl_1_3 extends com.sun.corba.se.impl.io.ValueHandlerImpl {
|
||||
|
||||
public ValueHandlerImpl_1_3(){
|
||||
super();
|
||||
}
|
||||
|
||||
public ValueHandlerImpl_1_3(boolean isInputStream) {
|
||||
super(isInputStream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the value to the stream using java semantics.
|
||||
* @param out The stream to write the value to
|
||||
* @param value The value to be written to the stream
|
||||
**/
|
||||
public void writeValue(org.omg.CORBA.portable.OutputStream _out, java.io.Serializable value) {
|
||||
super.writeValue(_out, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a value from the stream using java semantics.
|
||||
* @param in The stream to read the value from
|
||||
* @param clazz The type of the value to be read in
|
||||
* @param sender The sending context runtime
|
||||
**/
|
||||
public java.io.Serializable readValue(org.omg.CORBA.portable.InputStream _in,
|
||||
int offset,
|
||||
java.lang.Class clazz,
|
||||
String repositoryID,
|
||||
org.omg.SendingContext.RunTime _sender)
|
||||
{
|
||||
return super.readValue(_in, offset, clazz, repositoryID, _sender);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the repository ID for the given RMI value Class.
|
||||
* @param clz The class to return a repository ID for.
|
||||
* @return the repository ID of the Class.
|
||||
**/
|
||||
public java.lang.String getRMIRepositoryID(java.lang.Class clz) {
|
||||
return RepositoryId_1_3.createForJavaType(clz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the given Class performs custom or
|
||||
* default marshaling.
|
||||
* @param clz The class to test for custom marshaling.
|
||||
* @return True if the class performs custom marshaling, false
|
||||
* if it does not.
|
||||
**/
|
||||
public boolean isCustomMarshaled(java.lang.Class clz) {
|
||||
return super.isCustomMarshaled(clz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the CodeBase for this ValueHandler. This is used by
|
||||
* the ORB runtime. The server sends the service context containing
|
||||
* the IOR for this CodeBase on the first GIOP reply. The clients
|
||||
* do the same on the first GIOP request.
|
||||
* @return the SendingContext.CodeBase of this ValueHandler.
|
||||
**/
|
||||
public org.omg.SendingContext.RunTime getRunTimeCodeBase() {
|
||||
return super.getRunTimeCodeBase();
|
||||
}
|
||||
|
||||
/**
|
||||
* If the value contains a writeReplace method then the result
|
||||
* is returned. Otherwise, the value itself is returned.
|
||||
* @return the true value to marshal on the wire.
|
||||
**/
|
||||
public java.io.Serializable writeReplace(java.io.Serializable value) {
|
||||
return super.writeReplace(value);
|
||||
}
|
||||
|
||||
// methods supported for backward compatability so that the appropriate
|
||||
// Rep-id calculations take place based on the ORB version
|
||||
|
||||
/**
|
||||
* Returns a boolean of whether or not RepositoryId indicates
|
||||
* FullValueDescriptor.
|
||||
* used for backward compatability
|
||||
*/
|
||||
|
||||
public boolean useFullValueDescription(Class clazz, String repositoryID)
|
||||
throws IOException
|
||||
|
||||
{
|
||||
return RepositoryId_1_3.useFullValueDescription(clazz, repositoryID);
|
||||
}
|
||||
|
||||
public String getClassName(String id)
|
||||
{
|
||||
RepositoryId_1_3 repID = RepositoryId_1_3.cache.getId(id);
|
||||
return repID.getClassName();
|
||||
}
|
||||
|
||||
public Class getClassFromType(String id)
|
||||
throws ClassNotFoundException
|
||||
{
|
||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
||||
return repId.getClassFromType();
|
||||
}
|
||||
|
||||
public Class getAnyClassFromType(String id)
|
||||
throws ClassNotFoundException
|
||||
{
|
||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
||||
return repId.getAnyClassFromType();
|
||||
}
|
||||
|
||||
public String createForAnyType(Class cl)
|
||||
{
|
||||
return RepositoryId_1_3.createForAnyType(cl);
|
||||
}
|
||||
|
||||
public String getDefinedInId(String id)
|
||||
{
|
||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
||||
return repId.getDefinedInId();
|
||||
}
|
||||
|
||||
public String getUnqualifiedName(String id)
|
||||
{
|
||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
||||
return repId.getUnqualifiedName();
|
||||
}
|
||||
|
||||
public String getSerialVersionUID(String id)
|
||||
{
|
||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
||||
return repId.getSerialVersionUID();
|
||||
}
|
||||
|
||||
public boolean isAbstractBase(Class clazz)
|
||||
{
|
||||
return RepositoryId_1_3.isAbstractBase(clazz);
|
||||
}
|
||||
|
||||
public boolean isSequence(String id)
|
||||
{
|
||||
RepositoryId_1_3 repId = RepositoryId_1_3.cache.getId(id);
|
||||
return repId.isSequence();
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserves the incorrect 1.3 behavior which truncates Java chars in
|
||||
* arrays to 8-bit CORBA chars. Bug 4367783. This enables us to
|
||||
* continue interoperating with our legacy ORBs. If this goes into
|
||||
* Ladybird, then Ladybird and Kestrel will interoperate as long as
|
||||
* people don't use chars greater than 8-bits.
|
||||
*/
|
||||
protected void writeCharArray(org.omg.CORBA_2_3.portable.OutputStream out,
|
||||
char[] array,
|
||||
int offset,
|
||||
int length)
|
||||
{
|
||||
out.write_char_array(array, offset, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserves the incorrect 1.3 behavior which truncates Java chars in
|
||||
* arrays to 8-bit CORBA chars. Bug 4367783. This enables us to
|
||||
* continue interoperating with our legacy ORBs. If this goes into
|
||||
* Ladybird, then Ladybird and Kestrel will interoperate as long as
|
||||
* people don't use chars greater than 8-bits.
|
||||
*/
|
||||
protected void readCharArray(org.omg.CORBA_2_3.portable.InputStream in,
|
||||
char[] array,
|
||||
int offset,
|
||||
int length)
|
||||
{
|
||||
in.read_char_array(array, offset, length);
|
||||
}
|
||||
|
||||
protected final String getOutputStreamClassName() {
|
||||
return "com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3";
|
||||
}
|
||||
|
||||
protected final String getInputStreamClassName() {
|
||||
return "com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3";
|
||||
}
|
||||
|
||||
/**
|
||||
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
|
||||
* The correct behavior is for a Java char to map to a CORBA wchar,
|
||||
* but our older code mapped it to a CORBA char.
|
||||
*/
|
||||
protected TCKind getJavaCharTCKind() {
|
||||
return TCKind.tk_char;
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package com.sun.corba.se.impl.orbutil;
|
||||
|
||||
import org.omg.CORBA.TCKind;
|
||||
|
||||
/**
|
||||
* This class overrides behavior of our current ValueHandlerImpl to
|
||||
* provide backwards compatibility with JDK 1.3.1.
|
||||
*/
|
||||
public class ValueHandlerImpl_1_3_1
|
||||
extends com.sun.corba.se.impl.io.ValueHandlerImpl
|
||||
{
|
||||
public ValueHandlerImpl_1_3_1() {}
|
||||
|
||||
public ValueHandlerImpl_1_3_1(boolean isInputStream) {
|
||||
super(isInputStream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Our JDK 1.3 and JDK 1.3.1 behavior subclasses override this.
|
||||
* The correct behavior is for a Java char to map to a CORBA wchar,
|
||||
* but our older code mapped it to a CORBA char.
|
||||
*/
|
||||
protected TCKind getJavaCharTCKind() {
|
||||
return TCKind.tk_char;
|
||||
}
|
||||
|
||||
/**
|
||||
* RepositoryId_1_3_1 performs an incorrect repId calculation
|
||||
* when using serialPersistentFields and one of the fields no longer
|
||||
* exists on the class itself.
|
||||
*/
|
||||
public boolean useFullValueDescription(Class clazz, String repositoryID)
|
||||
throws java.io.IOException
|
||||
{
|
||||
return RepositoryId_1_3_1.useFullValueDescription(clazz, repositoryID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs the legacy IIOPOutputStream_1_3_1 which does
|
||||
* PutFields/GetFields incorrectly. Bug 4407244.
|
||||
*/
|
||||
protected final String getOutputStreamClassName() {
|
||||
return "com.sun.corba.se.impl.orbutil.IIOPOutputStream_1_3_1";
|
||||
}
|
||||
|
||||
/**
|
||||
* Installs the legacy IIOPInputStream_1_3_1 which does
|
||||
* PutFields/GetFields incorrectly. Bug 4407244.
|
||||
*/
|
||||
protected final String getInputStreamClassName() {
|
||||
return "com.sun.corba.se.impl.orbutil.IIOPInputStream_1_3_1";
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,7 @@ import com.sun.corba.se.impl.logging.OMGSystemException ;
|
||||
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
|
||||
|
||||
import com.sun.corba.se.impl.orbutil.ORBClassLoader ;
|
||||
import sun.awt.AppContext;
|
||||
|
||||
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
implements Broker, TypeCodeFactory
|
||||
@@ -173,14 +174,7 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
|
||||
protected MonitoringManager monitoringManager;
|
||||
|
||||
// There is only one instance of the PresentationManager
|
||||
// that is shared between all ORBs. This is necessary
|
||||
// because RMI-IIOP requires the PresentationManager in
|
||||
// places where no ORB is available, so the PresentationManager
|
||||
// must be global. It is initialized here as well.
|
||||
protected static PresentationManager globalPM = null ;
|
||||
|
||||
static {
|
||||
private static PresentationManager setupPresentationManager() {
|
||||
staticWrapper = ORBUtilSystemException.get(
|
||||
CORBALogDomains.RPC_PRESENTATION ) ;
|
||||
|
||||
@@ -220,10 +214,11 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
}
|
||||
) ;
|
||||
|
||||
globalPM = new PresentationManagerImpl( useDynamicStub ) ;
|
||||
globalPM.setStubFactoryFactory( false,
|
||||
PresentationManager pm = new PresentationManagerImpl( useDynamicStub ) ;
|
||||
pm.setStubFactoryFactory( false,
|
||||
PresentationDefaults.getStaticStubFactoryFactory() ) ;
|
||||
globalPM.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
|
||||
pm.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
|
||||
return pm;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
@@ -234,11 +229,19 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
byteBufferPool = null;
|
||||
}
|
||||
|
||||
/** Get the single instance of the PresentationManager
|
||||
/**
|
||||
* Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
|
||||
* AppContext to hold it. Creates and records one if needed.
|
||||
*/
|
||||
public static PresentationManager getPresentationManager()
|
||||
{
|
||||
return globalPM ;
|
||||
AppContext ac = AppContext.getAppContext();
|
||||
PresentationManager pm = (PresentationManager) ac.get(PresentationManager.class);
|
||||
if (pm == null) {
|
||||
pm = setupPresentationManager();
|
||||
ac.put(PresentationManager.class, pm);
|
||||
}
|
||||
return pm;
|
||||
}
|
||||
|
||||
/** Get the appropriate StubFactoryFactory. This
|
||||
@@ -248,8 +251,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
public static PresentationManager.StubFactoryFactory
|
||||
getStubFactoryFactory()
|
||||
{
|
||||
boolean useDynamicStubs = globalPM.useDynamicStubs() ;
|
||||
return globalPM.getStubFactoryFactory( useDynamicStubs ) ;
|
||||
PresentationManager gPM = getPresentationManager();
|
||||
boolean useDynamicStubs = gPM.useDynamicStubs() ;
|
||||
return gPM.getStubFactoryFactory( useDynamicStubs ) ;
|
||||
}
|
||||
|
||||
protected ORB()
|
||||
|
||||
32
corba/src/share/classes/sun/corba/JavaCorbaAccess.java
Normal file
32
corba/src/share/classes/sun/corba/JavaCorbaAccess.java
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.corba;
|
||||
|
||||
import com.sun.corba.se.impl.io.ValueHandlerImpl;
|
||||
|
||||
public interface JavaCorbaAccess {
|
||||
public ValueHandlerImpl newValueHandlerImpl();
|
||||
}
|
||||
60
corba/src/share/classes/sun/corba/SharedSecrets.java
Normal file
60
corba/src/share/classes/sun/corba/SharedSecrets.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.corba;
|
||||
|
||||
import com.sun.corba.se.impl.io.ValueUtility;
|
||||
import sun.misc.Unsafe;
|
||||
|
||||
import java.security.AccessController;
|
||||
|
||||
/** A repository of "shared secrets", which are a mechanism for
|
||||
calling implementation-private methods in another package without
|
||||
using reflection. A package-private class implements a public
|
||||
interface and provides the ability to call package-private methods
|
||||
within that package; the object implementing that interface is
|
||||
provided through a third package to which access is restricted.
|
||||
This framework avoids the primary disadvantage of using reflection
|
||||
for this purpose, namely the loss of compile-time checking. */
|
||||
|
||||
// SharedSecrets cloned in corba repo to avoid build issues
|
||||
public class SharedSecrets {
|
||||
private static final Unsafe unsafe = Unsafe.getUnsafe();
|
||||
private static JavaCorbaAccess javaCorbaAccess;
|
||||
|
||||
public static JavaCorbaAccess getJavaCorbaAccess() {
|
||||
if (javaCorbaAccess == null) {
|
||||
// Ensure ValueUtility is initialized; we know that that class
|
||||
// provides the shared secret
|
||||
unsafe.ensureClassInitialized(ValueUtility.class);
|
||||
}
|
||||
return javaCorbaAccess;
|
||||
}
|
||||
|
||||
public static void setJavaCorbaAccess(JavaCorbaAccess access) {
|
||||
javaCorbaAccess = access;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
#
|
||||
|
||||
# Get clones of all nested repositories
|
||||
sh ./common/bin/hgforest.sh clone "$@"
|
||||
sh ./common/bin/hgforest.sh clone "$@" || exit 1
|
||||
|
||||
# Update all existing repositories to the latest sources
|
||||
sh ./common/bin/hgforest.sh pull -u
|
||||
|
||||
@@ -311,3 +311,16 @@ d5cb5830f570d1304ea4b196dde672a291b55f29 jdk8-b72
|
||||
70c89bd6b895a10d25ca70e08093c09ff2005fda hs25-b16
|
||||
1a3e54283c54aaa8b3437813e8507fbdc966e5b6 jdk8-b74
|
||||
b4391649e91ea8d37f66317a03d6d2573a93d10d hs25-b17
|
||||
6778d0b1659323a506ca47600ca29a9d9f8b383d jdk8-b75
|
||||
20b605466ccb1b3725eb25314d9e8782199630c5 jdk8-b76
|
||||
412d722168bc23f8e6d98995202728678561417f hs25-b18
|
||||
cdb46031e7184d37301288f5719121a63c7054b5 jdk8-b77
|
||||
9f19f4a7d48a4ebe7f616b6068971ea5f8b075fa hs25-b19
|
||||
d5e12e7d2f719144d84903d9151455661c47b476 jdk8-b78
|
||||
555ec35a250783110aa070dbc8a8603f6cabe41f hs25-b20
|
||||
6691814929b606fe0e7954fd6e485dd876505c83 jdk8-b79
|
||||
df5396524152118535c36da5801d828b560d19a2 hs25-b21
|
||||
4a198b201f3ce84433fa94a3ca65d061473e7c4c jdk8-b80
|
||||
dd6350b4abc4a6c19c89dd982cc0e4f3d119885c hs25-b22
|
||||
65b797426a3bec6e91b64085a0cfb94adadb634a jdk8-b81
|
||||
0631ebcc45f05c73b09a56c2586685af1f781c1d hs25-b23
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
# This guards against adding broken .java files to the directory
|
||||
@@ -42,8 +42,6 @@ PKGLIST = \
|
||||
sun.jvm.hotspot \
|
||||
sun.jvm.hotspot.asm \
|
||||
sun.jvm.hotspot.asm.sparc \
|
||||
sun.jvm.hotspot.bugspot \
|
||||
sun.jvm.hotspot.bugspot.tree \
|
||||
sun.jvm.hotspot.c1 \
|
||||
sun.jvm.hotspot.ci \
|
||||
sun.jvm.hotspot.code \
|
||||
@@ -84,7 +82,6 @@ sun.jvm.hotspot.gc_implementation.shared \
|
||||
sun.jvm.hotspot.gc_interface \
|
||||
sun.jvm.hotspot.interpreter \
|
||||
sun.jvm.hotspot.jdi \
|
||||
sun.jvm.hotspot.livejvm \
|
||||
sun.jvm.hotspot.memory \
|
||||
sun.jvm.hotspot.opto \
|
||||
sun.jvm.hotspot.oops \
|
||||
@@ -130,8 +127,6 @@ FILELIST = \
|
||||
sun/jvm/hotspot/*.java \
|
||||
sun/jvm/hotspot/asm/*.java \
|
||||
sun/jvm/hotspot/asm/sparc/*.java \
|
||||
sun/jvm/hotspot/bugspot/*.java \
|
||||
sun/jvm/hotspot/bugspot/tree/*.java \
|
||||
sun/jvm/hotspot/c1/*.java \
|
||||
sun/jvm/hotspot/ci/*.java \
|
||||
sun/jvm/hotspot/code/*.java \
|
||||
@@ -168,7 +163,6 @@ sun/jvm/hotspot/gc_implementation/parallelScavenge/*.java \
|
||||
sun/jvm/hotspot/gc_implementation/shared/*.java \
|
||||
sun/jvm/hotspot/interpreter/*.java \
|
||||
sun/jvm/hotspot/jdi/*.java \
|
||||
sun/jvm/hotspot/livejvm/*.java \
|
||||
sun/jvm/hotspot/memory/*.java \
|
||||
sun/jvm/hotspot/oops/*.java \
|
||||
sun/jvm/hotspot/opto/*.java \
|
||||
@@ -205,7 +199,7 @@ sun/jvm/hotspot/utilities/*.java \
|
||||
sun/jvm/hotspot/utilities/memo/*.java \
|
||||
sun/jvm/hotspot/utilities/soql/*.java \
|
||||
com/sun/java/swing/action/*.java \
|
||||
com/sun/java/swing/ui/*.java
|
||||
com/sun/java/swing/ui/*.java
|
||||
#END FILELIST
|
||||
|
||||
ifneq "x$(ALT_BOOTDIR)" "x"
|
||||
@@ -231,7 +225,7 @@ BUILD_DIR = ../build
|
||||
OUTPUT_DIR = $(BUILD_DIR)/classes
|
||||
DOC_DIR = $(BUILD_DIR)/doc
|
||||
|
||||
# gnumake 3.78.1 does not accept the *s,
|
||||
# gnumake 3.78.1 does not accept the *s,
|
||||
# so use the shell to expand them
|
||||
ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
|
||||
ALLFILES := $(shell /bin/ls $(ALLFILES))
|
||||
@@ -303,7 +297,7 @@ sizes: $(ALLFILES)
|
||||
cscope: $(ALLFILES)
|
||||
rm -f java.files
|
||||
echo $(ALLFILES) > java.files
|
||||
cscope -b -i java.files -f java.out
|
||||
cscope -b -i java.files -f java.out
|
||||
rm -f java.files
|
||||
|
||||
.PHONY: sa.jar
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
REM
|
||||
REM Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
REM
|
||||
REM This code is free software; you can redistribute it and/or modify it
|
||||
REM under the terms of the GNU General Public License version 2 only, as
|
||||
REM published by the Free Software Foundation.
|
||||
REM
|
||||
REM This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
REM version 2 for more details (a copy is included in the LICENSE file that
|
||||
REM accompanied this code).
|
||||
REM
|
||||
REM You should have received a copy of the GNU General Public License version
|
||||
REM 2 along with this work; if not, write to the Free Software Foundation,
|
||||
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
REM
|
||||
REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
REM or visit www.oracle.com if you need additional information or have any
|
||||
REM questions.
|
||||
REM
|
||||
REM
|
||||
|
||||
java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.bugspot.Main
|
||||
@@ -26,14 +26,12 @@
|
||||
|
||||
<ul>
|
||||
<li><code>java -cp classes sun.jvm.hotspot.HSDB</code>
|
||||
<li><code>java -cp classes sun.jvm.hotspot.bugspot.Main</code>
|
||||
</ul>
|
||||
|
||||
<h2>Feedback</h2>
|
||||
<p>
|
||||
Refactoring of package hierarchy. All user interface components should be in
|
||||
the ui package. Perhaps: sun.jvm.hotspot.ui.hsdb.Main for the HSDB and
|
||||
sun.jvm.hotspot.ui.bugspot.Main for BugSpot.
|
||||
the ui package. Perhaps: sun.jvm.hotspot.ui.hsdb.Main for the HSDB.
|
||||
<p>
|
||||
The src\share\vm\agent area seems like a workspace so it should be organized like
|
||||
one. In particular, I'd like to suggest the following directory layout:<br>
|
||||
@@ -47,7 +45,7 @@
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Seems like there is a lot of redundant functionality. Between the HSDB and BugSpot. Perhaps
|
||||
Seems like there is a lot of redundant functionality. Perhaps
|
||||
this can be consolidated with a <code>javax.swing.Actions</code> architecture.
|
||||
|
||||
<h2>Tasklist</h2>
|
||||
@@ -55,11 +53,7 @@
|
||||
<p>
|
||||
<b>Stack memory pane</b>:
|
||||
It's one of the more useful JVM debugging tools in the SA. However, it
|
||||
doesn't support any interaction with the text; the Memory Panel in BugSpot
|
||||
was written afterward (with help from Shannon) and implements proper
|
||||
selection, scrolling, and drag-and-drop, but no annotations. I'm not sure how
|
||||
to integrate the annotations with the JTable that's being used for the memory
|
||||
view; if you have suggestions here please let me know.
|
||||
doesn't support any interaction with the text.
|
||||
<p>
|
||||
<b>Integrations with the NetBeans architecture (plug in).</b> See the
|
||||
<a href="http://openide.netbeans.org">Netbeans Open APIs homepage</a>
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
#import <dlfcn.h>
|
||||
#import <limits.h>
|
||||
#import <errno.h>
|
||||
#import <sys/types.h>
|
||||
#import <sys/ptrace.h>
|
||||
|
||||
jboolean debug = JNI_FALSE;
|
||||
|
||||
@@ -97,7 +99,8 @@ static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) {
|
||||
* Method: init0
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_init0(JNIEnv *env, jclass cls) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_init0(JNIEnv *env, jclass cls) {
|
||||
symbolicatorID = (*env)->GetFieldID(env, cls, "symbolicator", "J");
|
||||
taskID = (*env)->GetFieldID(env, cls, "task", "J");
|
||||
CHECK_EXCEPTION;
|
||||
@@ -108,7 +111,11 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_init0(
|
||||
* Method: lookupByName0
|
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;)J
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByName0(JNIEnv *env, jobject this_obj, jstring objectName, jstring symbolName) {
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByName0(
|
||||
JNIEnv *env, jobject this_obj,
|
||||
jstring objectName, jstring symbolName)
|
||||
{
|
||||
jlong address = 0;
|
||||
|
||||
JNF_COCOA_ENTER(env);
|
||||
@@ -137,7 +144,11 @@ JNF_COCOA_EXIT(env);
|
||||
* Method: readBytesFromProcess0
|
||||
* Signature: (JJ)Lsun/jvm/hotspot/debugger/ReadResult;
|
||||
*/
|
||||
JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(JNIEnv *env, jobject this_obj, jlong addr, jlong numBytes) {
|
||||
JNIEXPORT jbyteArray JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0(
|
||||
JNIEnv *env, jobject this_obj,
|
||||
jlong addr, jlong numBytes)
|
||||
{
|
||||
if (debug) printf("readBytesFromProcess called. addr = %llx numBytes = %lld\n", addr, numBytes);
|
||||
|
||||
// must allocate storage instead of using former parameter buf
|
||||
@@ -149,7 +160,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_
|
||||
CHECK_EXCEPTION_(0);
|
||||
|
||||
unsigned long alignedAddress;
|
||||
unsigned long alignedLength;
|
||||
unsigned long alignedLength = 0;
|
||||
kern_return_t result;
|
||||
vm_offset_t *pages;
|
||||
int *mapped;
|
||||
@@ -209,12 +220,74 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal
|
||||
* Method: getThreadIntegerRegisterSet0
|
||||
* Signature: (I)[J
|
||||
* Lookup the thread_t that corresponds to the given thread_id.
|
||||
* The thread_id should be the result from calling thread_info() with THREAD_IDENTIFIER_INFO
|
||||
* and reading the m_ident_info.thread_id returned.
|
||||
* The returned thread_t is the mach send right to the kernel port for the corresponding thread.
|
||||
*
|
||||
* We cannot simply use the OSThread._thread_id field in the JVM. This is set to ::mach_thread_self()
|
||||
* in the VM, but that thread port is not valid for a remote debugger to access the thread.
|
||||
*/
|
||||
JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0(JNIEnv *env, jobject this_obj, jint lwp_id) {
|
||||
thread_t
|
||||
lookupThreadFromThreadId(task_t task, jlong thread_id) {
|
||||
if (debug) {
|
||||
printf("lookupThreadFromThreadId thread_id=0x%llx\n", thread_id);
|
||||
}
|
||||
|
||||
thread_array_t thread_list = NULL;
|
||||
mach_msg_type_number_t thread_list_count = 0;
|
||||
thread_t result_thread = 0;
|
||||
int i;
|
||||
|
||||
// get the list of all the send rights
|
||||
kern_return_t result = task_threads(task, &thread_list, &thread_list_count);
|
||||
if (result != KERN_SUCCESS) {
|
||||
if (debug) {
|
||||
printf("task_threads returned 0x%x\n", result);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
for(i = 0 ; i < thread_list_count; i++) {
|
||||
thread_identifier_info_data_t m_ident_info;
|
||||
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
|
||||
|
||||
// get the THREAD_IDENTIFIER_INFO for the send right
|
||||
result = thread_info(thread_list[i], THREAD_IDENTIFIER_INFO, (thread_info_t) &m_ident_info, &count);
|
||||
if (result != KERN_SUCCESS) {
|
||||
if (debug) {
|
||||
printf("thread_info returned 0x%x\n", result);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// if this is the one we're looking for, return the send right
|
||||
if (thread_id == m_ident_info.thread_id)
|
||||
{
|
||||
result_thread = thread_list[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vm_size_t thread_list_size = (vm_size_t) (thread_list_count * sizeof (thread_t));
|
||||
vm_deallocate(mach_task_self(), (vm_address_t) thread_list, thread_list_count);
|
||||
|
||||
return result_thread;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: getThreadIntegerRegisterSet0
|
||||
* Signature: (J)[J
|
||||
*/
|
||||
JNIEXPORT jlongArray JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0(
|
||||
JNIEnv *env, jobject this_obj,
|
||||
jlong thread_id)
|
||||
{
|
||||
if (debug)
|
||||
printf("getThreadRegisterSet0 called\n");
|
||||
|
||||
@@ -226,8 +299,9 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_
|
||||
int i;
|
||||
jlongArray registerArray;
|
||||
jlong *primitiveArray;
|
||||
task_t gTask = getTask(env, this_obj);
|
||||
|
||||
tid = lwp_id;
|
||||
tid = lookupThreadFromThreadId(gTask, thread_id);
|
||||
|
||||
result = thread_get_state(tid, HSDB_THREAD_STATE, (thread_state_t)&state, &count);
|
||||
|
||||
@@ -328,19 +402,21 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: translateTID0
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(JNIEnv *env, jobject this_obj, jint tid) {
|
||||
Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(
|
||||
JNIEnv *env, jobject this_obj, jint tid)
|
||||
{
|
||||
if (debug)
|
||||
printf("translateTID0 called on tid = 0x%x\n", (int)tid);
|
||||
|
||||
kern_return_t result;
|
||||
thread_t foreign_tid, usable_tid;
|
||||
mach_msg_type_name_t type;
|
||||
|
||||
|
||||
foreign_tid = tid;
|
||||
|
||||
task_t gTask = getTask(env, this_obj);
|
||||
@@ -356,19 +432,90 @@ Java_sun_jvm_hotspot_debugger_macosx_MacOSXDebuggerLocal_translateTID0(JNIEnv *e
|
||||
return (jint) usable_tid;
|
||||
}
|
||||
|
||||
|
||||
static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
int res;
|
||||
if ((res = ptrace(PT_CONTINUE, pid, (caddr_t)1, signal)) < 0) {
|
||||
fprintf(stderr, "attach: ptrace(PT_CONTINUE, %d) failed with %d\n", pid, res);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// waits until the ATTACH has stopped the process
|
||||
// by signal SIGSTOP
|
||||
static bool ptrace_waitpid(pid_t pid) {
|
||||
int ret;
|
||||
int status;
|
||||
while (true) {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
|
||||
// will still be pending and delivered when the process is DETACHED and the process
|
||||
// will go to sleep.
|
||||
if (WSTOPSIG(status) == SIGSTOP) {
|
||||
// Debuggee stopped by SIGSTOP.
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
fprintf(stderr, "attach: Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "attach: waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
fprintf(stderr, "attach: waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
fprintf(stderr, "attach: waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "attach: waitpid() failed. Unexpected error %d\n",errno);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
int res;
|
||||
if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) {
|
||||
fprintf(stderr, "ptrace(PT_ATTACH, %d) failed with %d\n", pid, res);
|
||||
return false;
|
||||
} else {
|
||||
return ptrace_waitpid(pid);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal
|
||||
* Method: attach0
|
||||
* Signature: (I)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__I(JNIEnv *env, jobject this_obj, jint jpid) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__I(
|
||||
JNIEnv *env, jobject this_obj, jint jpid)
|
||||
{
|
||||
JNF_COCOA_ENTER(env);
|
||||
if (getenv("JAVA_SAPROC_DEBUG") != NULL)
|
||||
debug = JNI_TRUE;
|
||||
else
|
||||
debug = JNI_FALSE;
|
||||
if (debug) printf("attach0 called for jpid=%d\n", (int)jpid);
|
||||
|
||||
|
||||
// get the task from the pid
|
||||
kern_return_t result;
|
||||
task_t gTask = 0;
|
||||
result = task_for_pid(mach_task_self(), jpid, &gTask);
|
||||
@@ -378,6 +525,13 @@ JNF_COCOA_ENTER(env);
|
||||
}
|
||||
putTask(env, this_obj, gTask);
|
||||
|
||||
// use ptrace to stop the process
|
||||
// on os x, ptrace only needs to be called on the process, not the individual threads
|
||||
if (ptrace_attach(jpid) != true) {
|
||||
mach_port_deallocate(mach_task_self(), gTask);
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
|
||||
}
|
||||
|
||||
id symbolicator = nil;
|
||||
id jrsSymbolicator = objc_lookUpClass("JRSSymbolicator");
|
||||
if (jrsSymbolicator != nil) {
|
||||
@@ -401,11 +555,29 @@ JNF_COCOA_EXIT(env);
|
||||
* Method: detach0
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_detach0(JNIEnv *env, jobject this_obj) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_detach0(
|
||||
JNIEnv *env, jobject this_obj)
|
||||
{
|
||||
JNF_COCOA_ENTER(env);
|
||||
if (debug) printf("detach0 called\n");
|
||||
|
||||
task_t gTask = getTask(env, this_obj);
|
||||
|
||||
// detach from the ptraced process causing it to resume execution
|
||||
int pid;
|
||||
kern_return_t k_res;
|
||||
k_res = pid_for_task(gTask, &pid);
|
||||
if (k_res != KERN_SUCCESS) {
|
||||
fprintf(stderr, "detach: pid_for_task(%d) failed (%d)\n", pid, k_res);
|
||||
}
|
||||
else {
|
||||
int res = ptrace(PT_DETACH, pid, 0, 0);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "detach: ptrace(PT_DETACH, %d) failed (%d)\n", pid, res);
|
||||
}
|
||||
}
|
||||
|
||||
mach_port_deallocate(mach_task_self(), gTask);
|
||||
id symbolicator = getSymbolicator(env, this_obj);
|
||||
if (symbolicator != nil) {
|
||||
@@ -419,10 +591,13 @@ JNF_COCOA_EXIT(env);
|
||||
* Method: load_library
|
||||
* Signature: (Ljava/lang/String;)L
|
||||
*/
|
||||
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_asm_Disassembler_load_1library(JNIEnv * env,
|
||||
jclass disclass,
|
||||
jstring jrepath_s,
|
||||
jstring libname_s) {
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_jvm_hotspot_asm_Disassembler_load_1library(
|
||||
JNIEnv * env,
|
||||
jclass disclass,
|
||||
jstring jrepath_s,
|
||||
jstring libname_s)
|
||||
{
|
||||
uintptr_t func = 0;
|
||||
const char* error_message = NULL;
|
||||
const char* java_home;
|
||||
@@ -455,7 +630,7 @@ JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_asm_Disassembler_load_1library(JNIE
|
||||
/* Couldn't find entry point. error_message should contain some
|
||||
* platform dependent error message.
|
||||
*/
|
||||
THROW_NEW_DEBUGGER_EXCEPTION(error_message);
|
||||
THROW_NEW_DEBUGGER_EXCEPTION_(error_message, (jlong)func);
|
||||
}
|
||||
return (jlong)func;
|
||||
}
|
||||
@@ -533,13 +708,16 @@ static int printf_to_env(void* env_pv, const char* format, ...) {
|
||||
* Method: decode
|
||||
* Signature: (Lsun/jvm/hotspot/asm/InstructionVisitor;J[BLjava/lang/String;J)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_sun_jvm_hotspot_asm_Disassembler_decode(JNIEnv * env,
|
||||
jobject dis,
|
||||
jobject visitor,
|
||||
jlong startPc,
|
||||
jbyteArray code,
|
||||
jstring options_s,
|
||||
jlong decode_instructions_virtual) {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_jvm_hotspot_asm_Disassembler_decode(
|
||||
JNIEnv * env,
|
||||
jobject dis,
|
||||
jobject visitor,
|
||||
jlong startPc,
|
||||
jbyteArray code,
|
||||
jstring options_s,
|
||||
jlong decode_instructions_virtual)
|
||||
{
|
||||
jboolean isCopy;
|
||||
jbyte* start = (*env)->GetByteArrayElements(env, code, &isCopy);
|
||||
jbyte* end = start + (*env)->GetArrayLength(env, code);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -91,6 +91,14 @@ void print_debug(const char* format,...) {
|
||||
}
|
||||
}
|
||||
|
||||
void print_error(const char* format,...) {
|
||||
va_list alist;
|
||||
va_start(alist, format);
|
||||
fputs("ERROR: ", stderr);
|
||||
vfprintf(stderr, format, alist);
|
||||
va_end(alist);
|
||||
}
|
||||
|
||||
bool is_debug() {
|
||||
return _libsaproc_debug;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -107,6 +107,7 @@ struct ps_prochandle {
|
||||
int pathmap_open(const char* name);
|
||||
|
||||
void print_debug(const char* format,...);
|
||||
void print_error(const char* format,...);
|
||||
bool is_debug();
|
||||
|
||||
typedef bool (*thread_info_callback)(struct ps_prochandle* ph, pthread_t pid, lwpid_t lwpid);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -129,42 +129,66 @@ static bool process_get_lwp_info(struct ps_prochandle *ph, lwpid_t lwp_id, void
|
||||
return (errno == 0)? true: false;
|
||||
}
|
||||
|
||||
static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) {
|
||||
print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// waits until the ATTACH has stopped the process
|
||||
// by signal SIGSTOP
|
||||
static bool ptrace_waitpid(pid_t pid) {
|
||||
int ret;
|
||||
int status;
|
||||
do {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
|
||||
// will still be pending and delivered when the process is DETACHED and the process
|
||||
// will go to sleep.
|
||||
if (WSTOPSIG(status) == SIGSTOP) {
|
||||
// Debuggee stopped by SIGSTOP.
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
print_error("Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
print_debug("waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
print_debug("waitpid() failed. Unexpected error %d\n",errno);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} while(true);
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
if (ptrace(PT_ATTACH, pid, NULL, 0) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
} else {
|
||||
int ret;
|
||||
int status;
|
||||
do {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Debuggee stopped.
|
||||
return true;
|
||||
} else {
|
||||
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
print_debug("waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
print_debug("waitpid() failed. Unexpected error %d\n",errno);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} while(true);
|
||||
return ptrace_waitpid(pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,13 @@
|
||||
#include <jni.h>
|
||||
#include "libproc.h"
|
||||
|
||||
#include <elf.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(x86_64) && !defined(amd64)
|
||||
#define amd64 1
|
||||
#endif
|
||||
@@ -154,6 +161,39 @@ static void fillThreadsAndLoadObjects(JNIEnv* env, jobject this_obj, struct ps_p
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Verify that a named ELF binary file (core or executable) has the same
|
||||
* bitness as ourselves.
|
||||
* Throw an exception if there is a mismatch or other problem.
|
||||
*
|
||||
* If we proceed using a mismatched debugger/debuggee, the best to hope
|
||||
* for is a missing symbol, the worst is a crash searching for debug symbols.
|
||||
*/
|
||||
void verifyBitness(JNIEnv *env, const char *binaryName) {
|
||||
int fd = open(binaryName, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("cannot open binary file");
|
||||
}
|
||||
unsigned char elf_ident[EI_NIDENT];
|
||||
int i = read(fd, &elf_ident, sizeof(elf_ident));
|
||||
close(fd);
|
||||
|
||||
if (i < 0) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("cannot read binary file");
|
||||
}
|
||||
#ifndef _LP64
|
||||
if (elf_ident[EI_CLASS] == ELFCLASS64) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("debuggee is 64 bit, use 64-bit java for debugger");
|
||||
}
|
||||
#else
|
||||
if (elf_ident[EI_CLASS] != ELFCLASS64) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("debuggee is 32 bit, use 32 bit java for debugger");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal
|
||||
* Method: attach0
|
||||
@@ -162,6 +202,12 @@ static void fillThreadsAndLoadObjects(JNIEnv* env, jobject this_obj, struct ps_p
|
||||
JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_attach0__I
|
||||
(JNIEnv *env, jobject this_obj, jint jpid) {
|
||||
|
||||
// For bitness checking, locate binary at /proc/jpid/exe
|
||||
char buf[PATH_MAX];
|
||||
snprintf((char *) &buf, PATH_MAX, "/proc/%d/exe", jpid);
|
||||
verifyBitness(env, (char *) &buf);
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
struct ps_prochandle* ph;
|
||||
if ( (ph = Pgrab(jpid)) == NULL) {
|
||||
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process");
|
||||
@@ -187,6 +233,9 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at
|
||||
coreName_cstr = (*env)->GetStringUTFChars(env, coreName, &isCopy);
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
verifyBitness(env, execName_cstr);
|
||||
CHECK_EXCEPTION;
|
||||
|
||||
if ( (ph = Pgrab_core(execName_cstr, coreName_cstr)) == NULL) {
|
||||
(*env)->ReleaseStringUTFChars(env, execName, execName_cstr);
|
||||
(*env)->ReleaseStringUTFChars(env, coreName, coreName_cstr);
|
||||
@@ -280,7 +329,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
||||
return (err == PS_OK)? array : 0;
|
||||
}
|
||||
|
||||
#if defined(i386) || defined(ia64) || defined(amd64) || defined(sparc) || defined(sparcv9)
|
||||
#if defined(i386) || defined(amd64) || defined(sparc) || defined(sparcv9)
|
||||
JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0
|
||||
(JNIEnv *env, jobject this_obj, jint lwp_id) {
|
||||
|
||||
@@ -299,9 +348,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
||||
#ifdef i386
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
|
||||
#endif
|
||||
#ifdef ia64
|
||||
#define NPRGREG IA64_REG_COUNT
|
||||
#endif
|
||||
#ifdef amd64
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_NPRGREG
|
||||
#endif
|
||||
@@ -336,13 +382,6 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
|
||||
|
||||
#endif /* i386 */
|
||||
|
||||
#if ia64
|
||||
regs = (*env)->GetLongArrayElements(env, array, &isCopy);
|
||||
for (i = 0; i < NPRGREG; i++ ) {
|
||||
regs[i] = 0xDEADDEAD;
|
||||
}
|
||||
#endif /* ia64 */
|
||||
|
||||
#ifdef amd64
|
||||
#define REG_INDEX(reg) sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext_##reg
|
||||
|
||||
|
||||
@@ -79,14 +79,6 @@ combination of ptrace and /proc calls.
|
||||
|
||||
*************************************************************************************/
|
||||
|
||||
#ifdef ia64
|
||||
struct user_regs_struct {
|
||||
/* copied from user.h which doesn't define this in a struct */
|
||||
|
||||
#define IA64_REG_COUNT (EF_SIZE/8+32) /* integer and fp regs */
|
||||
unsigned long regs[IA64_REG_COUNT]; /* integer and fp regs */
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(sparc) || defined(sparcv9)
|
||||
#define user_regs_struct pt_regs
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -92,6 +92,14 @@ void print_debug(const char* format,...) {
|
||||
}
|
||||
}
|
||||
|
||||
void print_error(const char* format,...) {
|
||||
va_list alist;
|
||||
va_start(alist, format);
|
||||
fputs("ERROR: ", stderr);
|
||||
vfprintf(stderr, format, alist);
|
||||
va_end(alist);
|
||||
}
|
||||
|
||||
bool is_debug() {
|
||||
return _libsaproc_debug;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -105,6 +105,7 @@ struct ps_prochandle {
|
||||
int pathmap_open(const char* name);
|
||||
|
||||
void print_debug(const char* format,...);
|
||||
void print_error(const char* format,...);
|
||||
bool is_debug();
|
||||
|
||||
typedef bool (*thread_info_callback)(struct ps_prochandle* ph, pthread_t pid, lwpid_t lwpid);
|
||||
|
||||
@@ -132,12 +132,12 @@ static map_info* add_map_info(struct ps_prochandle* ph, int fd, off_t offset,
|
||||
}
|
||||
|
||||
// Part of the class sharing workaround
|
||||
static map_info* add_class_share_map_info(struct ps_prochandle* ph, off_t offset,
|
||||
static void add_class_share_map_info(struct ps_prochandle* ph, off_t offset,
|
||||
uintptr_t vaddr, size_t memsz) {
|
||||
map_info* map;
|
||||
if ((map = allocate_init_map(ph->core->classes_jsa_fd,
|
||||
offset, vaddr, memsz)) == NULL) {
|
||||
return NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
map->next = ph->core->class_share_maps;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include "libproc_impl.h"
|
||||
@@ -142,46 +143,71 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use
|
||||
|
||||
}
|
||||
|
||||
static bool ptrace_continue(pid_t pid, int signal) {
|
||||
// pass the signal to the process so we don't swallow it
|
||||
if (ptrace(PTRACE_CONT, pid, NULL, signal) < 0) {
|
||||
print_debug("ptrace(PTRACE_CONT, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// waits until the ATTACH has stopped the process
|
||||
// by signal SIGSTOP
|
||||
static bool ptrace_waitpid(pid_t pid) {
|
||||
int ret;
|
||||
int status;
|
||||
while (true) {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret == -1 && errno == ECHILD) {
|
||||
// try cloned process.
|
||||
ret = waitpid(pid, &status, __WALL);
|
||||
}
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP
|
||||
// will still be pending and delivered when the process is DETACHED and the process
|
||||
// will go to sleep.
|
||||
if (WSTOPSIG(status) == SIGSTOP) {
|
||||
// Debuggee stopped by SIGSTOP.
|
||||
return true;
|
||||
}
|
||||
if (!ptrace_continue(pid, WSTOPSIG(status))) {
|
||||
print_error("Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
print_debug("waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
print_debug("waitpid() failed. Unexpected error %d\n",errno);
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// attach to a process/thread specified by "pid"
|
||||
static bool ptrace_attach(pid_t pid) {
|
||||
if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) {
|
||||
print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid);
|
||||
return false;
|
||||
} else {
|
||||
int ret;
|
||||
int status;
|
||||
do {
|
||||
// Wait for debuggee to stop.
|
||||
ret = waitpid(pid, &status, 0);
|
||||
if (ret == -1 && errno == ECHILD) {
|
||||
// try cloned process.
|
||||
ret = waitpid(pid, &status, __WALL);
|
||||
}
|
||||
if (ret >= 0) {
|
||||
if (WIFSTOPPED(status)) {
|
||||
// Debuggee stopped.
|
||||
return true;
|
||||
} else {
|
||||
print_debug("waitpid(): Child process exited/terminated (status = 0x%x)\n", status);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
switch (errno) {
|
||||
case EINTR:
|
||||
continue;
|
||||
break;
|
||||
case ECHILD:
|
||||
print_debug("waitpid() failed. Child process pid (%d) does not exist \n", pid);
|
||||
break;
|
||||
case EINVAL:
|
||||
print_debug("waitpid() failed. Invalid options argument.\n");
|
||||
break;
|
||||
default:
|
||||
print_debug("waitpid() failed. Unexpected error %d\n",errno);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} while(true);
|
||||
return ptrace_waitpid(pid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,7 @@
|
||||
|
||||
#include "sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal.h"
|
||||
|
||||
#ifdef _M_IA64
|
||||
#include "sun_jvm_hotspot_debugger_ia64_IA64ThreadContext.h"
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_ia64_IA64ThreadContext_NPRGREG
|
||||
#elif _M_IX86
|
||||
#ifdef _M_IX86
|
||||
#include "sun_jvm_hotspot_debugger_x86_X86ThreadContext.h"
|
||||
#define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
|
||||
#elif _M_AMD64
|
||||
@@ -375,8 +372,7 @@ static bool attachToProcess(JNIEnv* env, jobject obj, jint pid) {
|
||||
|
||||
We are attaching to a process in 'read-only' mode. i.e., we do not want to
|
||||
put breakpoints, suspend/resume threads etc. For read-only JDI and HSDB kind of
|
||||
usage this should suffice. We are not intending to use this for full-fledged
|
||||
ProcessControl implementation to be used with BugSpotAgent.
|
||||
usage this should suffice.
|
||||
|
||||
Please refer to DEBUG_ATTACH_NONINVASIVE mode source comments from dbgeng.h.
|
||||
In this mode, debug engine does not call DebugActiveProrcess. i.e., we are not
|
||||
@@ -491,92 +487,7 @@ static bool addThreads(JNIEnv* env, jobject obj) {
|
||||
memset(&context, 0, sizeof(CONTEXT));
|
||||
|
||||
#undef REG_INDEX
|
||||
#ifdef _M_IA64
|
||||
#define REG_INDEX(x) sun_jvm_hotspot_debugger_ia64_IA64ThreadContext_##x
|
||||
|
||||
context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG;
|
||||
ptrIDebugAdvanced->GetThreadContext(&context, sizeof(CONTEXT));
|
||||
|
||||
ptrRegs[REG_INDEX(GR0)] = 0; // always 0
|
||||
ptrRegs[REG_INDEX(GR1)] = context.IntGp; // r1
|
||||
ptrRegs[REG_INDEX(GR2)] = context.IntT0; // r2-r3
|
||||
ptrRegs[REG_INDEX(GR3)] = context.IntT1;
|
||||
ptrRegs[REG_INDEX(GR4)] = context.IntS0; // r4-r7
|
||||
ptrRegs[REG_INDEX(GR5)] = context.IntS1;
|
||||
ptrRegs[REG_INDEX(GR6)] = context.IntS2;
|
||||
ptrRegs[REG_INDEX(GR7)] = context.IntS3;
|
||||
ptrRegs[REG_INDEX(GR8)] = context.IntV0; // r8
|
||||
ptrRegs[REG_INDEX(GR9)] = context.IntT2; // r9-r11
|
||||
ptrRegs[REG_INDEX(GR10)] = context.IntT3;
|
||||
ptrRegs[REG_INDEX(GR11)] = context.IntT4;
|
||||
ptrRegs[REG_INDEX(GR12)] = context.IntSp; // r12 stack pointer
|
||||
ptrRegs[REG_INDEX(GR13)] = context.IntTeb; // r13 teb
|
||||
ptrRegs[REG_INDEX(GR14)] = context.IntT5; // r14-r31
|
||||
ptrRegs[REG_INDEX(GR15)] = context.IntT6;
|
||||
ptrRegs[REG_INDEX(GR16)] = context.IntT7;
|
||||
ptrRegs[REG_INDEX(GR17)] = context.IntT8;
|
||||
ptrRegs[REG_INDEX(GR18)] = context.IntT9;
|
||||
ptrRegs[REG_INDEX(GR19)] = context.IntT10;
|
||||
ptrRegs[REG_INDEX(GR20)] = context.IntT11;
|
||||
ptrRegs[REG_INDEX(GR21)] = context.IntT12;
|
||||
ptrRegs[REG_INDEX(GR22)] = context.IntT13;
|
||||
ptrRegs[REG_INDEX(GR23)] = context.IntT14;
|
||||
ptrRegs[REG_INDEX(GR24)] = context.IntT15;
|
||||
ptrRegs[REG_INDEX(GR25)] = context.IntT16;
|
||||
ptrRegs[REG_INDEX(GR26)] = context.IntT17;
|
||||
ptrRegs[REG_INDEX(GR27)] = context.IntT18;
|
||||
ptrRegs[REG_INDEX(GR28)] = context.IntT19;
|
||||
ptrRegs[REG_INDEX(GR29)] = context.IntT20;
|
||||
ptrRegs[REG_INDEX(GR30)] = context.IntT21;
|
||||
ptrRegs[REG_INDEX(GR31)] = context.IntT22;
|
||||
|
||||
ptrRegs[REG_INDEX(INT_NATS)] = context.IntNats;
|
||||
ptrRegs[REG_INDEX(PREDS)] = context.Preds;
|
||||
|
||||
ptrRegs[REG_INDEX(BR_RP)] = context.BrRp;
|
||||
ptrRegs[REG_INDEX(BR1)] = context.BrS0; // b1-b5
|
||||
ptrRegs[REG_INDEX(BR2)] = context.BrS1;
|
||||
ptrRegs[REG_INDEX(BR3)] = context.BrS2;
|
||||
ptrRegs[REG_INDEX(BR4)] = context.BrS3;
|
||||
ptrRegs[REG_INDEX(BR5)] = context.BrS4;
|
||||
ptrRegs[REG_INDEX(BR6)] = context.BrT0; // b6-b7
|
||||
ptrRegs[REG_INDEX(BR7)] = context.BrT1;
|
||||
|
||||
ptrRegs[REG_INDEX(AP_UNAT)] = context.ApUNAT;
|
||||
ptrRegs[REG_INDEX(AP_LC)] = context.ApLC;
|
||||
ptrRegs[REG_INDEX(AP_EC)] = context.ApEC;
|
||||
ptrRegs[REG_INDEX(AP_CCV)] = context.ApCCV;
|
||||
ptrRegs[REG_INDEX(AP_DCR)] = context.ApDCR;
|
||||
|
||||
ptrRegs[REG_INDEX(RS_PFS)] = context.RsPFS;
|
||||
ptrRegs[REG_INDEX(RS_BSP)] = context.RsBSP;
|
||||
ptrRegs[REG_INDEX(RS_BSPSTORE)] = context.RsBSPSTORE;
|
||||
ptrRegs[REG_INDEX(RS_RSC)] = context.RsRSC;
|
||||
ptrRegs[REG_INDEX(RS_RNAT)] = context.RsRNAT;
|
||||
|
||||
ptrRegs[REG_INDEX(ST_IPSR)] = context.StIPSR;
|
||||
ptrRegs[REG_INDEX(ST_IIP)] = context.StIIP;
|
||||
ptrRegs[REG_INDEX(ST_IFS)] = context.StIFS;
|
||||
|
||||
ptrRegs[REG_INDEX(DB_I0)] = context.DbI0;
|
||||
ptrRegs[REG_INDEX(DB_I1)] = context.DbI1;
|
||||
ptrRegs[REG_INDEX(DB_I2)] = context.DbI2;
|
||||
ptrRegs[REG_INDEX(DB_I3)] = context.DbI3;
|
||||
ptrRegs[REG_INDEX(DB_I4)] = context.DbI4;
|
||||
ptrRegs[REG_INDEX(DB_I5)] = context.DbI5;
|
||||
ptrRegs[REG_INDEX(DB_I6)] = context.DbI6;
|
||||
ptrRegs[REG_INDEX(DB_I7)] = context.DbI7;
|
||||
|
||||
ptrRegs[REG_INDEX(DB_D0)] = context.DbD0;
|
||||
ptrRegs[REG_INDEX(DB_D1)] = context.DbD1;
|
||||
ptrRegs[REG_INDEX(DB_D2)] = context.DbD2;
|
||||
ptrRegs[REG_INDEX(DB_D3)] = context.DbD3;
|
||||
ptrRegs[REG_INDEX(DB_D4)] = context.DbD4;
|
||||
ptrRegs[REG_INDEX(DB_D5)] = context.DbD5;
|
||||
ptrRegs[REG_INDEX(DB_D6)] = context.DbD6;
|
||||
ptrRegs[REG_INDEX(DB_D7)] = context.DbD7;
|
||||
|
||||
#elif _M_IX86
|
||||
#ifdef _M_IX86
|
||||
#define REG_INDEX(x) sun_jvm_hotspot_debugger_x86_X86ThreadContext_##x
|
||||
|
||||
context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.asm.amd64;
|
||||
|
||||
import sun.jvm.hotspot.asm.Register;
|
||||
import sun.jvm.hotspot.utilities.Assert;
|
||||
|
||||
public class AMD64FloatRegister extends Register {
|
||||
|
||||
public AMD64FloatRegister(int number) {
|
||||
super(number);
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public int getNumberOfRegisters() {
|
||||
return AMD64FloatRegisters.getNumRegisters();
|
||||
}
|
||||
|
||||
public boolean isFloat() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isFramePointer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isStackPointer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return number >= 0 && number < AMD64FloatRegisters.getNumRegisters();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return AMD64FloatRegisters.getRegisterName(number);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,799 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.net.*;
|
||||
import java.rmi.*;
|
||||
import sun.jvm.hotspot.*;
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.bsd.*;
|
||||
import sun.jvm.hotspot.debugger.proc.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.debugger.windbg.*;
|
||||
import sun.jvm.hotspot.debugger.linux.*;
|
||||
import sun.jvm.hotspot.debugger.sparc.*;
|
||||
import sun.jvm.hotspot.debugger.remote.*;
|
||||
import sun.jvm.hotspot.livejvm.*;
|
||||
import sun.jvm.hotspot.memory.*;
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.types.*;
|
||||
import sun.jvm.hotspot.utilities.*;
|
||||
|
||||
/** <P> This class wraps the basic functionality for connecting to the
|
||||
* target process or debug server. It makes it simple to start up the
|
||||
* debugging system. </P>
|
||||
*
|
||||
* <P> This agent (as compared to the HotSpotAgent) can connect to
|
||||
* and interact with arbitrary processes. If the target process
|
||||
* happens to be a HotSpot JVM, the Java debugging features of the
|
||||
* Serviceability Agent are enabled. Further, if the Serviceability
|
||||
* Agent's JVMDI module is loaded into the target VM, interaction
|
||||
* with the live Java program is possible, specifically the catching
|
||||
* of exceptions and setting of breakpoints. </P>
|
||||
*
|
||||
* <P> The BugSpot debugger requires that the underlying Debugger
|
||||
* support C/C++ debugging via the CDebugger interface. </P>
|
||||
*
|
||||
* <P> FIXME: especially with the addition of remote debugging, this
|
||||
* has turned into a mess; needs rethinking. </P> */
|
||||
|
||||
public class BugSpotAgent {
|
||||
|
||||
private JVMDebugger debugger;
|
||||
private MachineDescription machDesc;
|
||||
private TypeDataBase db;
|
||||
|
||||
private String os;
|
||||
private String cpu;
|
||||
private String fileSep;
|
||||
|
||||
// The system can work in several ways:
|
||||
// - Attaching to local process
|
||||
// - Attaching to local core file
|
||||
// - Connecting to remote debug server
|
||||
// - Starting debug server for process
|
||||
// - Starting debug server for core file
|
||||
|
||||
// These are options for the "client" side of things
|
||||
private static final int PROCESS_MODE = 0;
|
||||
private static final int CORE_FILE_MODE = 1;
|
||||
private static final int REMOTE_MODE = 2;
|
||||
private int startupMode;
|
||||
|
||||
// This indicates whether we are really starting a server or not
|
||||
private boolean isServer;
|
||||
|
||||
// All possible required information for connecting
|
||||
private int pid;
|
||||
private String executableName;
|
||||
private String coreFileName;
|
||||
private String debugServerID;
|
||||
|
||||
// All needed information for server side
|
||||
private String serverID;
|
||||
|
||||
// Indicates whether we are attached to a HotSpot JVM or not
|
||||
private boolean javaMode;
|
||||
|
||||
// Indicates whether we have process control over a live HotSpot JVM
|
||||
// or not; non-null if so.
|
||||
private ServiceabilityAgentJVMDIModule jvmdi;
|
||||
// While handling C breakpoints interactivity with the Java program
|
||||
// is forbidden. Too many invariants are broken while the target is
|
||||
// stopped at a C breakpoint to risk making JVMDI calls.
|
||||
private boolean javaInteractionDisabled;
|
||||
|
||||
private String[] jvmLibNames;
|
||||
private String[] saLibNames;
|
||||
|
||||
// FIXME: make these configurable, i.e., via a dotfile; also
|
||||
// consider searching within the JDK from which this Java executable
|
||||
// comes to find them
|
||||
private static final String defaultDbxPathPrefix = "/net/jano.eng/export/disk05/hotspot/sa";
|
||||
private static final String defaultDbxSvcAgentDSOPathPrefix = "/net/jano.eng/export/disk05/hotspot/sa";
|
||||
|
||||
private static final boolean DEBUG;
|
||||
static {
|
||||
DEBUG = System.getProperty("sun.jvm.hotspot.bugspot.BugSpotAgent.DEBUG")
|
||||
!= null;
|
||||
}
|
||||
|
||||
static void debugPrintln(String str) {
|
||||
if (DEBUG) {
|
||||
System.err.println(str);
|
||||
}
|
||||
}
|
||||
|
||||
static void showUsage() {
|
||||
System.out.println(" You can also pass these -D options to java to specify where to find dbx and the \n" +
|
||||
" Serviceability Agent plugin for dbx:");
|
||||
System.out.println(" -DdbxPathName=<path-to-dbx-executable>\n" +
|
||||
" Default is derived from dbxPathPrefix");
|
||||
System.out.println(" or");
|
||||
System.out.println(" -DdbxPathPrefix=<xxx>\n" +
|
||||
" where xxx is the path name of a dir structure that contains:\n" +
|
||||
" <os>/<arch>/bin/dbx\n" +
|
||||
" The default is " + defaultDbxPathPrefix);
|
||||
System.out.println(" and");
|
||||
System.out.println(" -DdbxSvcAgentDSOPathName=<path-to-dbx-serviceability-agent-module>\n" +
|
||||
" Default is determined from dbxSvcAgentDSOPathPrefix");
|
||||
System.out.println(" or");
|
||||
System.out.println(" -DdbxSvcAgentDSOPathPrefix=<xxx>\n" +
|
||||
" where xxx is the pathname of a dir structure that contains:\n" +
|
||||
" <os>/<arch>/bin/lib/libsvc_agent_dbx.so\n" +
|
||||
" The default is " + defaultDbxSvcAgentDSOPathPrefix);
|
||||
}
|
||||
|
||||
public BugSpotAgent() {
|
||||
// for non-server add shutdown hook to clean-up debugger in case
|
||||
// of forced exit. For remote server, shutdown hook is added by
|
||||
// DebugServer.
|
||||
Runtime.getRuntime().addShutdownHook(new java.lang.Thread(
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
synchronized (BugSpotAgent.this) {
|
||||
if (!isServer) {
|
||||
detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Accessors (once the system is set up)
|
||||
//
|
||||
|
||||
public synchronized Debugger getDebugger() {
|
||||
return debugger;
|
||||
}
|
||||
|
||||
public synchronized CDebugger getCDebugger() {
|
||||
return getDebugger().getCDebugger();
|
||||
}
|
||||
|
||||
public synchronized ProcessControl getProcessControl() {
|
||||
return getCDebugger().getProcessControl();
|
||||
}
|
||||
|
||||
public synchronized TypeDataBase getTypeDataBase() {
|
||||
return db;
|
||||
}
|
||||
|
||||
/** Indicates whether the target process is suspended
|
||||
completely. Equivalent to getProcessControl().isSuspended(). */
|
||||
public synchronized boolean isSuspended() throws DebuggerException {
|
||||
return getProcessControl().isSuspended();
|
||||
}
|
||||
|
||||
/** Suspends the target process completely. Equivalent to
|
||||
getProcessControl().suspend(). */
|
||||
public synchronized void suspend() throws DebuggerException {
|
||||
getProcessControl().suspend();
|
||||
}
|
||||
|
||||
/** Resumes the target process completely. Equivalent to
|
||||
getProcessControl().suspend(). */
|
||||
public synchronized void resume() throws DebuggerException {
|
||||
getProcessControl().resume();
|
||||
}
|
||||
|
||||
/** Indicates whether we are attached to a Java HotSpot virtual
|
||||
machine */
|
||||
public synchronized boolean isJavaMode() {
|
||||
return javaMode;
|
||||
}
|
||||
|
||||
/** Temporarily disables interaction with the target process via
|
||||
JVMDI. This is done while the target process is stopped at a C
|
||||
breakpoint. Can be called even if the JVMDI agent has not been
|
||||
initialized. */
|
||||
public synchronized void disableJavaInteraction() {
|
||||
javaInteractionDisabled = true;
|
||||
}
|
||||
|
||||
/** Re-enables interaction with the target process via JVMDI. This
|
||||
is done while the target process is continued past a C
|
||||
braekpoint. Can be called even if the JVMDI agent has not been
|
||||
initialized. */
|
||||
public synchronized void enableJavaInteraction() {
|
||||
javaInteractionDisabled = false;
|
||||
}
|
||||
|
||||
/** Indicates whether Java interaction has been disabled */
|
||||
public synchronized boolean isJavaInteractionDisabled() {
|
||||
return javaInteractionDisabled;
|
||||
}
|
||||
|
||||
/** Indicates whether we can talk to the Serviceability Agent's
|
||||
JVMDI module to be able to set breakpoints */
|
||||
public synchronized boolean canInteractWithJava() {
|
||||
return (jvmdi != null) && !javaInteractionDisabled;
|
||||
}
|
||||
|
||||
/** Suspends all Java threads in the target process. Can only be
|
||||
called if we are attached to a HotSpot JVM and can connect to
|
||||
the SA's JVMDI module. Must not be called when the target
|
||||
process has been suspended with suspend(). */
|
||||
public synchronized void suspendJava() throws DebuggerException {
|
||||
if (!canInteractWithJava()) {
|
||||
throw new DebuggerException("Could not connect to SA's JVMDI module");
|
||||
}
|
||||
if (jvmdi.isSuspended()) {
|
||||
throw new DebuggerException("Target process already suspended via JVMDI");
|
||||
}
|
||||
jvmdi.suspend();
|
||||
}
|
||||
|
||||
/** Resumes all Java threads in the target process. Can only be
|
||||
called if we are attached to a HotSpot JVM and can connect to
|
||||
the SA's JVMDI module. Must not be called when the target
|
||||
process has been suspended with suspend(). */
|
||||
public synchronized void resumeJava() throws DebuggerException {
|
||||
if (!canInteractWithJava()) {
|
||||
throw new DebuggerException("Could not connect to SA's JVMDI module");
|
||||
}
|
||||
if (!jvmdi.isSuspended()) {
|
||||
throw new DebuggerException("Target process already resumed via JVMDI");
|
||||
}
|
||||
jvmdi.resume();
|
||||
}
|
||||
|
||||
/** Indicates whether the target process has been suspended at the
|
||||
Java language level via the SA's JVMDI module */
|
||||
public synchronized boolean isJavaSuspended() throws DebuggerException {
|
||||
return jvmdi.isSuspended();
|
||||
}
|
||||
|
||||
/** Toggle a Java breakpoint at the given location. */
|
||||
public synchronized ServiceabilityAgentJVMDIModule.BreakpointToggleResult
|
||||
toggleJavaBreakpoint(String srcFileName,
|
||||
String pkgName,
|
||||
int lineNo) {
|
||||
if (!canInteractWithJava()) {
|
||||
throw new DebuggerException("Could not connect to SA's JVMDI module; can not toggle Java breakpoints");
|
||||
}
|
||||
return jvmdi.toggleBreakpoint(srcFileName, pkgName, lineNo);
|
||||
}
|
||||
|
||||
/** Access to JVMDI module's eventPending */
|
||||
public synchronized boolean javaEventPending() throws DebuggerException {
|
||||
if (!canInteractWithJava()) {
|
||||
throw new DebuggerException("Could not connect to SA's JVMDI module; can not poll for Java debug events");
|
||||
}
|
||||
return jvmdi.eventPending();
|
||||
}
|
||||
|
||||
/** Access to JVMDI module's eventPoll */
|
||||
public synchronized Event javaEventPoll() throws DebuggerException {
|
||||
if (!canInteractWithJava()) {
|
||||
throw new DebuggerException("Could not connect to SA's JVMDI module; can not poll for Java debug events");
|
||||
}
|
||||
return jvmdi.eventPoll();
|
||||
}
|
||||
|
||||
/** Access to JVMDI module's eventContinue */
|
||||
public synchronized void javaEventContinue() throws DebuggerException {
|
||||
if (!canInteractWithJava()) {
|
||||
throw new DebuggerException("Could not connect to SA's JVMDI module; can not continue past Java debug events");
|
||||
}
|
||||
jvmdi.eventContinue();
|
||||
}
|
||||
|
||||
|
||||
// FIXME: add other accessors. For example, suspension and
|
||||
// resumption should be done through this interface, as well as
|
||||
// interaction with the live Java process such as breakpoint setting.
|
||||
// Probably should not expose the ServiceabilityAgentJVMDIModule
|
||||
// from this interface.
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Client-side operations
|
||||
//
|
||||
|
||||
/** This attaches to a process running on the local machine. */
|
||||
public synchronized void attach(int processID)
|
||||
throws DebuggerException {
|
||||
if (debugger != null) {
|
||||
throw new DebuggerException("Already attached");
|
||||
}
|
||||
pid = processID;
|
||||
startupMode = PROCESS_MODE;
|
||||
isServer = false;
|
||||
go();
|
||||
}
|
||||
|
||||
/** This opens a core file on the local machine */
|
||||
public synchronized void attach(String executableName, String coreFileName)
|
||||
throws DebuggerException {
|
||||
if (debugger != null) {
|
||||
throw new DebuggerException("Already attached");
|
||||
}
|
||||
if ((executableName == null) || (coreFileName == null)) {
|
||||
throw new DebuggerException("Both the core file name and executable name must be specified");
|
||||
}
|
||||
this.executableName = executableName;
|
||||
this.coreFileName = coreFileName;
|
||||
startupMode = CORE_FILE_MODE;
|
||||
isServer = false;
|
||||
go();
|
||||
}
|
||||
|
||||
/** This attaches to a "debug server" on a remote machine; this
|
||||
remote server has already attached to a process or opened a
|
||||
core file and is waiting for RMI calls on the Debugger object to
|
||||
come in. */
|
||||
public synchronized void attach(String remoteServerID)
|
||||
throws DebuggerException {
|
||||
if (debugger != null) {
|
||||
throw new DebuggerException("Already attached to a process");
|
||||
}
|
||||
if (remoteServerID == null) {
|
||||
throw new DebuggerException("Debug server id must be specified");
|
||||
}
|
||||
|
||||
debugServerID = remoteServerID;
|
||||
startupMode = REMOTE_MODE;
|
||||
isServer = false;
|
||||
go();
|
||||
}
|
||||
|
||||
/** This should only be called by the user on the client machine,
|
||||
not the server machine */
|
||||
public synchronized boolean detach() throws DebuggerException {
|
||||
if (isServer) {
|
||||
throw new DebuggerException("Should not call detach() for server configuration");
|
||||
}
|
||||
return detachInternal();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Server-side operations
|
||||
//
|
||||
|
||||
/** This attaches to a process running on the local machine and
|
||||
starts a debug server, allowing remote machines to connect and
|
||||
examine this process. uniqueID is used to uniquely identify the
|
||||
debuggee */
|
||||
public synchronized void startServer(int processID, String uniqueID)
|
||||
throws DebuggerException {
|
||||
if (debugger != null) {
|
||||
throw new DebuggerException("Already attached");
|
||||
}
|
||||
pid = processID;
|
||||
startupMode = PROCESS_MODE;
|
||||
isServer = true;
|
||||
serverID = uniqueID;
|
||||
go();
|
||||
}
|
||||
|
||||
/** This attaches to a process running on the local machine and
|
||||
starts a debug server, allowing remote machines to connect and
|
||||
examine this process. */
|
||||
public synchronized void startServer(int processID)
|
||||
throws DebuggerException {
|
||||
startServer(processID, null);
|
||||
}
|
||||
|
||||
/** This opens a core file on the local machine and starts a debug
|
||||
server, allowing remote machines to connect and examine this
|
||||
core file. uniqueID is used to uniquely identify the
|
||||
debuggee */
|
||||
public synchronized void startServer(String executableName, String coreFileName,
|
||||
String uniqueID)
|
||||
throws DebuggerException {
|
||||
if (debugger != null) {
|
||||
throw new DebuggerException("Already attached");
|
||||
}
|
||||
if ((executableName == null) || (coreFileName == null)) {
|
||||
throw new DebuggerException("Both the core file name and Java executable name must be specified");
|
||||
}
|
||||
this.executableName = executableName;
|
||||
this.coreFileName = coreFileName;
|
||||
startupMode = CORE_FILE_MODE;
|
||||
isServer = true;
|
||||
serverID = uniqueID;
|
||||
go();
|
||||
}
|
||||
|
||||
/** This opens a core file on the local machine and starts a debug
|
||||
server, allowing remote machines to connect and examine this
|
||||
core file.*/
|
||||
public synchronized void startServer(String executableName, String coreFileName)
|
||||
throws DebuggerException {
|
||||
startServer(executableName, coreFileName, null);
|
||||
}
|
||||
|
||||
/** This may only be called on the server side after startServer()
|
||||
has been called */
|
||||
public synchronized boolean shutdownServer() throws DebuggerException {
|
||||
if (!isServer) {
|
||||
throw new DebuggerException("Should not call shutdownServer() for client configuration");
|
||||
}
|
||||
return detachInternal();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// Internals only below this point
|
||||
//
|
||||
|
||||
private boolean detachInternal() {
|
||||
if (debugger == null) {
|
||||
return false;
|
||||
}
|
||||
if (canInteractWithJava()) {
|
||||
jvmdi.detach();
|
||||
jvmdi = null;
|
||||
}
|
||||
boolean retval = true;
|
||||
if (!isServer) {
|
||||
VM.shutdown();
|
||||
}
|
||||
// We must not call detach() if we are a client and are connected
|
||||
// to a remote debugger
|
||||
Debugger dbg = null;
|
||||
DebuggerException ex = null;
|
||||
if (isServer) {
|
||||
try {
|
||||
RMIHelper.unbind(serverID);
|
||||
}
|
||||
catch (DebuggerException de) {
|
||||
ex = de;
|
||||
}
|
||||
dbg = debugger;
|
||||
} else {
|
||||
if (startupMode != REMOTE_MODE) {
|
||||
dbg = debugger;
|
||||
}
|
||||
}
|
||||
if (dbg != null) {
|
||||
retval = dbg.detach();
|
||||
}
|
||||
|
||||
debugger = null;
|
||||
machDesc = null;
|
||||
db = null;
|
||||
if (ex != null) {
|
||||
throw(ex);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
private void go() {
|
||||
setupDebugger();
|
||||
javaMode = setupVM();
|
||||
}
|
||||
|
||||
private void setupDebugger() {
|
||||
if (startupMode != REMOTE_MODE) {
|
||||
//
|
||||
// Local mode (client attaching to local process or setting up
|
||||
// server, but not client attaching to server)
|
||||
//
|
||||
|
||||
try {
|
||||
os = PlatformInfo.getOS();
|
||||
cpu = PlatformInfo.getCPU();
|
||||
}
|
||||
catch (UnsupportedPlatformException e) {
|
||||
throw new DebuggerException(e);
|
||||
}
|
||||
fileSep = System.getProperty("file.separator");
|
||||
|
||||
if (os.equals("solaris")) {
|
||||
setupDebuggerSolaris();
|
||||
} else if (os.equals("win32")) {
|
||||
setupDebuggerWin32();
|
||||
} else if (os.equals("linux")) {
|
||||
setupDebuggerLinux();
|
||||
} else if (os.equals("bsd")) {
|
||||
setupDebuggerBsd();
|
||||
} else {
|
||||
// Add support for more operating systems here
|
||||
throw new DebuggerException("Operating system " + os + " not yet supported");
|
||||
}
|
||||
if (isServer) {
|
||||
RemoteDebuggerServer remote = null;
|
||||
try {
|
||||
remote = new RemoteDebuggerServer(debugger);
|
||||
}
|
||||
catch (RemoteException rem) {
|
||||
throw new DebuggerException(rem);
|
||||
}
|
||||
RMIHelper.rebind(serverID, remote);
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// Remote mode (client attaching to server)
|
||||
//
|
||||
|
||||
// Create and install a security manager
|
||||
|
||||
// FIXME: currently commented out because we were having
|
||||
// security problems since we're "in the sun.* hierarchy" here.
|
||||
// Perhaps a permissive policy file would work around this. In
|
||||
// the long run, will probably have to move into com.sun.*.
|
||||
|
||||
// if (System.getSecurityManager() == null) {
|
||||
// System.setSecurityManager(new RMISecurityManager());
|
||||
// }
|
||||
|
||||
connectRemoteDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean setupVM() {
|
||||
// We need to instantiate a HotSpotTypeDataBase on both the client
|
||||
// and server machine. On the server it is only currently used to
|
||||
// configure the Java primitive type sizes (which we should
|
||||
// consider making constant). On the client it is used to
|
||||
// configure the VM.
|
||||
|
||||
try {
|
||||
if (os.equals("solaris")) {
|
||||
db = new HotSpotTypeDataBase(machDesc, new HotSpotSolarisVtblAccess(debugger, jvmLibNames),
|
||||
debugger, jvmLibNames);
|
||||
} else if (os.equals("win32")) {
|
||||
db = new HotSpotTypeDataBase(machDesc, new Win32VtblAccess(debugger, jvmLibNames),
|
||||
debugger, jvmLibNames);
|
||||
} else if (os.equals("linux")) {
|
||||
db = new HotSpotTypeDataBase(machDesc, new LinuxVtblAccess(debugger, jvmLibNames),
|
||||
debugger, jvmLibNames);
|
||||
} else if (os.equals("bsd")) {
|
||||
db = new HotSpotTypeDataBase(machDesc, new BsdVtblAccess(debugger, jvmLibNames),
|
||||
debugger, jvmLibNames);
|
||||
} else {
|
||||
throw new DebuggerException("OS \"" + os + "\" not yet supported (no VtblAccess implemented yet)");
|
||||
}
|
||||
}
|
||||
catch (NoSuchSymbolException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (startupMode != REMOTE_MODE) {
|
||||
// Configure the debugger with the primitive type sizes just obtained from the VM
|
||||
debugger.configureJavaPrimitiveTypeSizes(db.getJBooleanType().getSize(),
|
||||
db.getJByteType().getSize(),
|
||||
db.getJCharType().getSize(),
|
||||
db.getJDoubleType().getSize(),
|
||||
db.getJFloatType().getSize(),
|
||||
db.getJIntType().getSize(),
|
||||
db.getJLongType().getSize(),
|
||||
db.getJShortType().getSize());
|
||||
}
|
||||
|
||||
if (!isServer) {
|
||||
// Do not initialize the VM on the server (unnecessary, since it's
|
||||
// instantiated on the client)
|
||||
VM.initialize(db, debugger);
|
||||
}
|
||||
|
||||
try {
|
||||
jvmdi = new ServiceabilityAgentJVMDIModule(debugger, saLibNames);
|
||||
if (jvmdi.canAttach()) {
|
||||
jvmdi.attach();
|
||||
jvmdi.setCommandTimeout(6000);
|
||||
debugPrintln("Attached to Serviceability Agent's JVMDI module.");
|
||||
// Jog VM to suspended point with JVMDI module
|
||||
resume();
|
||||
suspendJava();
|
||||
suspend();
|
||||
debugPrintln("Suspended all Java threads.");
|
||||
} else {
|
||||
debugPrintln("Could not locate SA's JVMDI module; skipping attachment");
|
||||
jvmdi = null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
jvmdi = null;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// OS-specific debugger setup/connect routines
|
||||
//
|
||||
|
||||
//
|
||||
// Solaris
|
||||
//
|
||||
|
||||
private void setupDebuggerSolaris() {
|
||||
setupJVMLibNamesSolaris();
|
||||
ProcDebuggerLocal dbg = new ProcDebuggerLocal(null, true);
|
||||
debugger = dbg;
|
||||
attachDebugger();
|
||||
|
||||
// Set up CPU-dependent stuff
|
||||
if (cpu.equals("x86")) {
|
||||
machDesc = new MachineDescriptionIntelX86();
|
||||
} else if (cpu.equals("sparc")) {
|
||||
int addressSize = dbg.getRemoteProcessAddressSize();
|
||||
if (addressSize == -1) {
|
||||
throw new DebuggerException("Error occurred while trying to determine the remote process's address size");
|
||||
}
|
||||
|
||||
if (addressSize == 32) {
|
||||
machDesc = new MachineDescriptionSPARC32Bit();
|
||||
} else if (addressSize == 64) {
|
||||
machDesc = new MachineDescriptionSPARC64Bit();
|
||||
} else {
|
||||
throw new DebuggerException("Address size " + addressSize + " is not supported on SPARC");
|
||||
}
|
||||
} else if (cpu.equals("amd64")) {
|
||||
machDesc = new MachineDescriptionAMD64();
|
||||
} else {
|
||||
throw new DebuggerException("Solaris only supported on sparc/sparcv9/x86/amd64");
|
||||
}
|
||||
|
||||
dbg.setMachineDescription(machDesc);
|
||||
}
|
||||
|
||||
private void connectRemoteDebugger() throws DebuggerException {
|
||||
RemoteDebugger remote =
|
||||
(RemoteDebugger) RMIHelper.lookup(debugServerID);
|
||||
debugger = new RemoteDebuggerClient(remote);
|
||||
machDesc = ((RemoteDebuggerClient) debugger).getMachineDescription();
|
||||
os = debugger.getOS();
|
||||
if (os.equals("solaris")) {
|
||||
setupJVMLibNamesSolaris();
|
||||
} else if (os.equals("win32")) {
|
||||
setupJVMLibNamesWin32();
|
||||
} else if (os.equals("linux")) {
|
||||
setupJVMLibNamesLinux();
|
||||
} else if (os.equals("bsd")) {
|
||||
setupJVMLibNamesBsd();
|
||||
} else {
|
||||
throw new RuntimeException("Unknown OS type");
|
||||
}
|
||||
|
||||
cpu = debugger.getCPU();
|
||||
}
|
||||
|
||||
private void setupJVMLibNamesSolaris() {
|
||||
jvmLibNames = new String[] { "libjvm.so", "libjvm_g.so", "gamma_g" };
|
||||
saLibNames = new String[] { "libsa.so", "libsa_g.so" };
|
||||
}
|
||||
|
||||
//
|
||||
// Win32
|
||||
//
|
||||
|
||||
private void setupDebuggerWin32() {
|
||||
setupJVMLibNamesWin32();
|
||||
|
||||
if (cpu.equals("x86")) {
|
||||
machDesc = new MachineDescriptionIntelX86();
|
||||
} else if (cpu.equals("amd64")) {
|
||||
machDesc = new MachineDescriptionAMD64();
|
||||
} else if (cpu.equals("ia64")) {
|
||||
machDesc = new MachineDescriptionIA64();
|
||||
} else {
|
||||
throw new DebuggerException("Win32 supported under x86, amd64 and ia64 only");
|
||||
}
|
||||
|
||||
// Note we do not use a cache for the local debugger in server
|
||||
// mode; it will be taken care of on the client side (once remote
|
||||
// debugging is implemented).
|
||||
|
||||
debugger = new WindbgDebuggerLocal(machDesc, !isServer);
|
||||
|
||||
attachDebugger();
|
||||
}
|
||||
|
||||
private void setupJVMLibNamesWin32() {
|
||||
jvmLibNames = new String[] { "jvm.dll", "jvm_g.dll" };
|
||||
saLibNames = new String[] { "sa.dll", "sa_g.dll" };
|
||||
}
|
||||
|
||||
//
|
||||
// Linux
|
||||
//
|
||||
|
||||
private void setupDebuggerLinux() {
|
||||
setupJVMLibNamesLinux();
|
||||
|
||||
if (cpu.equals("x86")) {
|
||||
machDesc = new MachineDescriptionIntelX86();
|
||||
} else if (cpu.equals("ia64")) {
|
||||
machDesc = new MachineDescriptionIA64();
|
||||
} else if (cpu.equals("amd64")) {
|
||||
machDesc = new MachineDescriptionAMD64();
|
||||
} else if (cpu.equals("sparc")) {
|
||||
if (LinuxDebuggerLocal.getAddressSize()==8) {
|
||||
machDesc = new MachineDescriptionSPARC64Bit();
|
||||
} else {
|
||||
machDesc = new MachineDescriptionSPARC32Bit();
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
machDesc = (MachineDescription)
|
||||
Class.forName("sun.jvm.hotspot.debugger.MachineDescription" +
|
||||
cpu.toUpperCase()).newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new DebuggerException("unsupported machine type");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Note we do not use a cache for the local debugger in server
|
||||
// mode; it will be taken care of on the client side (once remote
|
||||
// debugging is implemented).
|
||||
|
||||
debugger = new LinuxDebuggerLocal(machDesc, !isServer);
|
||||
attachDebugger();
|
||||
}
|
||||
|
||||
private void setupJVMLibNamesLinux() {
|
||||
// same as solaris
|
||||
setupJVMLibNamesSolaris();
|
||||
}
|
||||
|
||||
//
|
||||
// BSD
|
||||
//
|
||||
|
||||
private void setupDebuggerBsd() {
|
||||
setupJVMLibNamesBsd();
|
||||
|
||||
if (cpu.equals("x86")) {
|
||||
machDesc = new MachineDescriptionIntelX86();
|
||||
} else if (cpu.equals("amd64") || (cpu.equals("x86_64"))) {
|
||||
machDesc = new MachineDescriptionAMD64();
|
||||
} else {
|
||||
throw new DebuggerException("Bsd only supported on x86/x86_64. Current arch: " + cpu);
|
||||
}
|
||||
|
||||
// Note we do not use a cache for the local debugger in server
|
||||
// mode; it will be taken care of on the client side (once remote
|
||||
// debugging is implemented).
|
||||
|
||||
debugger = new BsdDebuggerLocal(machDesc, !isServer);
|
||||
attachDebugger();
|
||||
}
|
||||
|
||||
private void setupJVMLibNamesBsd() {
|
||||
// same as solaris
|
||||
setupJVMLibNamesSolaris();
|
||||
}
|
||||
|
||||
/** Convenience routine which should be called by per-platform
|
||||
debugger setup. Should not be called when startupMode is
|
||||
REMOTE_MODE. */
|
||||
private void attachDebugger() {
|
||||
if (startupMode == PROCESS_MODE) {
|
||||
debugger.attach(pid);
|
||||
} else if (startupMode == CORE_FILE_MODE) {
|
||||
debugger.attach(executableName, coreFileName);
|
||||
} else {
|
||||
throw new DebuggerException("Should not call attach() for startupMode == " + startupMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
|
||||
/** Wrapper class which describes line number information for Java
|
||||
class files. The line number table is converted into this
|
||||
representation on demand. These objects are then sorted by line
|
||||
number for fast lookup when setting breakpoints in a particular
|
||||
source file. */
|
||||
|
||||
public class JavaLineNumberInfo {
|
||||
private InstanceKlass klass;
|
||||
private Method method;
|
||||
private int startBCI;
|
||||
private int lineNumber;
|
||||
|
||||
public JavaLineNumberInfo(InstanceKlass klass,
|
||||
Method method,
|
||||
int startBCI,
|
||||
int lineNumber) {
|
||||
this.klass = klass;
|
||||
this.method = method;
|
||||
this.startBCI = startBCI;
|
||||
this.lineNumber = lineNumber;
|
||||
}
|
||||
|
||||
public InstanceKlass getKlass() { return klass; }
|
||||
public Method getMethod() { return method; }
|
||||
public int getStartBCI() { return startBCI; }
|
||||
public int getLineNumber() { return lineNumber; }
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
|
||||
/** Helper class for locating a program counter. Indicates the
|
||||
confidence of the find. */
|
||||
|
||||
public class PCFinder {
|
||||
public static final int LOW_CONFIDENCE = 1;
|
||||
public static final int HIGH_CONFIDENCE = 2;
|
||||
|
||||
public static class Info {
|
||||
private String name;
|
||||
private long offset;
|
||||
private int confidence;
|
||||
|
||||
public Info(String name, long offset, int confidence) {
|
||||
this.name = name;
|
||||
this.offset = offset;
|
||||
this.confidence = confidence;
|
||||
}
|
||||
|
||||
/** May be null */
|
||||
public String getName() { return name; }
|
||||
|
||||
/** If this is -1, a symbol could not be found, and the offset
|
||||
should not be shown */
|
||||
public long getOffset() { return offset; }
|
||||
|
||||
/** PCFinder.LOW_CONFIDENCE or PCFinder.HIGH_CONFIDENCE */
|
||||
public int getConfidence() { return confidence; }
|
||||
}
|
||||
|
||||
/** Passed loadobject may be null in which case the returned Info
|
||||
object has low confidence */
|
||||
public static Info findPC(Address pc, LoadObject lo, CDebugger dbg) {
|
||||
if (lo == null) {
|
||||
return new Info(null, -1, LOW_CONFIDENCE);
|
||||
}
|
||||
|
||||
// First try debug info
|
||||
BlockSym sym = lo.debugInfoForPC(pc);
|
||||
while (sym != null) {
|
||||
if (sym.isFunction()) {
|
||||
// Highest confidence
|
||||
return new Info(sym.toString(), pc.minus(sym.getAddress()), HIGH_CONFIDENCE);
|
||||
}
|
||||
}
|
||||
|
||||
// Now try looking up symbol in loadobject
|
||||
|
||||
// FIXME: must add support for mapfiles on Win32 and try looking
|
||||
// up there first if possible. Should we hide that behind
|
||||
// LoadObject.closestSymbolToPC and have the ClosestSymbol return
|
||||
// confidence? I think so. On Solaris there is no notion of a
|
||||
// mapfile, and the confidence for closestSymbolToPC will be high
|
||||
// instead of low.
|
||||
|
||||
int confidence = HIGH_CONFIDENCE;
|
||||
|
||||
ClosestSymbol cs = lo.closestSymbolToPC(pc);
|
||||
if (cs != null) {
|
||||
// FIXME: currently low confidence (only on Win32)
|
||||
return new Info(cs.getName() + "()", cs.getOffset(), LOW_CONFIDENCE);
|
||||
}
|
||||
|
||||
// Unknown location
|
||||
return new Info(dbg.getNameOfFile(lo.getName()).toUpperCase() +
|
||||
"! " + pc + "()", -1, HIGH_CONFIDENCE);
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/** Scans a .java file for the package that it is in. */
|
||||
|
||||
public class PackageScanner {
|
||||
|
||||
public PackageScanner() {
|
||||
}
|
||||
|
||||
public String scan(String filename) {
|
||||
return scan(new File(filename));
|
||||
}
|
||||
|
||||
/** Returns the String comprising the package name of the classes in
|
||||
this .java file. Returns the (non-null) empty string if any
|
||||
error occurs or if the classes are in the unnamed package. */
|
||||
public String scan(File file) {
|
||||
BufferedReader buf = null;
|
||||
String res = "";
|
||||
try {
|
||||
buf = new BufferedReader(new FileReader(file));
|
||||
StreamTokenizer tok = new StreamTokenizer(buf);
|
||||
tok.slashStarComments(true);
|
||||
tok.slashSlashComments(true);
|
||||
if (tok.nextToken() != StreamTokenizer.TT_WORD) {
|
||||
return res;
|
||||
}
|
||||
if (!tok.sval.equals("package")) {
|
||||
return res;
|
||||
}
|
||||
if (tok.nextToken() != StreamTokenizer.TT_WORD) {
|
||||
return res;
|
||||
}
|
||||
res = tok.sval;
|
||||
return res;
|
||||
} catch (FileNotFoundException e) {
|
||||
return res;
|
||||
} catch (IOException e) {
|
||||
return res;
|
||||
} finally {
|
||||
try {
|
||||
if (buf != null) {
|
||||
buf.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
if (args.length != 1) {
|
||||
usage();
|
||||
}
|
||||
|
||||
System.out.println(new PackageScanner().scan(args[0]));
|
||||
}
|
||||
|
||||
private static void usage() {
|
||||
System.err.println("Usage: java PackageScanner <.java file name>");
|
||||
System.err.println("Prints package the .java file is in to stdout.");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.*;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
|
||||
/** Displays registers in a window. FIXME: this will need more work to
|
||||
understand and handle register windows. */
|
||||
|
||||
public class RegisterPanel extends JPanel {
|
||||
private java.util.List/*<RegisterInfo>*/ registers;
|
||||
private AbstractTableModel dataModel;
|
||||
private boolean valid;
|
||||
private boolean editable;
|
||||
private String nullAddressString;
|
||||
private ThreadProxy curThread;
|
||||
private JTable table;
|
||||
|
||||
static class RegisterInfo {
|
||||
private String name;
|
||||
private Address value;
|
||||
|
||||
RegisterInfo(String name, Address value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
String getName() { return name; }
|
||||
Address getValue() { return value; }
|
||||
}
|
||||
|
||||
public RegisterPanel() {
|
||||
super();
|
||||
|
||||
registers = new ArrayList();
|
||||
|
||||
dataModel = new AbstractTableModel() {
|
||||
public int getColumnCount() { return 2; }
|
||||
public int getRowCount() { return registers.size(); }
|
||||
public String getColumnName(int col) {
|
||||
switch (col) {
|
||||
case 0:
|
||||
return "Register Name";
|
||||
case 1:
|
||||
return "Register Value";
|
||||
default:
|
||||
throw new RuntimeException("Index " + col + " out of bounds");
|
||||
}
|
||||
}
|
||||
public Object getValueAt(int row, int col) {
|
||||
RegisterInfo info = (RegisterInfo) registers.get(row);
|
||||
|
||||
switch (col) {
|
||||
case 0:
|
||||
return info.getName();
|
||||
case 1:
|
||||
if (valid) {
|
||||
Address val = info.getValue();
|
||||
if (val != null) {
|
||||
return val;
|
||||
} else {
|
||||
return nullAddressString;
|
||||
}
|
||||
} else {
|
||||
return "-";
|
||||
}
|
||||
default:
|
||||
throw new RuntimeException("Index (" + col + ", " + row + ") out of bounds");
|
||||
}
|
||||
}
|
||||
public boolean isCellEditable(int row, int col) {
|
||||
if (col == 0) return false;
|
||||
if (!valid) return false;
|
||||
if (curThread == null) return false;
|
||||
if (!curThread.canSetContext()) return false;
|
||||
|
||||
// FIXME: add listener to watch for register changes
|
||||
// return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// Build user interface
|
||||
setLayout(new BorderLayout());
|
||||
table = new JTable(dataModel);
|
||||
table.setCellSelectionEnabled(true);
|
||||
table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
|
||||
table.setDragEnabled(true);
|
||||
JTableHeader header = table.getTableHeader();
|
||||
header.setReorderingAllowed(false);
|
||||
JScrollPane scrollPane = new JScrollPane(table);
|
||||
add(scrollPane, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
|
||||
/** Updates the register panel with the register set from the
|
||||
specified thread. Call this when the process has been suspended
|
||||
and the current thread has been set. FIXME: this interface will
|
||||
need to change to support register windows. */
|
||||
public void update(ThreadProxy curThread) {
|
||||
this.curThread = curThread;
|
||||
ThreadContext context = curThread.getContext();
|
||||
editable = curThread.canSetContext();
|
||||
registers.clear();
|
||||
for (int i = 0; i < context.getNumRegisters(); i++) {
|
||||
String name = context.getRegisterName(i);
|
||||
Address addr = context.getRegisterAsAddress(i);
|
||||
if ((nullAddressString == null) && (addr != null)) {
|
||||
String addrStr = addr.toString();
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append("0x");
|
||||
int len = addrStr.length() - 2;
|
||||
for (int j = 0; j < len; j++) {
|
||||
buf.append("0");
|
||||
}
|
||||
nullAddressString = buf.toString();
|
||||
}
|
||||
registers.add(new RegisterInfo(name, addr));
|
||||
}
|
||||
valid = true;
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
dataModel.fireTableDataChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Clears the registers' values. Call this when the processs has
|
||||
been resumed. */
|
||||
public void clear() {
|
||||
valid = false;
|
||||
nullAddressString = null;
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
dataModel.fireTableDataChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setFont(Font font) {
|
||||
super.setFont(font);
|
||||
if (table != null) {
|
||||
table.setFont(font);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
|
||||
/** This class describes a frame in a stack trace. It abstracts over
|
||||
C/C++ and Java frames. */
|
||||
|
||||
public class StackTraceEntry {
|
||||
private CFrame cFrame;
|
||||
private CDebugger dbg;
|
||||
private JavaVFrame javaFrame;
|
||||
private String value; // What is displayed in a stack trace
|
||||
// For merging C and Java stack traces.
|
||||
// For more precise stack traces, should probably have a way to
|
||||
// convert a CFrame to a sun.jvm.hotspot.runtime.Frame. For now,
|
||||
// doing similar algorithm to jdbx (which does not have intimate
|
||||
// knowledge of the VM).
|
||||
private boolean isUnknownCFrame;
|
||||
|
||||
public StackTraceEntry(CFrame cFrame, CDebugger dbg) {
|
||||
this.cFrame = cFrame;
|
||||
this.dbg = dbg;
|
||||
computeValue();
|
||||
}
|
||||
|
||||
public StackTraceEntry(JavaVFrame javaFrame) {
|
||||
this.javaFrame = javaFrame;
|
||||
computeValue();
|
||||
}
|
||||
|
||||
public boolean isCFrame() { return (cFrame != null); }
|
||||
public boolean isJavaFrame() { return (javaFrame != null); }
|
||||
public CFrame getCFrame() { return cFrame; }
|
||||
public JavaVFrame getJavaFrame() { return javaFrame; }
|
||||
public boolean isUnknownCFrame() { return isUnknownCFrame; }
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
private void computeValue() {
|
||||
isUnknownCFrame = true;
|
||||
value = "<unknown>";
|
||||
if (cFrame != null) {
|
||||
PCFinder.Info info = PCFinder.findPC(cFrame.pc(), cFrame.loadObjectForPC(), dbg);
|
||||
if (info.getName() != null) {
|
||||
value = "(C) " + info.getName();
|
||||
isUnknownCFrame = false;
|
||||
if (info.getConfidence() == PCFinder.LOW_CONFIDENCE) {
|
||||
value = value + " (?)";
|
||||
}
|
||||
if (info.getOffset() >= 0) {
|
||||
value = value + " + 0x" + Long.toHexString(info.getOffset());
|
||||
}
|
||||
}
|
||||
} else if (javaFrame != null) {
|
||||
isUnknownCFrame = false;
|
||||
Method m = javaFrame.getMethod();
|
||||
value = "(J) " + m.externalNameAndSignature();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.ui.*;
|
||||
|
||||
/** This panel contains a ListBox with all of the stack frames in a
|
||||
given thread. When a given entry is selected, an event is
|
||||
fired. */
|
||||
|
||||
public class StackTracePanel extends JPanel {
|
||||
public interface Listener {
|
||||
public void frameChanged(CFrame fr, JavaVFrame jfr);
|
||||
}
|
||||
|
||||
class Model extends AbstractListModel implements ComboBoxModel {
|
||||
private Object selectedItem;
|
||||
public Object getElementAt(int index) {
|
||||
if (trace == null) return null;
|
||||
return trace.get(index);
|
||||
}
|
||||
public int getSize() {
|
||||
if (trace == null) return 0;
|
||||
return trace.size();
|
||||
}
|
||||
public Object getSelectedItem() {
|
||||
return selectedItem;
|
||||
}
|
||||
public void setSelectedItem(Object item) {
|
||||
selectedItem = item;
|
||||
}
|
||||
public void dataChanged() {
|
||||
fireContentsChanged(this, 0, trace.size());
|
||||
}
|
||||
}
|
||||
|
||||
private java.util.List trace;
|
||||
private Model model;
|
||||
private JComboBox list;
|
||||
private java.util.List listeners;
|
||||
|
||||
public StackTracePanel() {
|
||||
super();
|
||||
|
||||
model = new Model();
|
||||
|
||||
// Build user interface
|
||||
setLayout(new BorderLayout());
|
||||
setBorder(GraphicsUtilities.newBorder(5));
|
||||
list = new JComboBox(model);
|
||||
list.setPrototypeDisplayValue("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ");
|
||||
add(list, BorderLayout.CENTER);
|
||||
|
||||
// Add selection listener
|
||||
list.addItemListener(new ItemListener() {
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
if (e.getStateChange() == ItemEvent.SELECTED) {
|
||||
fireFrameChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** Takes a List of StackTraceEntry objects */
|
||||
public void setTrace(java.util.List trace) {
|
||||
this.trace = trace;
|
||||
model.dataChanged();
|
||||
list.setSelectedIndex(0);
|
||||
fireFrameChanged();
|
||||
}
|
||||
|
||||
public void addListener(Listener listener) {
|
||||
if (listeners == null) {
|
||||
listeners = new ArrayList();
|
||||
}
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
protected void fireFrameChanged() {
|
||||
if (listeners != null) {
|
||||
StackTraceEntry entry = (StackTraceEntry) trace.get(list.getSelectedIndex());
|
||||
for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
|
||||
((Listener) iter.next()).frameChanged(entry.getCFrame(), entry.getJavaFrame());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,237 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.*;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.ui.*;
|
||||
|
||||
// NOTE: this class was not placed in sun.jvm.hotspot.ui to prevent
|
||||
// mixing components designed for C and C++ debugging with the ones
|
||||
// that work with the core serviceability agent functionality (which
|
||||
// does not require that the CDebugger interface be implemented).
|
||||
|
||||
/** The ThreadListPanel is used for C and C++ debugging and can
|
||||
visualize all threads in the target process. The caller passes in
|
||||
a CDebugger attached to the target process and can request that
|
||||
JavaThreads' associations with these underlying threads be
|
||||
displayed; this option is only valid when attached to a HotSpot
|
||||
JVM and when the {@link sun.jvm.hotspot.runtime.VM} has been
|
||||
initialized. */
|
||||
|
||||
public class ThreadListPanel extends JPanel {
|
||||
/** Listener which can be added to receive "Set Focus" events */
|
||||
public static interface Listener {
|
||||
/** ThreadProxy will always be provided; JavaThread will only be
|
||||
present if displayJavaThreads was specified in the constructor
|
||||
for the panel and the thread was a JavaThread. */
|
||||
public void setFocus(ThreadProxy thread, JavaThread jthread);
|
||||
}
|
||||
|
||||
static class ThreadInfo {
|
||||
private ThreadProxy thread;
|
||||
// Distinguish between PC == null and no top frame
|
||||
private boolean gotPC;
|
||||
private Address pc;
|
||||
private String location;
|
||||
private JavaThread javaThread;
|
||||
private String javaThreadName;
|
||||
|
||||
public ThreadInfo(ThreadProxy thread, CDebugger dbg, JavaThread jthread) {
|
||||
this.thread = thread;
|
||||
this.location = "<unknown>";
|
||||
CFrame fr = dbg.topFrameForThread(thread);
|
||||
if (fr != null) {
|
||||
gotPC = true;
|
||||
pc = fr.pc();
|
||||
PCFinder.Info info = PCFinder.findPC(pc, fr.loadObjectForPC(), dbg);
|
||||
if (info.getName() != null) {
|
||||
location = info.getName();
|
||||
if (info.getConfidence() == PCFinder.LOW_CONFIDENCE) {
|
||||
location = location + " (?)";
|
||||
}
|
||||
if (info.getOffset() < 0) {
|
||||
location = location + " + 0x" + Long.toHexString(info.getOffset());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (jthread != null) {
|
||||
javaThread = jthread;
|
||||
javaThreadName = jthread.getThreadName();
|
||||
}
|
||||
}
|
||||
|
||||
public ThreadProxy getThread() { return thread; }
|
||||
public boolean hasPC() { return gotPC; }
|
||||
public Address getPC() { return pc; }
|
||||
public String getLocation() { return location; }
|
||||
public boolean isJavaThread() { return (javaThread != null); }
|
||||
public JavaThread getJavaThread() { return javaThread; }
|
||||
public String getJavaThreadName() { return javaThreadName; }
|
||||
}
|
||||
|
||||
// List<ThreadInfo>
|
||||
private java.util.List threadList;
|
||||
private JTable table;
|
||||
private AbstractTableModel dataModel;
|
||||
// List<Listener>
|
||||
private java.util.List listeners;
|
||||
|
||||
/** Takes a CDebugger from which the thread list is queried.
|
||||
displayJavaThreads must only be set to true if the debugger is
|
||||
attached to a HotSpot JVM and if the VM has already been
|
||||
initialized. */
|
||||
public ThreadListPanel(CDebugger dbg, final boolean displayJavaThreads) {
|
||||
super();
|
||||
|
||||
Map threadToJavaThreadMap = null;
|
||||
if (displayJavaThreads) {
|
||||
// Collect Java threads from virtual machine and insert them in
|
||||
// table for later querying
|
||||
threadToJavaThreadMap = new HashMap();
|
||||
Threads threads = VM.getVM().getThreads();
|
||||
for (JavaThread thr = threads.first(); thr != null; thr = thr.next()) {
|
||||
threadToJavaThreadMap.put(thr.getThreadProxy(), thr);
|
||||
}
|
||||
}
|
||||
|
||||
java.util.List/*<ThreadProxy>*/ threads = dbg.getThreadList();
|
||||
threadList = new ArrayList(threads.size());
|
||||
for (Iterator iter = threads.iterator(); iter.hasNext(); ) {
|
||||
ThreadProxy thr = (ThreadProxy) iter.next();
|
||||
JavaThread jthr = null;
|
||||
if (displayJavaThreads) {
|
||||
jthr = (JavaThread) threadToJavaThreadMap.get(thr);
|
||||
}
|
||||
threadList.add(new ThreadInfo(thr, dbg, jthr));
|
||||
}
|
||||
|
||||
// Thread ID, current PC, current symbol, Java Thread, [Java thread name]
|
||||
dataModel = new AbstractTableModel() {
|
||||
public int getColumnCount() { return (displayJavaThreads ? 5 : 3); }
|
||||
public int getRowCount() { return threadList.size(); }
|
||||
public String getColumnName(int col) {
|
||||
switch (col) {
|
||||
case 0:
|
||||
return "Thread ID";
|
||||
case 1:
|
||||
return "PC";
|
||||
case 2:
|
||||
return "Location";
|
||||
case 3:
|
||||
return "Java?";
|
||||
case 4:
|
||||
return "Java Thread Name";
|
||||
default:
|
||||
throw new RuntimeException("Index " + col + " out of bounds");
|
||||
}
|
||||
}
|
||||
public Object getValueAt(int row, int col) {
|
||||
ThreadInfo info = (ThreadInfo) threadList.get(row);
|
||||
|
||||
switch (col) {
|
||||
case 0:
|
||||
return info.getThread();
|
||||
case 1:
|
||||
{
|
||||
if (info.hasPC()) {
|
||||
return info.getPC();
|
||||
}
|
||||
return "<no frames on stack>";
|
||||
}
|
||||
case 2:
|
||||
return info.getLocation();
|
||||
case 3:
|
||||
if (info.isJavaThread()) {
|
||||
return "Yes";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
case 4:
|
||||
if (info.isJavaThread()) {
|
||||
return info.getJavaThreadName();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
default:
|
||||
throw new RuntimeException("Index (" + col + ", " + row + ") out of bounds");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Build user interface
|
||||
setLayout(new BorderLayout());
|
||||
table = new JTable(dataModel);
|
||||
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
JTableHeader header = table.getTableHeader();
|
||||
header.setReorderingAllowed(false);
|
||||
table.setRowSelectionAllowed(true);
|
||||
table.setColumnSelectionAllowed(false);
|
||||
JScrollPane scrollPane = new JScrollPane(table);
|
||||
add(scrollPane, BorderLayout.CENTER);
|
||||
if (threadList.size() > 0) {
|
||||
table.setRowSelectionInterval(0, 0);
|
||||
}
|
||||
|
||||
JButton button = new JButton("Set Focus");
|
||||
button.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
int i = table.getSelectedRow();
|
||||
if (i < 0) {
|
||||
return;
|
||||
}
|
||||
ThreadInfo info = (ThreadInfo) threadList.get(i);
|
||||
for (Iterator iter = listeners.iterator(); iter.hasNext(); ) {
|
||||
((Listener) iter.next()).setFocus(info.getThread(), info.getJavaThread());
|
||||
}
|
||||
}
|
||||
});
|
||||
JPanel focusPanel = new JPanel();
|
||||
focusPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
|
||||
focusPanel.setLayout(new BoxLayout(focusPanel, BoxLayout.Y_AXIS));
|
||||
focusPanel.add(Box.createGlue());
|
||||
focusPanel.add(button);
|
||||
focusPanel.add(Box.createGlue());
|
||||
add(focusPanel, BorderLayout.EAST);
|
||||
|
||||
// FIXME: make listener model for the debugger so if the user
|
||||
// specifies a mapfile for or path to a given DSO later we can
|
||||
// update our state
|
||||
}
|
||||
|
||||
public void addListener(Listener l) {
|
||||
if (listeners == null) {
|
||||
listeners = new ArrayList();
|
||||
}
|
||||
listeners.add(l);
|
||||
}
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import java.util.*;
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.bugspot.tree.*;
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
import sun.jvm.hotspot.ui.tree.*;
|
||||
import sun.jvm.hotspot.ui.treetable.*;
|
||||
|
||||
/** Manages display of a set of local variables in a frame, or the
|
||||
contents of the "this" pointer */
|
||||
|
||||
public class VariablePanel extends JPanel {
|
||||
private JTreeTable treeTable;
|
||||
private SimpleTreeTableModel model;
|
||||
private SimpleTreeGroupNode root;
|
||||
|
||||
public VariablePanel() {
|
||||
super();
|
||||
|
||||
model = new SimpleTreeTableModel();
|
||||
model.setValuesEditable(false);
|
||||
root = new SimpleTreeGroupNode();
|
||||
model.setRoot(root);
|
||||
treeTable = new JTreeTable(model);
|
||||
treeTable.setRootVisible(false);
|
||||
treeTable.setShowsRootHandles(true);
|
||||
treeTable.setShowsIcons(false);
|
||||
treeTable.setTreeEditable(false);
|
||||
treeTable.getTableHeader().setReorderingAllowed(false);
|
||||
treeTable.setCellSelectionEnabled(true);
|
||||
treeTable.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
|
||||
treeTable.setDragEnabled(true);
|
||||
JScrollPane sp = new JScrollPane(treeTable);
|
||||
sp.getViewport().setBackground(Color.white);
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
add(sp, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
/** Clear the contents of this VariablePanel */
|
||||
public void clear() {
|
||||
root.removeAllChildren();
|
||||
model.fireTreeStructureChanged();
|
||||
}
|
||||
|
||||
/** Update the contents of this VariablePanel from the given CFrame */
|
||||
public void update(CFrame fr) {
|
||||
// Collect locals
|
||||
CCollector coll = new CCollector();
|
||||
fr.iterateLocals(coll);
|
||||
update(coll);
|
||||
}
|
||||
|
||||
/** Update the contents of this VariablePanel from the given JavaVFrame */
|
||||
public void update(JavaVFrame jfr) {
|
||||
Method m = jfr.getMethod();
|
||||
if (!m.hasLocalVariableTable()) {
|
||||
return;
|
||||
}
|
||||
int bci = jfr.getBCI();
|
||||
// Get local variable table
|
||||
LocalVariableTableElement[] locals = m.getLocalVariableTable();
|
||||
// Get locals as StackValueCollection
|
||||
StackValueCollection coll = jfr.getLocals();
|
||||
root.removeAllChildren();
|
||||
// See which locals are live
|
||||
for (int i = 0; i < locals.length; i++) {
|
||||
LocalVariableTableElement local = locals[i];
|
||||
if (local.getStartBCI() <= bci && bci < local.getStartBCI() + local.getLength()) {
|
||||
// Valid; add it
|
||||
SimpleTreeNode node = null;
|
||||
Symbol name = null;
|
||||
try {
|
||||
name = m.getConstants().getSymbolAt(local.getNameCPIndex());
|
||||
if (name == null) {
|
||||
System.err.println("Null name at slot " +
|
||||
local.getNameCPIndex() +
|
||||
" for local variable at slot " +
|
||||
local.getSlot());
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("Unable to fetch name at slot " +
|
||||
local.getNameCPIndex() +
|
||||
" for local variable at slot " +
|
||||
local.getSlot());
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
sun.jvm.hotspot.oops.NamedFieldIdentifier f =
|
||||
new sun.jvm.hotspot.oops.NamedFieldIdentifier(name.asString());
|
||||
Symbol descriptor = null;
|
||||
try {
|
||||
descriptor = m.getConstants().getSymbolAt(local.getDescriptorCPIndex());
|
||||
} catch (Exception e) {
|
||||
System.err.println("Unable to fetch descriptor at slot " +
|
||||
local.getDescriptorCPIndex() +
|
||||
" for local variable " + f.getName() +
|
||||
" at slot " + local.getSlot());
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (descriptor != null) {
|
||||
switch (descriptor.getByteAt(0)) {
|
||||
case 'F': {
|
||||
node = new sun.jvm.hotspot.ui.tree.FloatTreeNodeAdapter(coll.floatAt(local.getSlot()), f, true);
|
||||
break;
|
||||
}
|
||||
case 'D': {
|
||||
node = new sun.jvm.hotspot.ui.tree.DoubleTreeNodeAdapter(coll.doubleAt(local.getSlot()), f, true);
|
||||
break;
|
||||
}
|
||||
case 'C': {
|
||||
node = new sun.jvm.hotspot.ui.tree.CharTreeNodeAdapter((char) coll.intAt(local.getSlot()), f, true);
|
||||
break;
|
||||
}
|
||||
case 'B':
|
||||
case 'S':
|
||||
case 'I': {
|
||||
node = new sun.jvm.hotspot.ui.tree.LongTreeNodeAdapter(coll.intAt(local.getSlot()), f, true);
|
||||
break;
|
||||
}
|
||||
case 'Z': {
|
||||
node = new sun.jvm.hotspot.ui.tree.BooleanTreeNodeAdapter(
|
||||
((coll.intAt(local.getSlot()) != 0) ? true : false), f, true
|
||||
);
|
||||
break;
|
||||
}
|
||||
case 'J': {
|
||||
node = new sun.jvm.hotspot.ui.tree.LongTreeNodeAdapter(coll.longAt(local.getSlot()), f, true);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
try {
|
||||
node = new sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter(
|
||||
VM.getVM().getObjectHeap().newOop(coll.oopHandleAt(local.getSlot())), f, true
|
||||
);
|
||||
} catch (AddressException e) {
|
||||
node = new sun.jvm.hotspot.ui.tree.FieldTreeNodeAdapter(f, true) {
|
||||
public int getChildCount() { return 0; }
|
||||
public SimpleTreeNode getChild(int i) { return null; }
|
||||
public boolean isLeaf() { return false; }
|
||||
public int getIndexOfChild(SimpleTreeNode child) { return 0; }
|
||||
public String getValue() {
|
||||
return "<Bad oop>";
|
||||
}
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (node != null) {
|
||||
root.addChild(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model.fireTreeStructureChanged();
|
||||
}
|
||||
|
||||
/** Update the contents of this VariablePanel from the given "this"
|
||||
pointer of the given type */
|
||||
public void update(Address thisAddr, Type type) {
|
||||
// Collect fields
|
||||
CCollector coll = new CCollector();
|
||||
type.iterateObject(thisAddr, coll);
|
||||
update(coll);
|
||||
}
|
||||
|
||||
private void update(CCollector coll) {
|
||||
root.removeAllChildren();
|
||||
for (int i = 0; i < coll.getNumChildren(); i++) {
|
||||
root.addChild(coll.getChild(i));
|
||||
}
|
||||
model.fireTreeStructureChanged();
|
||||
}
|
||||
|
||||
static class CCollector extends DefaultObjectVisitor {
|
||||
private java.util.List children;
|
||||
|
||||
public CCollector() {
|
||||
children = new ArrayList();
|
||||
}
|
||||
|
||||
public int getNumChildren() {
|
||||
return children.size();
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int i) {
|
||||
return (SimpleTreeNode) children.get(i);
|
||||
}
|
||||
|
||||
public void doBit(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, long val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.LongTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doInt(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, long val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.LongTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doEnum(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, long val, String enumName) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.EnumTreeNodeAdapter(enumName, val, f, true));
|
||||
}
|
||||
public void doFloat(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, float val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.FloatTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doDouble(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, double val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.DoubleTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doPointer(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, Address val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.AddressTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doArray(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, Address val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.AddressTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doRef(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, Address val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.AddressTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
public void doCompound(sun.jvm.hotspot.debugger.cdbg.FieldIdentifier f, Address val) {
|
||||
children.add(new sun.jvm.hotspot.bugspot.tree.ObjectTreeNodeAdapter(val, f, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** Encapsulates a float value in a tree handled by SimpleTreeModel */
|
||||
|
||||
public class AddressTreeNodeAdapter extends FieldTreeNodeAdapter {
|
||||
private Address val;
|
||||
|
||||
public AddressTreeNodeAdapter(Address val, FieldIdentifier id) {
|
||||
this(val, id, false);
|
||||
}
|
||||
|
||||
public AddressTreeNodeAdapter(Address val, FieldIdentifier id, boolean treeTableMode) {
|
||||
super(id, treeTableMode);
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public int getChildCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isLeaf() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getIndexOfChild(SimpleTreeNode child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
if (val != null) {
|
||||
return val.toString();
|
||||
}
|
||||
return "NULL";
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** Encapsulates a double value in a tree handled by SimpleTreeModel */
|
||||
|
||||
public class DoubleTreeNodeAdapter extends FieldTreeNodeAdapter {
|
||||
private double val;
|
||||
|
||||
public DoubleTreeNodeAdapter(double val, FieldIdentifier id) {
|
||||
this(val, id, false);
|
||||
}
|
||||
|
||||
public DoubleTreeNodeAdapter(double val, FieldIdentifier id, boolean treeTableMode) {
|
||||
super(id, treeTableMode);
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public int getChildCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isLeaf() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getIndexOfChild(SimpleTreeNode child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return Double.toString(val);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** Encapsulates an enumerated value in a tree handled by SimpleTreeModel */
|
||||
|
||||
public class EnumTreeNodeAdapter extends FieldTreeNodeAdapter {
|
||||
private long val;
|
||||
private String enumName;
|
||||
|
||||
public EnumTreeNodeAdapter(String enumName, long val, FieldIdentifier id) {
|
||||
this(enumName, val, id, false);
|
||||
}
|
||||
|
||||
public EnumTreeNodeAdapter(String enumName, long val, FieldIdentifier id, boolean treeTableMode) {
|
||||
super(id, treeTableMode);
|
||||
this.enumName = enumName;
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public int getChildCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isLeaf() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getIndexOfChild(SimpleTreeNode child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
if (enumName != null) {
|
||||
return enumName;
|
||||
} else {
|
||||
return Long.toString(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** Abstract base class for all adapters for fields of C/C++ objects */
|
||||
|
||||
public abstract class FieldTreeNodeAdapter implements SimpleTreeNode {
|
||||
private FieldIdentifier id;
|
||||
private boolean treeTableMode;
|
||||
|
||||
/** The identifier may be null, i.e., for the root of the tree */
|
||||
public FieldTreeNodeAdapter(FieldIdentifier id, boolean treeTableMode) {
|
||||
this.id = id;
|
||||
this.treeTableMode = treeTableMode;
|
||||
}
|
||||
|
||||
public FieldIdentifier getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/** Defaults to false in subclasses */
|
||||
public boolean getTreeTableMode() {
|
||||
return treeTableMode;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return getID().getType();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
if (getID() != null) {
|
||||
return getID().toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
if (treeTableMode) {
|
||||
return getName();
|
||||
} else {
|
||||
if (getID() != null) {
|
||||
return getName() + ": " + getValue();
|
||||
} else {
|
||||
return getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** Encapsulates a float value in a tree handled by SimpleTreeModel */
|
||||
|
||||
public class FloatTreeNodeAdapter extends FieldTreeNodeAdapter {
|
||||
private float val;
|
||||
|
||||
public FloatTreeNodeAdapter(float val, FieldIdentifier id) {
|
||||
this(val, id, false);
|
||||
}
|
||||
|
||||
public FloatTreeNodeAdapter(float val, FieldIdentifier id, boolean treeTableMode) {
|
||||
super(id, treeTableMode);
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public int getChildCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isLeaf() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getIndexOfChild(SimpleTreeNode child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return Float.toString(val);
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** Encapsulates a long value in a tree handled by SimpleTreeModel */
|
||||
|
||||
public class LongTreeNodeAdapter extends FieldTreeNodeAdapter {
|
||||
private long val;
|
||||
|
||||
public LongTreeNodeAdapter(long val, FieldIdentifier id) {
|
||||
this(val, id, false);
|
||||
}
|
||||
|
||||
public LongTreeNodeAdapter(long val, FieldIdentifier id, boolean treeTableMode) {
|
||||
super(id, treeTableMode);
|
||||
this.val = val;
|
||||
}
|
||||
|
||||
public int getChildCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isLeaf() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getIndexOfChild(SimpleTreeNode child) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return Long.toString(val);
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.bugspot.tree;
|
||||
|
||||
import java.io.*;
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.debugger.cdbg.*;
|
||||
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
|
||||
|
||||
/** An adapter class which allows C/C++ objects to be displayed in a
|
||||
tree via the SimpleTreeNode interface. */
|
||||
|
||||
public class ObjectTreeNodeAdapter extends FieldTreeNodeAdapter {
|
||||
// Address of object
|
||||
private Address addr;
|
||||
|
||||
/** The address may be null (for object fields of objcets which are
|
||||
null). The FieldIdentifier should not be null. treeTableMode
|
||||
defaults to false. */
|
||||
public ObjectTreeNodeAdapter(Address addr, FieldIdentifier id) {
|
||||
this(addr, id, false);
|
||||
}
|
||||
|
||||
/** The address may be null (for object fields of objcets which are
|
||||
null). The FieldIdentifier should not be null. */
|
||||
public ObjectTreeNodeAdapter(Address addr, FieldIdentifier id, boolean treeTableMode) {
|
||||
super(id, treeTableMode);
|
||||
this.addr = addr;
|
||||
}
|
||||
|
||||
public int getChildCount() {
|
||||
if (addr == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Counter c = new Counter();
|
||||
getType().iterateObject(addr, c);
|
||||
return c.getNumFields();
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild(int index) {
|
||||
if (addr == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Fetcher f = new Fetcher(index);
|
||||
getType().iterateObject(addr, f);
|
||||
return f.getChild();
|
||||
}
|
||||
|
||||
public boolean isLeaf() {
|
||||
return (addr == null);
|
||||
}
|
||||
|
||||
public int getIndexOfChild(SimpleTreeNode child) {
|
||||
FieldIdentifier id = ((FieldTreeNodeAdapter) child).getID();
|
||||
Finder f = new Finder(id);
|
||||
getType().iterateObject(addr, f);
|
||||
return f.getIndex();
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
if (addr != null) {
|
||||
return addr.toString();
|
||||
}
|
||||
return "NULL";
|
||||
}
|
||||
|
||||
/** Should be used only once, then have the number of fields
|
||||
fetched. */
|
||||
static class Counter extends DefaultObjectVisitor {
|
||||
private int numFields;
|
||||
|
||||
public int getNumFields() {
|
||||
return numFields;
|
||||
}
|
||||
|
||||
public void doBit(FieldIdentifier f, long val) { ++numFields; }
|
||||
public void doInt(FieldIdentifier f, long val) { ++numFields; }
|
||||
public void doEnum(FieldIdentifier f, long val, String enumName) { ++numFields; }
|
||||
public void doFloat(FieldIdentifier f, float val) { ++numFields; }
|
||||
public void doDouble(FieldIdentifier f, double val) { ++numFields; }
|
||||
public void doPointer(FieldIdentifier f, Address val) { ++numFields; }
|
||||
public void doArray(FieldIdentifier f, Address val) { ++numFields; }
|
||||
public void doRef(FieldIdentifier f, Address val) { ++numFields; }
|
||||
public void doCompound(FieldIdentifier f, Address addr) { ++numFields; }
|
||||
}
|
||||
|
||||
/** Creates a new SimpleTreeNode for the given field. */
|
||||
class Fetcher extends DefaultObjectVisitor {
|
||||
private int index;
|
||||
private int curField;
|
||||
private SimpleTreeNode child;
|
||||
|
||||
public Fetcher(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public SimpleTreeNode getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public void doBit(FieldIdentifier f, long val) {
|
||||
if (curField == index) {
|
||||
child = new LongTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doInt(FieldIdentifier f, long val) {
|
||||
if (curField == index) {
|
||||
child = new LongTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doEnum(FieldIdentifier f, long val, String enumName) {
|
||||
if (curField == index) {
|
||||
child = new EnumTreeNodeAdapter(enumName, val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doFloat(FieldIdentifier f, float val) {
|
||||
if (curField == index) {
|
||||
child = new FloatTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doDouble(FieldIdentifier f, double val) {
|
||||
if (curField == index) {
|
||||
child = new DoubleTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doPointer(FieldIdentifier f, Address val) {
|
||||
if (curField == index) {
|
||||
child = new AddressTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doArray(FieldIdentifier f, Address val) {
|
||||
if (curField == index) {
|
||||
child = new AddressTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doRef(FieldIdentifier f, Address val) {
|
||||
if (curField == index) {
|
||||
child = new AddressTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
|
||||
public void doCompound(FieldIdentifier f, Address val) {
|
||||
if (curField == index) {
|
||||
child = new ObjectTreeNodeAdapter(val, f, getTreeTableMode());
|
||||
}
|
||||
++curField;
|
||||
}
|
||||
}
|
||||
|
||||
/** Finds the index of the given FieldIdentifier. */
|
||||
static class Finder extends DefaultObjectVisitor {
|
||||
private FieldIdentifier id;
|
||||
private int curField;
|
||||
private int index = -1;
|
||||
|
||||
public Finder(FieldIdentifier id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/** Returns -1 if not found */
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void doBit(FieldIdentifier f, long val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doInt(FieldIdentifier f, long val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doEnum(FieldIdentifier f, long val,
|
||||
String enumName) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doFloat(FieldIdentifier f, float val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doDouble(FieldIdentifier f, double val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doPointer(FieldIdentifier f, Address val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doArray(FieldIdentifier f, Address val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doRef(FieldIdentifier f, Address val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
public void doCompound(FieldIdentifier f,
|
||||
Address val) { if (f.equals(id)) { index = curField; } ++curField; }
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public interface BsdDebugger extends JVMDebugger {
|
||||
public BsdAddress readCompKlassAddress(long address) throws DebuggerException;
|
||||
public BsdOopHandle readOopHandle(long address) throws DebuggerException;
|
||||
public BsdOopHandle readCompOopHandle(long address) throws DebuggerException;
|
||||
public long[] getThreadIntegerRegisterSet(int lwp_id) throws DebuggerException;
|
||||
public long[] getThreadIntegerRegisterSet(long unique_thread_id) throws DebuggerException;
|
||||
public long getAddressValue(Address addr) throws DebuggerException;
|
||||
public Address newAddress(long value) throws DebuggerException;
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
throws DebuggerException;
|
||||
private native ClosestSymbol lookupByAddress0(long address)
|
||||
throws DebuggerException;
|
||||
private native long[] getThreadIntegerRegisterSet0(int lwp_id)
|
||||
private native long[] getThreadIntegerRegisterSet0(long unique_thread_id)
|
||||
throws DebuggerException;
|
||||
private native byte[] readBytesFromProcess0(long address, long numBytes)
|
||||
throws DebuggerException;
|
||||
@@ -400,9 +400,14 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
//
|
||||
|
||||
/** From the ThreadAccess interface via Debugger and JVMDebugger */
|
||||
public ThreadProxy getThreadForIdentifierAddress(Address addr) {
|
||||
return new BsdThread(this, addr);
|
||||
public ThreadProxy getThreadForIdentifierAddress(Address threadIdAddr, Address uniqueThreadIdAddr) {
|
||||
return new BsdThread(this, threadIdAddr, uniqueThreadIdAddr);
|
||||
}
|
||||
@Override
|
||||
public ThreadProxy getThreadForIdentifierAddress(Address addr) {
|
||||
throw new RuntimeException("unimplemented");
|
||||
}
|
||||
|
||||
|
||||
/** From the ThreadAccess interface via Debugger and JVMDebugger */
|
||||
public ThreadProxy getThreadForThreadId(long id) {
|
||||
@@ -455,22 +460,22 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
|
||||
// Thread context access
|
||||
//
|
||||
|
||||
public synchronized long[] getThreadIntegerRegisterSet(int lwp_id)
|
||||
public synchronized long[] getThreadIntegerRegisterSet(long unique_thread_id)
|
||||
throws DebuggerException {
|
||||
requireAttach();
|
||||
if (isCore) {
|
||||
return getThreadIntegerRegisterSet0(lwp_id);
|
||||
return getThreadIntegerRegisterSet0(unique_thread_id);
|
||||
} else {
|
||||
class GetThreadIntegerRegisterSetTask implements WorkerThreadTask {
|
||||
int lwp_id;
|
||||
long unique_thread_id;
|
||||
long[] result;
|
||||
public void doit(BsdDebuggerLocal debugger) {
|
||||
result = debugger.getThreadIntegerRegisterSet0(lwp_id);
|
||||
result = debugger.getThreadIntegerRegisterSet0(unique_thread_id);
|
||||
}
|
||||
}
|
||||
|
||||
GetThreadIntegerRegisterSetTask task = new GetThreadIntegerRegisterSetTask();
|
||||
task.lwp_id = lwp_id;
|
||||
task.unique_thread_id = unique_thread_id;
|
||||
workerThread.execute(task);
|
||||
return task.result;
|
||||
}
|
||||
|
||||
@@ -28,21 +28,23 @@ import sun.jvm.hotspot.debugger.*;
|
||||
|
||||
class BsdThread implements ThreadProxy {
|
||||
private BsdDebugger debugger;
|
||||
private int lwp_id;
|
||||
private int thread_id;
|
||||
private long unique_thread_id;
|
||||
|
||||
/** The address argument must be the address of the _thread_id in the
|
||||
OSThread. It's value is result ::gettid() call. */
|
||||
BsdThread(BsdDebugger debugger, Address addr) {
|
||||
BsdThread(BsdDebugger debugger, Address threadIdAddr, Address uniqueThreadIdAddr) {
|
||||
this.debugger = debugger;
|
||||
// FIXME: size of data fetched here should be configurable.
|
||||
// However, making it so would produce a dependency on the "types"
|
||||
// package from the debugger package, which is not desired.
|
||||
this.lwp_id = (int) addr.getCIntegerAt(0, 4, true);
|
||||
this.thread_id = (int) threadIdAddr.getCIntegerAt(0, 4, true);
|
||||
this.unique_thread_id = uniqueThreadIdAddr.getCIntegerAt(0, 8, true);
|
||||
}
|
||||
|
||||
BsdThread(BsdDebugger debugger, long id) {
|
||||
this.debugger = debugger;
|
||||
this.lwp_id = (int) id;
|
||||
this.thread_id = (int) id;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
@@ -50,19 +52,19 @@ class BsdThread implements ThreadProxy {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (((BsdThread) obj).lwp_id == lwp_id);
|
||||
return (((BsdThread) obj).thread_id == thread_id);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return lwp_id;
|
||||
return thread_id;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return Integer.toString(lwp_id);
|
||||
return Integer.toString(thread_id);
|
||||
}
|
||||
|
||||
public ThreadContext getContext() throws IllegalThreadStateException {
|
||||
long[] data = debugger.getThreadIntegerRegisterSet(lwp_id);
|
||||
long[] data = debugger.getThreadIntegerRegisterSet(unique_thread_id);
|
||||
ThreadContext context = BsdThreadContextFactory.createThreadContext(debugger);
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
context.setRegister(i, data[i]);
|
||||
|
||||
@@ -60,8 +60,13 @@ final public class LinuxAMD64CFrame extends BasicCFrame {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check alignment of rbp
|
||||
if ( dbg.getAddressValue(rbp) % ADDRESS_SIZE != 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Address nextRBP = rbp.getAddressAt( 0 * ADDRESS_SIZE);
|
||||
if (nextRBP == null) {
|
||||
if (nextRBP == null || nextRBP.lessThanOrEqual(rbp)) {
|
||||
return null;
|
||||
}
|
||||
Address nextPC = rbp.getAddressAt( 1 * ADDRESS_SIZE);
|
||||
|
||||
@@ -61,8 +61,13 @@ final public class LinuxX86CFrame extends BasicCFrame {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check alignment of ebp
|
||||
if ( dbg.getAddressValue(ebp) % ADDRESS_SIZE != 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE);
|
||||
if (nextEBP == null) {
|
||||
if (nextEBP == null || nextEBP.lessThanOrEqual(ebp)) {
|
||||
return null;
|
||||
}
|
||||
Address nextPC = ebp.getAddressAt( 1 * ADDRESS_SIZE);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -34,21 +34,11 @@ class WindbgAMD64Thread implements ThreadProxy {
|
||||
private boolean gotID;
|
||||
private long id;
|
||||
|
||||
/** The address argument must be the address of the HANDLE of the
|
||||
desired thread in the target process. */
|
||||
// The address argument must be the address of the OSThread::_thread_id
|
||||
WindbgAMD64Thread(WindbgDebugger debugger, Address addr) {
|
||||
this.debugger = debugger;
|
||||
// FIXME: size of data fetched here should be configurable.
|
||||
// However, making it so would produce a dependency on the "types"
|
||||
// package from the debugger package, which is not desired.
|
||||
|
||||
// another hack here is that we use sys thread id instead of handle.
|
||||
// windbg can't get details based on handles it seems.
|
||||
// I assume that osThread_win32 thread struct has _thread_id (which
|
||||
// sys thread id) just after handle field.
|
||||
|
||||
this.sysId = (int) addr.addOffsetTo(debugger.getAddressSize()).getCIntegerAt(0, 4, true);
|
||||
gotID = false;
|
||||
this.sysId = (long)addr.getCIntegerAt(0, 4, true);
|
||||
gotID = false;
|
||||
}
|
||||
|
||||
WindbgAMD64Thread(WindbgDebugger debugger, long sysId) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -34,21 +34,11 @@ class WindbgX86Thread implements ThreadProxy {
|
||||
private boolean gotID;
|
||||
private long id;
|
||||
|
||||
/** The address argument must be the address of the HANDLE of the
|
||||
desired thread in the target process. */
|
||||
// The address argument must be the address of OSThread::_thread_id
|
||||
WindbgX86Thread(WindbgDebugger debugger, Address addr) {
|
||||
this.debugger = debugger;
|
||||
// FIXME: size of data fetched here should be configurable.
|
||||
// However, making it so would produce a dependency on the "types"
|
||||
// package from the debugger package, which is not desired.
|
||||
|
||||
// another hack here is that we use sys thread id instead of handle.
|
||||
// windbg can't get details based on handles it seems.
|
||||
// I assume that osThread_win32 thread struct has _thread_id (which
|
||||
// sys thread id) just after handle field.
|
||||
|
||||
this.sysId = (int) addr.addOffsetTo(debugger.getAddressSize()).getCIntegerAt(0, 4, true);
|
||||
gotID = false;
|
||||
this.sysId = (long)addr.getCIntegerAt(0, 4, true);
|
||||
gotID = false;
|
||||
}
|
||||
|
||||
WindbgX86Thread(WindbgDebugger debugger, long sysId) {
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.livejvm;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
|
||||
class CStringAccessor {
|
||||
private Address addr;
|
||||
private int bufLen;
|
||||
|
||||
CStringAccessor(Address addr, int bufLen) {
|
||||
this.addr = addr;
|
||||
this.bufLen = bufLen;
|
||||
}
|
||||
|
||||
String getValue() throws DebuggerException {
|
||||
int len = 0;
|
||||
while ((addr.getCIntegerAt(len, 1, true) != 0) && (len < bufLen)) {
|
||||
++len;
|
||||
}
|
||||
byte[] res = new byte[len];
|
||||
for (int i = 0; i < len; i++) {
|
||||
res[i] = (byte) addr.getCIntegerAt(i, 1, true);
|
||||
}
|
||||
try {
|
||||
return new String(res, "US-ASCII");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new DebuggerException("Unable to use US-ASCII encoding");
|
||||
}
|
||||
}
|
||||
|
||||
void setValue(String value) throws DebuggerException {
|
||||
try {
|
||||
byte[] data = value.getBytes("US-ASCII");
|
||||
if (data.length >= bufLen) {
|
||||
throw new DebuggerException("String too long");
|
||||
}
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
addr.setCIntegerAt(i, 1, data[i]);
|
||||
}
|
||||
addr.setCIntegerAt(data.length, 1, 0);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new DebuggerException("Unable to use US-ASCII encoding");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.livejvm;
|
||||
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
|
||||
public class ExceptionEvent extends Event {
|
||||
private Oop thread;
|
||||
private Oop clazz;
|
||||
private JNIid method;
|
||||
private int location;
|
||||
private Oop exception;
|
||||
private Oop catchClass;
|
||||
private JNIid catchMethod;
|
||||
private int catchLocation;
|
||||
|
||||
public ExceptionEvent(Oop thread,
|
||||
Oop clazz,
|
||||
JNIid method,
|
||||
int location,
|
||||
Oop exception,
|
||||
Oop catchClass,
|
||||
JNIid catchMethod,
|
||||
int catchLocation) {
|
||||
super(Event.Type.EXCEPTION);
|
||||
this.thread = thread;
|
||||
this.clazz = clazz;
|
||||
this.method = method;
|
||||
this.location = location;
|
||||
this.exception = exception;
|
||||
this.catchClass = catchClass;
|
||||
this.catchMethod = catchMethod;
|
||||
this.catchLocation = catchLocation;
|
||||
}
|
||||
|
||||
public Oop thread() { return thread; }
|
||||
public Oop clazz() { return clazz; }
|
||||
public JNIid methodID() { return method; }
|
||||
public int location() { return location; }
|
||||
public Oop exception() { return exception; }
|
||||
public Oop catchClass() { return catchClass; }
|
||||
public JNIid catchMethodID() { return catchMethod; }
|
||||
public int catchLocation() { return catchLocation; }
|
||||
}
|
||||
@@ -1,415 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code 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
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
package sun.jvm.hotspot.livejvm;
|
||||
|
||||
import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.oops.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
|
||||
/** Provides Java programming language-level interaction with a live
|
||||
Java HotSpot VM via the use of the SA's JVMDI module. This is an
|
||||
experimental mechanism. The BugSpot debugger should be converted
|
||||
to use the JVMDI/JDWP-based JDI implementation for live process
|
||||
interaction once the JDI binding for the SA is complete. */
|
||||
|
||||
public class ServiceabilityAgentJVMDIModule {
|
||||
private Debugger dbg;
|
||||
private String[] saLibNames;
|
||||
private String saLibName;
|
||||
private boolean attached;
|
||||
|
||||
private boolean suspended;
|
||||
|
||||
private static final int JVMDI_EVENT_BREAKPOINT = 2;
|
||||
private static final int JVMDI_EVENT_EXCEPTION = 4;
|
||||
|
||||
private static long timeoutMillis = 3000;
|
||||
|
||||
// Values in target process
|
||||
// Events sent from VM to SA
|
||||
private CIntegerAccessor saAttached;
|
||||
private CIntegerAccessor saEventPending;
|
||||
private CIntegerAccessor saEventKind;
|
||||
// Exception events
|
||||
private JNIHandleAccessor saExceptionThread;
|
||||
private JNIHandleAccessor saExceptionClass;
|
||||
private JNIid saExceptionMethod;
|
||||
private CIntegerAccessor saExceptionLocation;
|
||||
private JNIHandleAccessor saExceptionException;
|
||||
private JNIHandleAccessor saExceptionCatchClass;
|
||||
private JNIid saExceptionCatchMethod;
|
||||
private CIntegerAccessor saExceptionCatchLocation;
|
||||
// Breakpoint events
|
||||
private JNIHandleAccessor saBreakpointThread;
|
||||
private JNIHandleAccessor saBreakpointClass;
|
||||
private JNIid saBreakpointMethod;
|
||||
private CIntegerAccessor saBreakpointLocation;
|
||||
// Commands sent by the SA to the VM
|
||||
private int SA_CMD_SUSPEND_ALL;
|
||||
private int SA_CMD_RESUME_ALL;
|
||||
private int SA_CMD_TOGGLE_BREAKPOINT;
|
||||
private int SA_CMD_BUF_SIZE;
|
||||
private CIntegerAccessor saCmdPending;
|
||||
private CIntegerAccessor saCmdType;
|
||||
private CIntegerAccessor saCmdResult;
|
||||
private CStringAccessor saCmdResultErrMsg;
|
||||
// Toggle breakpoint command arguments
|
||||
private CStringAccessor saCmdBkptSrcFileName;
|
||||
private CStringAccessor saCmdBkptPkgName;
|
||||
private CIntegerAccessor saCmdBkptLineNumber;
|
||||
private CIntegerAccessor saCmdBkptResWasError;
|
||||
private CIntegerAccessor saCmdBkptResLineNumber;
|
||||
private CIntegerAccessor saCmdBkptResBCI;
|
||||
private CIntegerAccessor saCmdBkptResWasSet;
|
||||
private CStringAccessor saCmdBkptResMethodName;
|
||||
private CStringAccessor saCmdBkptResMethodSig;
|
||||
|
||||
public ServiceabilityAgentJVMDIModule(Debugger dbg, String[] saLibNames) {
|
||||
this.dbg = dbg;
|
||||
this.saLibNames = saLibNames;
|
||||
}
|
||||
|
||||
/** Indicates whether a call to attach() should complete without an
|
||||
exception. */
|
||||
public boolean canAttach() {
|
||||
return setupLookup("SA_CMD_SUSPEND_ALL");
|
||||
}
|
||||
|
||||
/** Attempt to initiate a connection with the JVMDI module in the
|
||||
target VM. */
|
||||
public void attach() throws DebuggerException {
|
||||
if (!canAttach()) {
|
||||
throw new DebuggerException("Unable to initiate symbol lookup in SA's JVMDI module");
|
||||
}
|
||||
|
||||
if (attached) {
|
||||
throw new DebuggerException("Already attached");
|
||||
}
|
||||
|
||||
// Attempt to look up well-known symbols in the target VM.
|
||||
SA_CMD_SUSPEND_ALL = lookupConstInt("SA_CMD_SUSPEND_ALL");
|
||||
SA_CMD_RESUME_ALL = lookupConstInt("SA_CMD_RESUME_ALL");
|
||||
SA_CMD_TOGGLE_BREAKPOINT = lookupConstInt("SA_CMD_TOGGLE_BREAKPOINT");
|
||||
SA_CMD_BUF_SIZE = lookupConstInt("SA_CMD_BUF_SIZE");
|
||||
|
||||
saAttached = lookupCInt("saAttached");
|
||||
saEventPending = lookupCInt("saEventPending");
|
||||
saEventKind = lookupCInt("saEventKind");
|
||||
saCmdPending = lookupCInt("saCmdPending");
|
||||
saCmdType = lookupCInt("saCmdType");
|
||||
saCmdResult = lookupCInt("saCmdResult");
|
||||
saCmdResultErrMsg = lookupCString("saCmdResultErrMsg", SA_CMD_BUF_SIZE);
|
||||
// Toggling of breakpoints
|
||||
saCmdBkptSrcFileName = lookupCString("saCmdBkptSrcFileName", SA_CMD_BUF_SIZE);
|
||||
saCmdBkptPkgName = lookupCString("saCmdBkptPkgName", SA_CMD_BUF_SIZE);
|
||||
saCmdBkptLineNumber = lookupCInt("saCmdBkptLineNumber");
|
||||
saCmdBkptResWasError = lookupCInt("saCmdBkptResWasError");
|
||||
saCmdBkptResLineNumber = lookupCInt("saCmdBkptResLineNumber");
|
||||
saCmdBkptResBCI = lookupCInt("saCmdBkptResBCI");
|
||||
saCmdBkptResWasSet = lookupCInt("saCmdBkptResWasSet");
|
||||
saCmdBkptResMethodName = lookupCString("saCmdBkptResMethodName", SA_CMD_BUF_SIZE);
|
||||
saCmdBkptResMethodSig = lookupCString("saCmdBkptResMethodSig", SA_CMD_BUF_SIZE);
|
||||
|
||||
// Check for existence of symbols needed later
|
||||
// FIXME: should probably cache these since we can't support the
|
||||
// -Xrun module or the VM getting unloaded anyway
|
||||
lookup("saExceptionThread");
|
||||
lookup("saExceptionClass");
|
||||
lookup("saExceptionMethod");
|
||||
lookup("saExceptionLocation");
|
||||
lookup("saExceptionException");
|
||||
lookup("saExceptionCatchClass");
|
||||
lookup("saExceptionCatchMethod");
|
||||
lookup("saExceptionCatchLocation");
|
||||
lookup("saBreakpointThread");
|
||||
lookup("saBreakpointClass");
|
||||
lookup("saBreakpointMethod");
|
||||
lookup("saBreakpointLocation");
|
||||
|
||||
saAttached.setValue(1);
|
||||
attached = true;
|
||||
}
|
||||
|
||||
public void detach() {
|
||||
saAttached.setValue(0);
|
||||
attached = false;
|
||||
saLibName = null;
|
||||
}
|
||||
|
||||
/** Set the timeout value (in milliseconds) for the VM to reply to
|
||||
commands. Once this timeout has elapsed, the VM is assumed to
|
||||
have disconnected. Defaults to 3000 milliseconds (3 seconds). */
|
||||
public void setCommandTimeout(long millis) {
|
||||
timeoutMillis = millis;
|
||||
}
|
||||
|
||||
/** Get the timeout value (in milliseconds) for the VM to reply to
|
||||
commands. Once this timeout has elapsed, the VM is assumed to
|
||||
have disconnected. Defaults to 3000 milliseconds (3 seconds). */
|
||||
public long getCommandTimeout() {
|
||||
return timeoutMillis;
|
||||
}
|
||||
|
||||
/** Indicates whether a Java debug event is pending */
|
||||
public boolean eventPending() {
|
||||
return (saEventPending.getValue() != 0);
|
||||
}
|
||||
|
||||
/** Poll for event; returns null if none pending. */
|
||||
public Event eventPoll() {
|
||||
if (saEventPending.getValue() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int kind = (int) saEventKind.getValue();
|
||||
switch (kind) {
|
||||
case JVMDI_EVENT_EXCEPTION: {
|
||||
JNIHandleAccessor thread = lookupJNIHandle("saExceptionThread");
|
||||
JNIHandleAccessor clazz = lookupJNIHandle("saExceptionClass");
|
||||
JNIid method = lookupJNIid("saExceptionMethod");
|
||||
CIntegerAccessor location = lookupCInt("saExceptionLocation");
|
||||
JNIHandleAccessor exception = lookupJNIHandle("saExceptionException");
|
||||
JNIHandleAccessor catchClass = lookupJNIHandle("saExceptionCatchClass");
|
||||
JNIid catchMethod = lookupJNIid("saExceptionCatchMethod");
|
||||
CIntegerAccessor catchLocation = lookupCInt("saExceptionCatchLocation");
|
||||
return new ExceptionEvent(thread.getValue(), clazz.getValue(), method,
|
||||
(int) location.getValue(), exception.getValue(),
|
||||
catchClass.getValue(), catchMethod, (int) catchLocation.getValue());
|
||||
}
|
||||
|
||||
case JVMDI_EVENT_BREAKPOINT: {
|
||||
JNIHandleAccessor thread = lookupJNIHandle("saBreakpointThread");
|
||||
JNIHandleAccessor clazz = lookupJNIHandle("saBreakpointClass");
|
||||
JNIid method = lookupJNIid("saBreakpointMethod");
|
||||
CIntegerAccessor location = lookupCInt("saBreakpointLocation");
|
||||
return new BreakpointEvent(thread.getValue(), clazz.getValue(),
|
||||
method, (int) location.getValue());
|
||||
}
|
||||
|
||||
default:
|
||||
throw new DebuggerException("Unsupported event type " + kind);
|
||||
}
|
||||
}
|
||||
|
||||
/** Continue past current event */
|
||||
public void eventContinue() {
|
||||
saEventPending.setValue(0);
|
||||
}
|
||||
|
||||
/** Suspend all Java threads in the target VM. Throws
|
||||
DebuggerException if the VM disconnected. */
|
||||
public void suspend() {
|
||||
saCmdType.setValue(SA_CMD_SUSPEND_ALL);
|
||||
saCmdPending.setValue(1);
|
||||
waitForCommandCompletion();
|
||||
suspended = true;
|
||||
}
|
||||
|
||||
/** Resume all Java threads in the target VM. Throws
|
||||
DebuggerException if the VM disconnected. */
|
||||
public void resume() {
|
||||
saCmdType.setValue(SA_CMD_RESUME_ALL);
|
||||
saCmdPending.setValue(1);
|
||||
waitForCommandCompletion();
|
||||
suspended = false;
|
||||
}
|
||||
|
||||
/** Indicates whether all Java threads have been suspended via this
|
||||
interface. */
|
||||
public boolean isSuspended() {
|
||||
return suspended;
|
||||
}
|
||||
|
||||
/** Information about toggling of breakpoints */
|
||||
public static class BreakpointToggleResult {
|
||||
private boolean success;
|
||||
private String errMsg;
|
||||
private int lineNumber;
|
||||
private int bci;
|
||||
private boolean wasSet;
|
||||
private String methodName;
|
||||
private String methodSig;
|
||||
|
||||
/** Success constructor */
|
||||
public BreakpointToggleResult(int lineNumber, int bci, boolean wasSet,
|
||||
String methodName, String methodSig) {
|
||||
this.lineNumber = lineNumber;
|
||||
this.bci = bci;
|
||||
this.wasSet = wasSet;
|
||||
this.methodName = methodName;
|
||||
this.methodSig = methodSig;
|
||||
success = true;
|
||||
}
|
||||
|
||||
/** Failure constructor */
|
||||
public BreakpointToggleResult(String errMsg) {
|
||||
this.errMsg = errMsg;
|
||||
success = false;
|
||||
}
|
||||
|
||||
/** Indicates whether this represents a successful return or not */
|
||||
public boolean getSuccess() { return success; }
|
||||
|
||||
/** Valid only if getSuccess() returns false */
|
||||
public String getErrMsg() { return errMsg; }
|
||||
|
||||
/** Line number at which breakpoint toggle occurred; valid only if
|
||||
getSuccess() returns true. */
|
||||
public int getLineNumber() { return lineNumber; }
|
||||
|
||||
/** BCI at which breakpoint toggle occurred; valid only if
|
||||
getSuccess() returns true. */
|
||||
public int getBCI() { return bci; }
|
||||
|
||||
/** Indicates whether the breakpoint toggle was the set of a
|
||||
breakpoint or not; valid only if getSuccess() returns true. */
|
||||
public boolean getWasSet() { return wasSet; }
|
||||
|
||||
/** Method name in which the breakpoint toggle occurred; valid
|
||||
only if getSuccess() returns true. */
|
||||
public String getMethodName() { return methodName; }
|
||||
|
||||
/** Method signature in which the breakpoint toggle occurred;
|
||||
valid only if getSuccess() returns true. */
|
||||
public String getMethodSignature() { return methodSig; }
|
||||
}
|
||||
|
||||
/** Toggle a breakpoint. Throws DebuggerException if a real error
|
||||
occurred; otherwise returns non-null BreakpointToggleResult. The
|
||||
work of scanning the loaded classes is done in the target VM
|
||||
because it turns out to be significantly faster than scanning
|
||||
through the system dictionary from the SA, and interactivity
|
||||
when setting breakpoints is important. */
|
||||
public BreakpointToggleResult toggleBreakpoint(String srcFileName,
|
||||
String pkgName,
|
||||
int lineNo) {
|
||||
saCmdBkptSrcFileName.setValue(srcFileName);
|
||||
saCmdBkptPkgName.setValue(pkgName);
|
||||
saCmdBkptLineNumber.setValue(lineNo);
|
||||
saCmdType.setValue(SA_CMD_TOGGLE_BREAKPOINT);
|
||||
saCmdPending.setValue(1);
|
||||
if (waitForCommandCompletion(true)) {
|
||||
return new BreakpointToggleResult((int) saCmdBkptResLineNumber.getValue(),
|
||||
(int) saCmdBkptResBCI.getValue(),
|
||||
(saCmdBkptResWasSet.getValue() != 0),
|
||||
saCmdBkptResMethodName.getValue(),
|
||||
saCmdBkptResMethodSig.getValue());
|
||||
} else {
|
||||
return new BreakpointToggleResult(saCmdResultErrMsg.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Internals only below this point
|
||||
//
|
||||
|
||||
private CIntegerAccessor lookupCInt(String symbolName) {
|
||||
return new CIntegerAccessor(lookup(symbolName), 4, false);
|
||||
}
|
||||
|
||||
private CStringAccessor lookupCString(String symbolName, int bufLen) {
|
||||
return new CStringAccessor(lookup(symbolName), bufLen);
|
||||
}
|
||||
|
||||
private JNIHandleAccessor lookupJNIHandle(String symbolName) {
|
||||
return new JNIHandleAccessor(lookup(symbolName), VM.getVM().getObjectHeap());
|
||||
}
|
||||
|
||||
private JNIid lookupJNIid(String symbolName) {
|
||||
Address idAddr = lookup(symbolName).getAddressAt(0);
|
||||
if (idAddr == null) {
|
||||
return null;
|
||||
}
|
||||
return new JNIid(idAddr, VM.getVM().getObjectHeap());
|
||||
}
|
||||
|
||||
private int lookupConstInt(String symbolName) {
|
||||
Address addr = lookup(symbolName);
|
||||
return (int) addr.getCIntegerAt(0, 4, false);
|
||||
}
|
||||
|
||||
private boolean setupLookup(String symbolName) {
|
||||
if (saLibName == null) {
|
||||
for (int i = 0; i < saLibNames.length; i++) {
|
||||
Address addr = dbg.lookup(saLibNames[i], symbolName);
|
||||
if (addr != null) {
|
||||
saLibName = saLibNames[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private Address lookup(String symbolName) {
|
||||
if (saLibName == null) {
|
||||
for (int i = 0; i < saLibNames.length; i++) {
|
||||
Address addr = dbg.lookup(saLibNames[i], symbolName);
|
||||
if (addr != null) {
|
||||
saLibName = saLibNames[i];
|
||||
return addr;
|
||||
}
|
||||
}
|
||||
throw new DebuggerException("Unable to find symbol " + symbolName + " in any of the known names for the SA");
|
||||
}
|
||||
|
||||
Address addr = dbg.lookup(saLibName, symbolName);
|
||||
if (addr == null) {
|
||||
throw new DebuggerException("Unable to find symbol " + symbolName + " in " + saLibName);
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
private void waitForCommandCompletion() {
|
||||
waitForCommandCompletion(false);
|
||||
}
|
||||
|
||||
/** Returns true if command succeeded, false if not */
|
||||
private boolean waitForCommandCompletion(boolean forBreakpoint) {
|
||||
long start = System.currentTimeMillis();
|
||||
long cur = start;
|
||||
while ((saCmdPending.getValue() != 0) &&
|
||||
(cur - start < timeoutMillis)) {
|
||||
try {
|
||||
java.lang.Thread.currentThread().sleep(10);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
cur = System.currentTimeMillis();
|
||||
}
|
||||
if (saCmdPending.getValue() != 0) {
|
||||
detach();
|
||||
throw new DebuggerException("VM appears to have died");
|
||||
}
|
||||
boolean succeeded = saCmdResult.getValue() == 0;
|
||||
if (!succeeded &&
|
||||
(!forBreakpoint || saCmdBkptResWasError.getValue() != 0)) {
|
||||
String err = saCmdResultErrMsg.getValue();
|
||||
throw new DebuggerException("Error executing JVMDI command: " + err);
|
||||
}
|
||||
return succeeded;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* @(#)BinaryTreeDictionary.java
|
||||
* Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@@ -30,7 +30,7 @@ import sun.jvm.hotspot.debugger.*;
|
||||
import sun.jvm.hotspot.types.*;
|
||||
import sun.jvm.hotspot.runtime.*;
|
||||
|
||||
public class BinaryTreeDictionary extends VMObject {
|
||||
public class AFLBinaryTreeDictionary extends VMObject {
|
||||
static {
|
||||
VM.registerVMInitializedObserver(new Observer() {
|
||||
public void update(Observable o, Object data) {
|
||||
@@ -40,8 +40,8 @@ public class BinaryTreeDictionary extends VMObject {
|
||||
}
|
||||
|
||||
private static synchronized void initialize(TypeDataBase db) {
|
||||
Type type = db.lookupType("BinaryTreeDictionary");
|
||||
totalSizeField = type.getCIntegerField("_totalSize");
|
||||
Type type = db.lookupType("AFLBinaryTreeDictionary");
|
||||
totalSizeField = type.getCIntegerField("_total_size");
|
||||
}
|
||||
|
||||
// Fields
|
||||
@@ -53,7 +53,7 @@ public class BinaryTreeDictionary extends VMObject {
|
||||
}
|
||||
|
||||
// Constructor
|
||||
public BinaryTreeDictionary(Address addr) {
|
||||
public AFLBinaryTreeDictionary(Address addr) {
|
||||
super(addr);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user