File tree 1 file changed +28
-2
lines changed
stdlib/public/Backtracing
1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -1538,7 +1538,7 @@ struct DwarfReader<S: DwarfSource> {
1538
1538
1539
1539
var cursor = ImageSourceCursor ( source: infoSection,
1540
1540
offset: abstractOrigin)
1541
- let abbrev = try cursor. readULEB128 ( )
1541
+ var abbrev = try cursor. readULEB128 ( )
1542
1542
if abbrev == 0 {
1543
1543
return
1544
1544
}
@@ -1553,13 +1553,39 @@ struct DwarfReader<S: DwarfSource> {
1553
1553
return
1554
1554
}
1555
1555
1556
- let refAttrs = try readDieAttributes (
1556
+ var refAttrs = try readDieAttributes (
1557
1557
at: & cursor,
1558
1558
unit: unit,
1559
1559
abbrevInfo: abbrevInfo,
1560
1560
shouldFetchIndirect: true
1561
1561
)
1562
1562
1563
+ if let specificationVal = refAttrs [ . DW_AT_specification] ,
1564
+ case let . reference( specification) = specificationVal {
1565
+ cursor = ImageSourceCursor ( source: infoSection,
1566
+ offset: specification)
1567
+ abbrev = try cursor. readULEB128 ( )
1568
+ if abbrev == 0 {
1569
+ return
1570
+ }
1571
+
1572
+ guard let abbrevInfo = unit. abbrevs [ abbrev] else {
1573
+ throw DwarfError . missingAbbrev ( abbrev)
1574
+ }
1575
+
1576
+ let tag = abbrevInfo. tag
1577
+ if tag != . DW_TAG_subprogram {
1578
+ return
1579
+ }
1580
+
1581
+ refAttrs = try readDieAttributes (
1582
+ at: & cursor,
1583
+ unit: unit,
1584
+ abbrevInfo: abbrevInfo,
1585
+ shouldFetchIndirect: true
1586
+ )
1587
+ }
1588
+
1563
1589
var name : String ? = nil
1564
1590
var rawName : String ? = nil
1565
1591
You can’t perform that action at this time.
0 commit comments