ggreif labeled Issue #1988:
For a DWARF-5 equipped
.wasm
file, translated to.o
(viawasmtime wasm2obj -g
) the containing directories are mixed up:
- from
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x000288fa version: 5 ... include_directories[ 0] = "." include_directories[ 1] = "<moc-asset>" include_directories[ 2] = "tests/debug/testsuite" file_names[ 0]: name: "fib-wasm.mo" dir_index: 2 file_names[ 1]:
- to:
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x0000e747 version: 4 ... include_directories[ 1] = "." include_directories[ 2] = "<moc-asset>" include_directories[ 3] = "tests/debug/testsuite" file_names[ 1]: name: "fib-wasm.mo" dir_index: 2
Since the latter is one-based, the index but be incremented.
(I'm working on a PR.)
ggreif opened Issue #1988:
For a DWARF-5 equipped
.wasm
file, translated to.o
(viawasmtime wasm2obj -g
) the containing directories are mixed up:
- from
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x000288fa version: 5 ... include_directories[ 0] = "." include_directories[ 1] = "<moc-asset>" include_directories[ 2] = "tests/debug/testsuite" file_names[ 0]: name: "fib-wasm.mo" dir_index: 2 file_names[ 1]:
- to:
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x0000e747 version: 4 ... include_directories[ 1] = "." include_directories[ 2] = "<moc-asset>" include_directories[ 3] = "tests/debug/testsuite" file_names[ 1]: name: "fib-wasm.mo" dir_index: 2
Since the latter is one-based, the index but be incremented.
(I'm working on a PR.)
ggreif edited Issue #1988:
For a DWARF-5 equipped
.wasm
file, translated to.o
(viawasmtime wasm2obj -g
) the containing directories are mixed up:
- from
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x000288fa version: 5 ... include_directories[ 0] = "." include_directories[ 1] = "<moc-asset>" include_directories[ 2] = "tests/debug/testsuite" file_names[ 0]: name: "fib-wasm.mo" dir_index: 2 file_names[ 1]:
- to:
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x0000e747 version: 4 ... include_directories[ 1] = "." include_directories[ 2] = "<moc-asset>" include_directories[ 3] = "tests/debug/testsuite" file_names[ 1]: name: "fib-wasm.mo" dir_index: 2
Since the latter is one-based, the index must be incremented.
(I'm working on a PR.)
ggreif commented on Issue #1988:
Alternatively we could honour this commentary from the DWARF-5 standard:
Prior to DWARF Version 5, the current directory was not represented in the directories field and a directory index of 0 implicitly referred to that directory as found in the DW_AT_comp_dir attribute of the compilation unit debugging information entry. In DWARF Version 5, the current directory is explicitly present in the directories field. This is needed to support the common practice of stripping all but the line number sections (.debug_line and .debug_line_str) from an executable.
ggreif edited a comment on Issue #1988:
Alternatively we could honour this commentary from the DWARF-5 standard:
Prior to DWARF Version 5, the current directory was not represented in the directories field and a directory index of 0 implicitly referred to that directory as found in the DW_AT_comp_dir attribute of the compilation unit debugging information entry. In DWARF Version 5, the current directory is explicitly present in the directories field. This is needed to support the common practice of stripping all but the line number sections (.debug_line and .debug_line_str) from an executable.
ggreif edited a comment on Issue #1988:
Alternatively we could honour this commentary from the DWARF-5 standard:
Prior to DWARF Version 5, the current directory was not represented in the directories field and a directory index of 0 implicitly referred to that directory as found in the DW_AT_comp_dir attribute of the compilation unit debugging information entry. In DWARF Version 5, the current directory is explicitly present in the directories field. This is needed to support the common practice of stripping all but the line number sections (.debug_line and .debug_line_str) from an executable.
This is a bit more involved, since, it needs to compare the translation unit's directory with the DWARF-5.debug_line
section'sinclude_directories[0]
entry, and when equal, jettison the latter, keeping the file indices.
ggreif edited a comment on Issue #1988:
Alternatively we could honour this commentary from the DWARF-5 standard:
Prior to DWARF Version 5, the current directory was not represented in the directories field and a directory index of 0 implicitly referred to that directory as found in the DW_AT_comp_dir attribute of the compilation unit debugging information entry. In DWARF Version 5, the current directory is explicitly present in the directories field. This is needed to support the common practice of stripping all but the line number sections (.debug_line and .debug_line_str) from an executable.
This is a bit more involved, since, it needs to compare the translation unit's directory with the DWARF-5
.debug_line
section'sinclude_directories[0]
entry, and when equal, jettison the latter, keeping the file indices.
ggreif edited a comment on Issue #1988:
Alternatively we could honour this commentary from the DWARF-5 standard:
Prior to DWARF Version 5, the current directory was not represented in the directories field and a directory index of 0 implicitly referred to that directory as found in the DW_AT_comp_dir attribute of the compilation unit debugging information entry. In DWARF Version 5, the current directory is explicitly present in the directories field. This is needed to support the common practice of stripping all but the line number sections (.debug_line and .debug_line_str) from an executable.
This is a bit more involved, since it needs to compare the translation unit's directory with the DWARF-5
.debug_line
section'sinclude_directories[0]
entry, and when equal, jettison the latter, keeping the file indices.
yurydelendik closed Issue #1988:
For a DWARF-5 equipped
.wasm
file, translated to.o
(viawasmtime wasm2obj -g
) the containing directories are mixed up:
- from
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x000288fa version: 5 ... include_directories[ 0] = "." include_directories[ 1] = "<moc-asset>" include_directories[ 2] = "tests/debug/testsuite" file_names[ 0]: name: "fib-wasm.mo" dir_index: 2 file_names[ 1]:
- to:
.debug_line contents: debug_line[0x00000000] Line table prologue: total_length: 0x0000e747 version: 4 ... include_directories[ 1] = "." include_directories[ 2] = "<moc-asset>" include_directories[ 3] = "tests/debug/testsuite" file_names[ 1]: name: "fib-wasm.mo" dir_index: 2
Since the latter is one-based, the index must be incremented.
(I'm working on a PR.)
Last updated: Nov 22 2024 at 17:03 UTC