Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/link: Add DW_AT_decl_line for DW_TAG_subprogram in DWARF table #57308

Open
hoeppi-google opened this issue Dec 14, 2022 · 6 comments
Open
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@hoeppi-google
Copy link

Currently, the DWARF table does not contain DW_AT_decl_line in the DW_TAG_subprogram entries, i.e. the source code line number of the function definition is not listed in the DWARF entry of said function. I propose to add this information to the DWARF table.

DW_AT_decl_line of functions is needed to convert absolute line numbers into relative line numbers w.r.t. to the first line of the function from DWARF information. Such information is useful in the context of PGO.

CC @aclements

@gopherbot gopherbot added this to the Proposal milestone Dec 14, 2022
@prattmic
Copy link
Member

cc @cherrymui @thanm

@prattmic
Copy link
Member

I am fairly certain that adding new DWARF data does not require the proposal process. Removing.

@prattmic prattmic changed the title proposal: cmd/link: Add DW_AT_decl_line for DW_TAG_subprogram in DWARF table cmd/link: Add DW_AT_decl_line for DW_TAG_subprogram in DWARF table Dec 14, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Dec 14, 2022
@prattmic prattmic modified the milestones: Proposal, Go1.21 Dec 14, 2022
@prattmic prattmic self-assigned this Dec 14, 2022
@prattmic prattmic added NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Dec 14, 2022
@thanm
Copy link
Contributor

thanm commented Dec 14, 2022

@hoeppi-google is this attribute needed for subprogram corresponding to abstract functions? Or only regular DW_TAG_subprogram entries corresponding to vanilla functions?

@thanm
Copy link
Contributor

thanm commented Dec 14, 2022

discussed this offline with @prattmic , sounds like we need abstract function support as well.

@gopherbot
Copy link

Change https://go.dev/cl/457696 mentions this issue: cmd/link: set DW_AT_decl_line for function declarations

@gopherbot
Copy link

Change https://go.dev/cl/458195 mentions this issue: cmd/compile,cmd/link: set DW_AT_decl_line for function declarations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: Todo
Development

No branches or pull requests

4 participants