Commit 1acc89c
Implement DacDbi cDAC APIs and simplify generic type context APIs (#128263)
Implements four DacDbi APIs in the managed cDAC and adds the supporting
`IRuntimeTypeSystem.IsSharedByGenericInstantiations` contract, with
matching documentation.
### cDAC DacDbi implementations
- `GetSimpleType` — resolves CorElementType to its metadata token +
module via `_target.Contracts.RuntimeTypeSystem`.
- `ResolveAssembly` — looks up an assembly ref token through the loader
contract.
- `ResolveExactGenericArgsToken` — walks the generic dictionary to
recover the exact instantiation token.
- `GetGenericArgTokenIndex` — mirrors the native three-state result
(`S_FALSE` / `*pIndex = 0` / `*pIndex = TYPECTXT_ILNUM`).
Each implementation is gated by the existing `#if DEBUG` legacy
cross-check pattern.
### Contract addition
- Added
`IRuntimeTypeSystem.IsSharedByGenericInstantiations(MethodDescHandle)`.
This is required by `GetGenericArgTokenIndex` to distinguish "not
shared" (return `S_FALSE`) from "shared but acquires inst from `this`"
(return `*pIndex = 0`); `RequiresInstArg` collapses both cases into
`false` and is therefore insufficient on its own.
### Documentation
- `docs/design/datacontracts/RuntimeTypeSystem.md`: documented the new
public API next to `RequiresInstArg` (with a note on how the two
differ), and exposed the existing `IsSharedByGenericInstantiations`
helper as a public entry point in the implementation section so the doc
matches the contract surface.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <rachel.jarvi@gmail.com>1 parent 88dbd11 commit 1acc89c
7 files changed
Lines changed: 243 additions & 31 deletions
File tree
- docs/design/datacontracts
- src/native/managed/cdac
- Microsoft.Diagnostics.DataContractReader.Abstractions
- Contracts
- Microsoft.Diagnostics.DataContractReader.Contracts/Contracts
- StackWalk/GC
- Microsoft.Diagnostics.DataContractReader.Legacy/Dbi
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| |||
199 | 208 | | |
200 | 209 | | |
201 | 210 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
| |||
1637 | 1646 | | |
1638 | 1647 | | |
1639 | 1648 | | |
1640 | | - | |
| 1649 | + | |
1641 | 1650 | | |
1642 | 1651 | | |
1643 | | - | |
| 1652 | + | |
1644 | 1653 | | |
1645 | 1654 | | |
1646 | | - | |
1647 | | - | |
1648 | 1655 | | |
1649 | | - | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
1650 | 1662 | | |
| 1663 | + | |
| 1664 | + | |
1651 | 1665 | | |
1652 | 1666 | | |
1653 | 1667 | | |
1654 | | - | |
1655 | 1668 | | |
1656 | 1669 | | |
1657 | 1670 | | |
1658 | 1671 | | |
1659 | | - | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1660 | 1679 | | |
1661 | 1680 | | |
1662 | 1681 | | |
| |||
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| |||
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 203 | + | |
199 | 204 | | |
200 | 205 | | |
201 | 206 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
Lines changed: 33 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | | - | |
1352 | | - | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
| 1351 | + | |
1356 | 1352 | | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
1363 | 1353 | | |
1364 | 1354 | | |
1365 | 1355 | | |
1366 | 1356 | | |
1367 | 1357 | | |
1368 | 1358 | | |
1369 | 1359 | | |
1370 | | - | |
| 1360 | + | |
1371 | 1361 | | |
1372 | 1362 | | |
1373 | | - | |
| 1363 | + | |
1374 | 1364 | | |
1375 | 1365 | | |
1376 | 1366 | | |
1377 | 1367 | | |
1378 | 1368 | | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1379 | 1380 | | |
1380 | 1381 | | |
1381 | 1382 | | |
| |||
1397 | 1398 | | |
1398 | 1399 | | |
1399 | 1400 | | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
1400 | 1420 | | |
1401 | 1421 | | |
1402 | 1422 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
Lines changed: 166 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
1047 | | - | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1048 | 1078 | | |
1049 | 1079 | | |
1050 | 1080 | | |
| |||
1270 | 1300 | | |
1271 | 1301 | | |
1272 | 1302 | | |
1273 | | - | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1274 | 1353 | | |
1275 | 1354 | | |
1276 | 1355 | | |
| |||
1443 | 1522 | | |
1444 | 1523 | | |
1445 | 1524 | | |
1446 | | - | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1447 | 1568 | | |
1448 | 1569 | | |
1449 | 1570 | | |
| |||
2226 | 2347 | | |
2227 | 2348 | | |
2228 | 2349 | | |
2229 | | - | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
2230 | 2392 | | |
2231 | 2393 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
179 | 184 | | |
180 | 185 | | |
181 | 186 | | |
| |||
0 commit comments