In compiler-rt we have the notion of a fast and a slow stack
unwinder. Darwin currently only supports the fast unwinder.
From reading the code, my understanding is that
BufferedStackTrace::Unwind can be called with `bp=0, stack_top=0,
stack_bottom=0, request_fast_unwind=false`. If
request_fast_unwind=true, then we alos need to supply bp, stack_top,
and stack_bottom.
However, BufferedStackTrace::Unwind uses
StackTrace::WillUseFastUnwind which will adapt request_fast_unwind
if the requested unwinder is not supported. On Darwin, the result is
that we don't pass actual values for bp, stack_top, and stack_bottom,
but end up using the fast unwinder. The tests then fail because we only
print the topmost stack frame.
This patch adds a check to WillUseFastUnwind at the point of usage to
avoid the mismatch between request_fast_unwind and what Unwind
actually does. I am also interested in cleaning up the
request_fast_unwind machinery in general so this patch is just the simplest thing
possible so I can enable the tests.