| ... | @@ -1512,6 +1512,7 @@ pub const ModuleDebugInfo = switch (native_os) { | ... | @@ -1512,6 +1512,7 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 1512 | var opt_debug_info: ?macho.section_64 = null; | 1512 | var opt_debug_info: ?macho.section_64 = null; |
| 1513 | var opt_debug_abbrev: ?macho.section_64 = null; | 1513 | var opt_debug_abbrev: ?macho.section_64 = null; |
| 1514 | var opt_debug_str: ?macho.section_64 = null; | 1514 | var opt_debug_str: ?macho.section_64 = null; |
| | 1515 | var opt_debug_str_offsets: ?macho.section_64 = null; |
| 1515 | var opt_debug_line_str: ?macho.section_64 = null; | 1516 | var opt_debug_line_str: ?macho.section_64 = null; |
| 1516 | var opt_debug_ranges: ?macho.section_64 = null; | 1517 | var opt_debug_ranges: ?macho.section_64 = null; |
| 1517 | var opt_debug_loclists: ?macho.section_64 = null; | 1518 | var opt_debug_loclists: ?macho.section_64 = null; |
| ... | @@ -1530,6 +1531,8 @@ pub const ModuleDebugInfo = switch (native_os) { | ... | @@ -1530,6 +1531,8 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 1530 | opt_debug_abbrev = sect; | 1531 | opt_debug_abbrev = sect; |
| 1531 | } else if (mem.eql(u8, name, "__debug_str")) { | 1532 | } else if (mem.eql(u8, name, "__debug_str")) { |
| 1532 | opt_debug_str = sect; | 1533 | opt_debug_str = sect; |
| | 1534 | } else if (mem.eql(u8, name, "__debug_str_offsets")) { |
| | 1535 | opt_debug_str_offsets = sect; |
| 1533 | } else if (mem.eql(u8, name, "__debug_line_str")) { | 1536 | } else if (mem.eql(u8, name, "__debug_line_str")) { |
| 1534 | opt_debug_line_str = sect; | 1537 | opt_debug_line_str = sect; |
| 1535 | } else if (mem.eql(u8, name, "__debug_ranges")) { | 1538 | } else if (mem.eql(u8, name, "__debug_ranges")) { |
| ... | @@ -1561,7 +1564,10 @@ pub const ModuleDebugInfo = switch (native_os) { | ... | @@ -1561,7 +1564,10 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 1561 | .debug_info = try chopSlice(mapped_mem, debug_info.offset, debug_info.size), | 1564 | .debug_info = try chopSlice(mapped_mem, debug_info.offset, debug_info.size), |
| 1562 | .debug_abbrev = try chopSlice(mapped_mem, debug_abbrev.offset, debug_abbrev.size), | 1565 | .debug_abbrev = try chopSlice(mapped_mem, debug_abbrev.offset, debug_abbrev.size), |
| 1563 | .debug_str = try chopSlice(mapped_mem, debug_str.offset, debug_str.size), | 1566 | .debug_str = try chopSlice(mapped_mem, debug_str.offset, debug_str.size), |
| 1564 | .debug_str_offsets = null, | 1567 | .debug_str_offsets = if (opt_debug_str_offsets) |debug_str_offsets| |
| | 1568 | try chopSlice(mapped_mem, debug_str_offsets.offset, debug_str_offsets.size) |
| | 1569 | else |
| | 1570 | null, |
| 1565 | .debug_line = try chopSlice(mapped_mem, debug_line.offset, debug_line.size), | 1571 | .debug_line = try chopSlice(mapped_mem, debug_line.offset, debug_line.size), |
| 1566 | .debug_line_str = if (opt_debug_line_str) |debug_line_str| | 1572 | .debug_line_str = if (opt_debug_line_str) |debug_line_str| |
| 1567 | try chopSlice(mapped_mem, debug_line_str.offset, debug_line_str.size) | 1573 | try chopSlice(mapped_mem, debug_line_str.offset, debug_line_str.size) |
| ... | @@ -1571,11 +1577,26 @@ pub const ModuleDebugInfo = switch (native_os) { | ... | @@ -1571,11 +1577,26 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 1571 | try chopSlice(mapped_mem, debug_ranges.offset, debug_ranges.size) | 1577 | try chopSlice(mapped_mem, debug_ranges.offset, debug_ranges.size) |
| 1572 | else | 1578 | else |
| 1573 | null, | 1579 | null, |
| 1574 | .debug_loclists = opt_debug_loclists, | 1580 | .debug_loclists = if (opt_debug_loclists) |debug_loclists| |
| 1575 | .debug_rnglists = opt_debug_rnglists, | 1581 | try chopSlice(mapped_mem, debug_loclists.offset, debug_loclists.size) |
| 1576 | .debug_addr = opt_debug_addr, | 1582 | else |
| 1577 | .debug_names = opt_debug_names, | 1583 | null, |
| 1578 | .debug_frame = opt_debug_frame, | 1584 | .debug_rnglists = if (opt_debug_rnglists) |debug_rnglists| |
| | 1585 | try chopSlice(mapped_mem, debug_rnglists.offset, debug_rnglists.size) |
| | 1586 | else |
| | 1587 | null, |
| | 1588 | .debug_addr = if (opt_debug_addr) |debug_addr| |
| | 1589 | try chopSlice(mapped_mem, debug_addr.offset, debug_addr.size) |
| | 1590 | else |
| | 1591 | null, |
| | 1592 | .debug_names = if (opt_debug_names) |debug_names| |
| | 1593 | try chopSlice(mapped_mem, debug_names.offset, debug_names.size) |
| | 1594 | else |
| | 1595 | null, |
| | 1596 | .debug_frame = if (opt_debug_frame) |debug_frame| |
| | 1597 | try chopSlice(mapped_mem, debug_frame.offset, debug_frame.size) |
| | 1598 | else |
| | 1599 | null, |
| 1579 | }; | 1600 | }; |
| 1580 | | 1601 | |
| 1581 | try DW.openDwarfDebugInfo(&di, allocator); | 1602 | try DW.openDwarfDebugInfo(&di, allocator); |
| ... | @@ -1630,7 +1651,7 @@ pub const ModuleDebugInfo = switch (native_os) { | ... | @@ -1630,7 +1651,7 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 1630 | .compile_unit_name = compile_unit.die.getAttrString( | 1651 | .compile_unit_name = compile_unit.die.getAttrString( |
| 1631 | o_file_di, | 1652 | o_file_di, |
| 1632 | DW.AT.name, | 1653 | DW.AT.name, |
| 1633 | self.di.debug_str, | 1654 | o_file_di.debug_str, |
| 1634 | ) catch |err| switch (err) { | 1655 | ) catch |err| switch (err) { |
| 1635 | error.MissingDebugInfo, error.InvalidDebugInfo => "???", | 1656 | error.MissingDebugInfo, error.InvalidDebugInfo => "???", |
| 1636 | }, | 1657 | }, |