| ... | @@ -1642,17 +1642,19 @@ pub const Object = struct { | ... | @@ -1642,17 +1642,19 @@ pub const Object = struct { |
| 1642 | | 1642 | |
| 1643 | const file, const subprogram = if (!wip.strip) debug_info: { | 1643 | const file, const subprogram = if (!wip.strip) debug_info: { |
| 1644 | const file = try o.getDebugFile(file_scope); | 1644 | const file = try o.getDebugFile(file_scope); |
| 1645 | const scope = try o.namespaceToDebugScope(decl.src_namespace); | 1645 | const scope = try o.lowerDebugType(zcu.declPtr(namespace.decl_index).val.toType(), false); |
| 1646 | | 1646 | |
| 1647 | const line_number = decl.navSrcLine(zcu) + 1; | 1647 | const line_number = decl.navSrcLine(zcu) + 1; |
| 1648 | const is_internal_linkage = decl.val.getExternFunc(zcu) == null; | 1648 | const is_internal_linkage = decl.val.getExternFunc(zcu) == null; |
| 1649 | const debug_decl_type = try o.lowerDebugType(decl.typeOf(zcu), true); | 1649 | const debug_decl_type = try o.lowerDebugType(decl.typeOf(zcu), true); |
| | 1650 | const decl_name = try o.builder.metadataString(decl.name.toSlice(ip)); |
| | 1651 | const link_name = try o.builder.metadataStringFromStrtabString(function_index.name(&o.builder)); |
| 1650 | | 1652 | |
| 1651 | const subprogram = try o.builder.debugSubprogram( | 1653 | const subprogram = try o.builder.debugSubprogram( |
| 1652 | file, | 1654 | file, |
| 1653 | scope, | 1655 | scope, |
| 1654 | try o.builder.metadataString(decl.name.toSlice(ip)), | 1656 | decl_name, |
| 1655 | try o.builder.metadataStringFromStrtabString(function_index.name(&o.builder)), | 1657 | link_name, |
| 1656 | line_number, | 1658 | line_number, |
| 1657 | line_number + func.lbrace_line, | 1659 | line_number + func.lbrace_line, |
| 1658 | debug_decl_type, | 1660 | debug_decl_type, |
| ... | @@ -1669,6 +1671,7 @@ pub const Object = struct { | ... | @@ -1669,6 +1671,7 @@ pub const Object = struct { |
| 1669 | }, | 1671 | }, |
| 1670 | o.debug_compile_unit, | 1672 | o.debug_compile_unit, |
| 1671 | ); | 1673 | ); |
| | 1674 | |
| 1672 | function_index.setSubprogram(subprogram, &o.builder); | 1675 | function_index.setSubprogram(subprogram, &o.builder); |
| 1673 | break :debug_info .{ file, subprogram }; | 1676 | break :debug_info .{ file, subprogram }; |
| 1674 | } else .{.none} ** 2; | 1677 | } else .{.none} ** 2; |