Commit 3c2d2a1
Mike McLaughlin
Fix the MacOS remote unwinder for VS4Mac (dotnet#63405)
* Fix the MacOS remote unwinder for VS4Mac
The wrong module was being passed to the remote unwinder because the load bias for shared modules
was being calculated incorrectly.
Issue: dotnet#63309
* Fix native frame unwind in syscall on arm64 for VS4Mac crash report
From PR in main: dotnet#63598
Add arm64 version of StepWithCompactNoEncoding for syscall leaf node wrappers that have compact encoding of 0.
Fix ReadCompactEncodingRegister so it actually decrements the addr.
Change StepWithCompactEncodingArm64 to match what MacOS libunwind does for framed and frameless stepping.
arm64 can have frames with the same SP (but different IPs). Increment SP for this condition so createdump's unwind
loop doesn't break out on the "SP not increasing" check and the frames are added to the thread frame list in the
correct order.
Add getting the unwind info for tail called functions like this:
__ZL14PROCEndProcessPvji:
36630: f6 57 bd a9 stp x22, x21, [sp, #-48]!
36634: f4 4f 01 a9 stp x20, x19, [sp, #16]
36638: fd 7b 02 a9 stp x29, x30, [sp, dotnet#32]
3663c: fd 83 00 91 add x29, sp, dotnet#32
...
367ac: e9 01 80 52 mov w9, #15
367b0: 7f 3e 02 71 cmp w19, dotnet#143
367b4: 20 01 88 1a csel w0, w9, w8, eq
367b8: 2e 00 00 94 bl _PROCAbort
_TerminateProcess:
-> 367bc: 22 00 80 52 mov w2, #1
367c0: 9c ff ff 17 b __ZL14PROCEndProcessPvji
The IP (367bc) returns the (incorrect) frameless encoding with nothing on the stack (uses an incorrect LR to unwind). To fix this
get the unwind info for PC -1 which points to PROCEndProcess with the correct unwind info. This matches how lldb unwinds this frame.
Always address module segment to IP lookup list instead of checking the module regions.
Strip pointer authentication bits on PC/LR.1 parent fe7335c commit 3c2d2a1
File tree
5 files changed
+118
-41
lines changed- src/coreclr
- debug
- createdump
- dbgutil
- pal/src/exception
5 files changed
+118
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
| |||
297 | 300 | | |
298 | 301 | | |
299 | 302 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
233 | | - | |
234 | | - | |
| 232 | + | |
| 233 | + | |
235 | 234 | | |
236 | 235 | | |
237 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
1422 | 1423 | | |
1423 | 1424 | | |
1424 | 1425 | | |
1425 | | - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1426 | 1456 | | |
1427 | 1457 | | |
1428 | | - | |
1429 | | - | |
| 1458 | + | |
| 1459 | + | |
1430 | 1460 | | |
1431 | 1461 | | |
| 1462 | + | |
| 1463 | + | |
1432 | 1464 | | |
1433 | 1465 | | |
1434 | 1466 | | |
1435 | | - | |
1436 | | - | |
| 1467 | + | |
| 1468 | + | |
1437 | 1469 | | |
1438 | 1470 | | |
1439 | 1471 | | |
| 1472 | + | |
1440 | 1473 | | |
1441 | | - | |
| 1474 | + | |
1442 | 1475 | | |
1443 | | - | |
1444 | 1476 | | |
1445 | 1477 | | |
1446 | 1478 | | |
| |||
1450 | 1482 | | |
1451 | 1483 | | |
1452 | 1484 | | |
1453 | | - | |
1454 | | - | |
| 1485 | + | |
| 1486 | + | |
1455 | 1487 | | |
1456 | 1488 | | |
1457 | 1489 | | |
| |||
1484 | 1516 | | |
1485 | 1517 | | |
1486 | 1518 | | |
| 1519 | + | |
1487 | 1520 | | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1494 | 1533 | | |
1495 | 1534 | | |
1496 | | - | |
| 1535 | + | |
1497 | 1536 | | |
1498 | | - | |
| 1537 | + | |
1499 | 1538 | | |
1500 | 1539 | | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
| 1540 | + | |
1511 | 1541 | | |
1512 | 1542 | | |
1513 | 1543 | | |
| |||
1546 | 1576 | | |
1547 | 1577 | | |
1548 | 1578 | | |
1549 | | - | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
1550 | 1583 | | |
1551 | 1584 | | |
1552 | 1585 | | |
| |||
1557 | 1590 | | |
1558 | 1591 | | |
1559 | 1592 | | |
1560 | | - | |
1561 | 1593 | | |
1562 | 1594 | | |
1563 | 1595 | | |
1564 | 1596 | | |
| 1597 | + | |
1565 | 1598 | | |
1566 | 1599 | | |
1567 | 1600 | | |
| |||
1575 | 1608 | | |
1576 | 1609 | | |
1577 | 1610 | | |
1578 | | - | |
1579 | | - | |
1580 | | - | |
1581 | | - | |
1582 | | - | |
1583 | 1611 | | |
1584 | 1612 | | |
1585 | 1613 | | |
| |||
1717 | 1745 | | |
1718 | 1746 | | |
1719 | 1747 | | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
1720 | 1754 | | |
1721 | 1755 | | |
1722 | 1756 | | |
| |||
2126 | 2160 | | |
2127 | 2161 | | |
2128 | 2162 | | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
2129 | 2190 | | |
2130 | 2191 | | |
2131 | 2192 | | |
| |||
0 commit comments