- /*
- * We use top_exception_frame rather than cur_stack_end
- * to elide the last few (boring) stack entries at the
- * bottom of the backtrace.
+ if (!VirtualQuery(&stack_memory, &stack_memory, sizeof(stack_memory))) {
+ fprintf(stderr, "VirtualQuery: 0x%lx.\n", GetLastError());
+ lose("Could not query stack memory information.");
+ }
+ cur_stack_start = stack_memory.AllocationBase;
+
+ /* We use top_exception_frame rather than cur_stack_end to
+ * elide the last few (boring) stack entries at the bottom of
+ * the backtrace.