llvm: improve emitted debug info#13675
Merged
Vexu merged 1 commit intoziglang:masterfrom Nov 28, 2022
Merged
Conversation
* ensure parameter debug info is in the subroutine di scope * slit sub file path into basename and dirname Closes ziglang#12257 Closes ziglang#12665
Member
Member
|
The issue #13315 still persists: |
Contributor
|
13224 currently fails with |
Member
Author
|
But do you get a stack trace? |
Contributor
|
https://bpa.st/raw/2EMA yeah but thats even on master, so the issue no longer repros for me with that input |
andrewrk
approved these changes
Nov 28, 2022
Contributor
|
The change to how the LLVM backend emits the path to the source file leads to a duplicated parent directory with correct DWARF parsing. This can be observed with There's more context as to my changes to the DWARF parsing code on Discord: https://discord.com/channels/605571803288698900/1041373573908021248/1041386215733215352 Example: // src/main.zig
const b = @import("a/b.zig");
pub fn main() void {
b.doTest();
}// src/a/b.zig
pub fn doTest() void {
@panic("test");
}Before this patch: $ llvm-dwarfdump -n doTest main
main: file format elf64-x86-64
0x000041c6: DW_TAG_subprogram
DW_AT_low_pc (0x000000000020bc30)
DW_AT_high_pc (0x000000000020bc56)
DW_AT_frame_base (DW_OP_reg6 RBP)
DW_AT_linkage_name ("a.b.doTest")
DW_AT_name ("doTest")
DW_AT_decl_file ("src/a/b.zig")
DW_AT_decl_line (1)
DW_AT_type (0x00003ccd "void")With this patch: $ llvm-dwarfdump -n doTest main
main: file format elf64-x86-64
0x00004156: DW_TAG_subprogram
DW_AT_low_pc (0x000000000020bc30)
DW_AT_high_pc (0x000000000020bc56)
DW_AT_frame_base (DW_OP_reg6 RBP)
DW_AT_linkage_name ("a.b.doTest")
DW_AT_name ("doTest")
DW_AT_decl_file ("src/src/a/b.zig")
DW_AT_decl_line (1)
DW_AT_type (0x00003c79 "void") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12257
Closes #12665
Might also resolve the following: #13224 and #13315 but I haven't been able to reproduce those.