0
Files
src/gin/debug_impl.h
Paolo Severini fb4ab3be3f V8 x64 backend doesn't emit ABI compliant stack frames
On 64 bit Windows, stack walking does not work across stack frames generated
by V8 because the V8 x64 backend doesn't emit unwinding info and because it does
not emi ABI compliant stack frames. (bug v8:3598).
This should be fixed with this CL:
https://chromium-review.googlesource.com/c/v8/v8/+/1469329

The fix consists in having V8 register dynamically PDATA/XDATA for the whole
code-range address space of an isolate every time a new isolate is initialized,
and unregister them when the Isolate is destroyed.
A more detailed description of the V8 fix can be found here:
https://docs.google.com/document/d/1-wf50jFlii0c_Pr52lm2ZU-49m220nhYMrHDi3vXnh0/edit

This V8 changes are currently experimental, behind the v8_win64_unwinding_info
build flag and the '--win64-unwinding-info' command line flag.

However Crashpad already registers PDATA/XDATA for the code range of a V8
isolate, in order to be able to handle and report unhandled exceptions that have
V8 dynamic code in the call stack. For more details, see:
9b32bb22c1

Since it is not possible to register multiple PDATA entries for the same
address range, a new functions has been added to the V8 API:
- SetUnhandledExceptionCallback() can be used by an embedder to register its
own unhandled exception handler for exceptions that arise in V8-generated code.

This CL contains a few small changes to use this updated V8 API:
Crashpad calls v8::Isolate::SetUnhandledExceptionCallback() to register its own
custom exception handler for V8-code.
- When the '--win64-unwinding-info' flag is set, V8 will register the specified
exception handler as part of the Win64 unwind info, for jitted code and for
embedded builtins code.
- When the '--win64-unwinding-info' flag is not set, V8 will still register the
specified exception handler (but no precise unwind data) for the code range of
jitted code only, as Crashpad currently does.

Bug: v8:3598
Change-Id: Iba4a724a04a3bc3420c986d3e3b22f3b4aea279a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1474703
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Paolo Severini <paolosev@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#651075}
2019-04-16 00:17:49 +00:00

21 lines
455 B
C++

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef GIN_PUBLIC_DEBUG_IMPL_H_
#define GIN_PUBLIC_DEBUG_IMPL_H_
#include "gin/public/debug.h"
#include "v8/include/v8.h"
namespace gin {
class DebugImpl {
public:
static v8::JitCodeEventHandler GetJitCodeEventHandler();
};
} // namespace gin
#endif // GIN_PUBLIC_DEBUG_IMPL_H_