Closed
Description
Followup of #38165.
The current behaviour is to maintain a blacklist of frames to remove from the backtrace. This poses problems in portability and accuracy. For example, the bottom of the backtrace is not cleaned when the panic is in a test or an other thread.
I propose that just before calling the user main/test/closure, the calling code would capture a backtrace. Then, on panic, the frames present is the backtrace pre and post panic would be removed. That way, no need to have a big whitelist. Some small post-processing may be needed to remove some additional frames.
A few questions:
- Is
__rust_maybe_catch_panic
used on all the platforms? If so, it could be used as a basis for this technique, since it's used for tests, the main thread and the secondary threads.
Metadata
Metadata
Assignees
Labels
No labels