Closed
Description
There are a number of locations where it would be really nice if we had some very simple support for backtraces. By simple I just mean the ability to know the name of the function and possibly the instruction pointer inside the function.
Some possible use case:
- Traces for each gc allocation (the old C++ managed box allocator did this)
- Stack trace printing on failure
- Less codegen bloat from failure functions that pass around file/line number. (function name isn't equivalent, but maybe sufficient?)
This is obviously a tricky thing to do, and I don't think that we should bring in libunwind for just this (it's pretty simple), but it appears that each platform has their own solution for acquiring a simple backtrace, and we can take the least common denominator of all of them:
This would probably be a module in std::unstable
like the way dynamic_lib
is a module. This isn't really a high priority, but it would certainly be something nice to have!