Skip to content

[experimental] shorten backtraces using debuginfo #134831

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 18 commits into from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Dec 27, 2024

cc rust-lang/compiler-team#818

r? @ghost

@rustbot label S-experimental

try-job: aarch64-apple

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. labels Dec 27, 2024
@clubby789
Copy link
Contributor

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 27, 2024
[experimental] shorten backtraces using debuginfo

cc rust-lang/compiler-team#818

r? `@ghost`

`@rustbot` label S-experimental

try-job: aarch64-apple
@bors
Copy link
Collaborator

bors commented Dec 27, 2024

⌛ Trying commit a2beb5e with merge a402123...

@jieyouxu
Copy link
Member

@bors delegate+ (for try jobs)

@bors
Copy link
Collaborator

bors commented Dec 27, 2024

✌️ @jyn514, you can now approve this pull request!

If @jieyouxu told you to "r=me" after making some further change, please make that change, then do @bors r=@jieyouxu

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Dec 27, 2024

i think rustc_middle is going to fail to compile, so

@bors cancel try

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@jyn514
Copy link
Member Author

jyn514 commented Dec 29, 2024

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2024
[experimental] shorten backtraces using debuginfo

cc rust-lang/compiler-team#818

r? `@ghost`

`@rustbot` label S-experimental

try-job: aarch64-apple
@bors
Copy link
Collaborator

bors commented Dec 29, 2024

⌛ Trying commit f1f0ee4 with merge 254d2dc...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 29, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 29, 2024
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Dec 29, 2024
@jyn514
Copy link
Member Author

jyn514 commented Dec 29, 2024

@bors try

@bors
Copy link
Collaborator

bors commented Dec 29, 2024

⌛ Trying commit e972aac with merge d3a0d42...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 29, 2024
[experimental] shorten backtraces using debuginfo

cc rust-lang/compiler-team#818

r? `@ghost`

`@rustbot` label S-experimental

try-job: aarch64-apple
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 29, 2024

💔 Test failed - checks-actions

@bors
Copy link
Collaborator

bors commented Jan 3, 2025

☔ The latest upstream changes (presumably #135053) made this pull request unmergeable. Please resolve the merge conflicts.

- give an error when `#[rustc_start/end_short_backtrace]` is used with `#[inline]`
- update `short_ice-remove-middle-frames` to use the new attribute so that it's tested
- don't ICE when debug logging
jyn514 added a commit to jyn514/gimli that referenced this pull request Jan 21, 2025
Often, consumers of a DWARF file will want to know if a given function has an attribute, either directly or indirectly. Currently, finding that information is tedious and prone to error. Add a helper function in gimli to make this easier.

This does not attempt to have the maximum possible performance; consumers who care about that can still implement the logic themselves. In particular, the caches are recalculated each time `shared_attrs` is called, introducing an allocation.

The logic works roughly as follows (inspired by [addr2line::Function::parse_children](https://github.com/gimli-rs/addr2line/blob/28ba2d45f2d22134915f55b46ddd6a039559366b/src/function.rs#L278)):

- Create a cache of all DWARF units known to the `UnitRef`
- Given an entry offset, iterate over all its attributes and pass them to a callback chosen by the caller.
- For each indirect attribute, such as `DW_AT_abstract_origin`, follow the pointer to the abstract source and do the same thing again there.

I have tested this downstream (see [rust-lang/rust#134831](rust-lang/rust#134831)), but I have not yet added unit tests. Let me know how you would like this to be tested.
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-tidy Area: The tidy tool labels Jan 21, 2025
@jyn514
Copy link
Member Author

jyn514 commented May 8, 2025

i won't be working on this for a while

@jyn514 jyn514 closed this May 8, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants