Commit 83cb352
committed
Fix a design issue in the debug inspector API
Previously, a user of the debug inspector API was supposed to use
`rb_debug_inspector_backtrace_locations` to get an array of
`Thread::Backtrace::Location`, and then used its index to get more
information from `rb_debug_inspector _frame_binding_get(index)`, etc.
However, `rb_debug_inspector_backtrace_locations` returned an array of
backtraces excluding rescue/ensure frames. On the other hand,
`rb_debug_inspector_frame_binding_get(index)` interprets index with
rescue/ensure frames. This led to inconsistency of the index, and it was
very difficult to correctly use the debug inspector API.
This change deprecates `rb_debug_inspector_backtrace_locations` and
introduces instead `rb_debug_inspector_frame_loc_get(index)`, which
returns a `Thread::Backtrace::Location` object for the frame specified
by `index`. Also `rb_debug_inspector_frame_count` is introduced to get
the length of the backtrace.1 parent 553753c commit 83cb352
File tree
3 files changed
+62
-8
lines changed- ext/-test-/debug
- include/ruby
3 files changed
+62
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
236 | 240 | | |
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
| |||
280 | 292 | | |
281 | 293 | | |
282 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
283 | 305 | | |
284 | 306 | | |
285 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1504 | 1504 | | |
1505 | 1505 | | |
1506 | 1506 | | |
| 1507 | + | |
1507 | 1508 | | |
1508 | 1509 | | |
1509 | 1510 | | |
1510 | 1511 | | |
1511 | 1512 | | |
1512 | 1513 | | |
| 1514 | + | |
| 1515 | + | |
1513 | 1516 | | |
1514 | 1517 | | |
1515 | 1518 | | |
1516 | | - | |
| 1519 | + | |
1517 | 1520 | | |
1518 | | - | |
| 1521 | + | |
| 1522 | + | |
1519 | 1523 | | |
1520 | 1524 | | |
1521 | 1525 | | |
| |||
1546 | 1550 | | |
1547 | 1551 | | |
1548 | 1552 | | |
1549 | | - | |
| 1553 | + | |
1550 | 1554 | | |
1551 | 1555 | | |
1552 | 1556 | | |
1553 | 1557 | | |
1554 | 1558 | | |
1555 | 1559 | | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1556 | 1568 | | |
1557 | 1569 | | |
1558 | 1570 | | |
| |||
1562 | 1574 | | |
1563 | 1575 | | |
1564 | 1576 | | |
1565 | | - | |
| 1577 | + | |
1566 | 1578 | | |
1567 | 1579 | | |
1568 | 1580 | | |
1569 | 1581 | | |
1570 | 1582 | | |
1571 | 1583 | | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1572 | 1592 | | |
1573 | 1593 | | |
1574 | 1594 | | |
| |||
1645 | 1665 | | |
1646 | 1666 | | |
1647 | 1667 | | |
1648 | | - | |
| 1668 | + | |
1649 | 1669 | | |
1650 | 1670 | | |
1651 | 1671 | | |
1652 | 1672 | | |
1653 | 1673 | | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
1654 | 1680 | | |
1655 | 1681 | | |
1656 | 1682 | | |
| |||
1681 | 1707 | | |
1682 | 1708 | | |
1683 | 1709 | | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
1684 | 1717 | | |
1685 | 1718 | | |
1686 | 1719 | | |
| |||
0 commit comments