Skip to content

Add custom backtrace printer that excludes frames outside of user's code - #53

Merged
spacekookie merged 2 commits into
rust-cli:masterfrom
DoumanAsh:custom_backtrace_printer
Mar 25, 2019
Merged

spacekookie merged 2 commits into
rust-cli:masterfrom
DoumanAsh:custom_backtrace_printer

Conversation

@DoumanAsh

@DoumanAsh DoumanAsh commented Nov 7, 2018

Copy link
Copy Markdown
Contributor

Closes #52

Checklist

  • tests pass

Example of from tests/ repo with debug symbols https://gist.github.com/DoumanAsh/4b1da5519a86df101e3a4f88f7e4d812

Let me know if changes to format needed, then I'll update examples in README.md

@spacekookie spacekookie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there and thanks a lot for this patch ❤️

I added a few comments in the code. Mostly things that weren't very obvious to me at a first glance and could use some documentation and some general code structure.

Comment thread src/report.rs Outdated
Comment thread src/report.rs
Comment thread src/report.rs Outdated
Comment thread src/report.rs Outdated
Comment thread src/report.rs
Comment thread src/report.rs
.enumerate()
{
let ip = frame.ip();
let _ = write!(backtrace, "\n{:4}: {:2$?}", idx, ip, HEX_WIDTH);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a question but: what happens if write! fails? I guess there's an Err(...) that we just never check?

While we don't ever want to panic, it might be a nicer approach to move this whole code to a function that can return a Result<...>, then just using ? liberally to make sure that no badly formatted stacktraces are written.

@DoumanAsh DoumanAsh Nov 8, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no possibility for it to fail for String

@DoumanAsh

Copy link
Copy Markdown
Contributor Author

Comments are addressed

@spacekookie spacekookie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there, sorry for leaving this PR open for so long. Must have fallen off the radar. LGTM now

@spacekookie
spacekookie merged commit f4a5b23 into rust-cli:master Mar 25, 2019
epage added a commit that referenced this pull request Sep 12, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[EmbarkStudios/cargo-deny-action](https://redirect.github.com/EmbarkStudios/cargo-deny-action)
| action | pinDigest | → `3fd3802` |
| [Swatinem/rust-cache](https://redirect.github.com/Swatinem/rust-cache)
| action | pinDigest | → `e18b497` |
|
[actions-rs/audit-check](https://redirect.github.com/actions-rs/audit-check)
| action | pinDigest | → `35b7b53` |
| [actions/checkout](https://redirect.github.com/actions/checkout) |
action | pinDigest | → `de0fac2` |
|
[coverallsapp/github-action](https://redirect.github.com/coverallsapp/github-action)
| action | pinDigest | → `09b709c` |
| [crate-ci/committed](https://redirect.github.com/crate-ci/committed) |
action | pinDigest | → `4cd58ed` |
| [crate-ci/typos](https://redirect.github.com/crate-ci/typos) | action
| pinDigest | → `8f11c0d` |
|
[dtolnay/rust-toolchain](https://redirect.github.com/dtolnay/rust-toolchain)
| action | pinDigest | → `29eef33` |
|
[github/codeql-action](https://redirect.github.com/github/codeql-action)
| action | pinDigest | → `c10b806` |
| [j178/prek-action](https://redirect.github.com/j178/prek-action) |
action | pinDigest | → `0bb87d7` |
|
[taiki-e/install-action](https://redirect.github.com/taiki-e/install-action)
| action | pinDigest | → `4448ce4` |

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/epage/_rust).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My45NC4xIiwidXBkYXRlZEluVmVyIjoiNDMuOTQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants