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

Optionally have trait methods use track_caller to push panic information to the caller #364

Closed
zesterer opened this issue May 25, 2024 · 6 comments · Fixed by #378
Closed
Assignees
Milestone

Comments

@zesterer
Copy link

Hopefully the issue title is fairly self-explanatory. Is this a desirable feature? This could take the form of an optional track_caller feature.

@JelteF
Copy link
Owner

JelteF commented May 25, 2024

For which derives are you interested in this specifically?

@zesterer
Copy link
Author

Specifically, the operator traits (add, mul, etc.). I've got a client type that often experiences overflows in those operators, and no ability to unwind the stack on my target platform, so I end up with panic messages that point to the middle of the derive code rather than the use location.

@JelteF
Copy link
Owner

JelteF commented May 27, 2024

Ah, okay yeah that does seem annoying. I think for operators it indeed makes sense to add track_caller. Could you send a PR for that?

@JelteF
Copy link
Owner

JelteF commented May 28, 2024

To clarify I don't think this needs to be an optional feature, but can simply be done always for add and mul derives.

@zesterer
Copy link
Author

I'm not too familiar with the codebase, is there some specific location that's best to start implementing this?

@zesterer
Copy link
Author

zesterer commented Jul 7, 2024

Thanks so much for implementing this! This will make debugging fixed-point ops on embedded platforms without stack traces infinitely easier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants