Fix rare crashes in release builds on Windows with exceptions
When throwing exceptions we have a tendency to save a backtrace, using
StackWalk64 on Windows. Before we can do that stack walk, we have to
capture the current processor register state, in particular the frame pointer,
for which we call RtlCaptureContext. Almost naturally that function requires
the caller to have set up a stack frame, which may not have happened when
compiling with release flags.
As a remedy, this patch moves the code that calls RtlCaptureContext into
a separate file, which will be compiled with frame pointer optimizations
disabled.
Change-Id: I3ce53b47c4a421efeaa3e575429d85327540ca97
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>