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

add column location information to log statements #479

Open
japaric opened this issue May 18, 2021 · 1 comment
Open

add column location information to log statements #479

japaric opened this issue May 18, 2021 · 1 comment
Labels
difficulty: easy Pretty easy to solve priority: low Low priority for the Knurling team status: blocked Blocked on another issue, or on upstream libraries type: enhancement Enhancement or feature request

Comments

@japaric
Copy link
Member

japaric commented May 18, 2021

currently we only display file path and line for each log statement.

AFAICT, rustc doesn't emit DW_AT_decl_column DWARF info with debuginfo=2. So until it does this blocked on upstream support for that.

@japaric japaric added status: blocked Blocked on another issue, or on upstream libraries type: enhancement Enhancement or feature request difficulty: easy Pretty easy to solve priority: low Low priority for the Knurling team labels May 18, 2021
@japaric japaric mentioned this issue Jan 12, 2022
8 tasks
@japaric
Copy link
Member Author

japaric commented Jan 14, 2022

looked into this a bit more. in particular, I was wondering why backtraces have column information when DW_AT_decl_column info is not emitted. what I found out is that addr2line, which std uses under the hood, is using a different part of DWARF info to resolve a Program Counter (PC) address back into (inlined) functions, or rather statements within functions; DWARF contains location information, including column info, for statements.

defmt works with static variables addresses (those are the indices of defmt strings) rather than PC addreses. probe-run uses the DWARF to find the (file, line) location of those static variables. although it seems possible to use a statement-based approach like addr2line does to get column information for log statements that would be quite different from what we are doing now so likely lots of work for little gain. I would personally just wait for DW_AT_decl_column being added to the debuginfo fo Rust programs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Pretty easy to solve priority: low Low priority for the Knurling team status: blocked Blocked on another issue, or on upstream libraries type: enhancement Enhancement or feature request
Projects
None yet
Development

No branches or pull requests

1 participant