v8/test/cctest/wasm
Simon Zünd c0682832f0 [debug] Add new 'CreateMessageFromException' function
CDP has a "ExceptionDetails" structure that is attached to various
CDP commands, e.g. "Runtime#exceptionThrown" or "Runtime#evaluate".
The stack trace in the "ExceptionDetails" structure is used in
various places in DevTools. The information in the "ExceptionDetails"
structure is extracted from a v8::Message object. Message objects
are normally created at the exception throw site and may augment
the error with manually inspecting the stack (both to capture a fresh
stack trace in some cases, as well as to calculate location info).

The problem is that in some cases we want to get an "ExceptionDetails"
structure after the fact, e.g. when logging a JS "Error" object in
a catch block. This means we can't reuse Isolate::CreateMessage as
the JS stack at call time is unrelated to the time when an Error
object was thrown.

To re-use some of the code, this CL introduces a new
"CreateMessageFromException" method that is only available from the
debugging interface (not public V8 API!). The new method works
similar to Isolate::CreateMessage, but:
  1) Does not look at the current JS stack, neither for a fresh
     stack trace nor for location information.
  2) Only uses the "detailed" stack trace for location info.
     This is because the "simple" stack trace could have already
     been serialized by accessing Error#stack.

Bug: chromium:1278650
Doc: https://bit.ly/runtime-get-exception-details
Change-Id: I0144516001c71786b9f76ae4dec4442fa1468c5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3337257
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78586}
2022-01-12 12:49:53 +00:00
..
DIR_METADATA Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00
OWNERS Add DIR_METADATA files to v8. 2020-10-20 22:12:28 +00:00
test-backing-store.cc [wasm] Move test-backing-store.cc to wasm directory 2021-03-03 13:07:01 +00:00
test-c-wasm-entry.cc [ext-code-space] Migrate WasmExportedFunctionData code field to CodeT 2021-06-18 14:10:43 +00:00
test-compilation-cache.cc [wasm] Initialize memory protection key permissions 2021-12-20 13:58:33 +00:00
test-gc.cc [wasm-gc] Implement br_on_array, br_on_non_array 2022-01-12 10:48:03 +00:00
test-grow-memory.cc [base] Move utils/vector.h to base/vector.h 2021-06-18 13:33:13 +00:00
test-jump-table-assembler.cc [cleanup] Rename RelocInfo::NONE to RelocInfo::NO_INFO to fix -Wshadow 2021-11-17 19:11:40 +00:00
test-liftoff-for-fuzzing.cc Reland "[wasm] Add tests for NaN detection in Liftoff" 2021-09-14 08:41:58 +00:00
test-liftoff-inspection.cc [liftoff] Refactor options for Liftoff compilation 2021-08-04 16:48:48 +00:00
test-run-wasm-64.cc [cleanup] Fix -Wshadow warnings in cctest/wasm 2021-09-24 22:39:54 +00:00
test-run-wasm-asmjs.cc [test][cleanup] Rename WASM_*_LOCAL to WASM_LOCAL_* 2020-12-17 21:19:14 +00:00
test-run-wasm-atomics64.cc [wasm] Fix endianness issue when initializing memory 2021-11-29 19:40:57 +00:00
test-run-wasm-atomics.cc [wasm] Introduce --wasm-enforce-bounds-checks flag 2021-06-30 08:31:14 +00:00
test-run-wasm-bulk-memory.cc [wasm] Remove --experimental-wasm-reftypes flag 2021-12-13 14:29:15 +00:00
test-run-wasm-exceptions.cc [wasm] Remove --experimental-wasm-reftypes flag 2021-12-13 14:29:15 +00:00
test-run-wasm-interpreter.cc [wasm] Move misplaced DCHECK in wasm interpreter 2021-09-28 13:08:49 +00:00
test-run-wasm-js.cc [cleanup] Fix -Wshadow warnings in cctest/wasm 2021-09-24 22:39:54 +00:00
test-run-wasm-memory64.cc [wasm] Disable trap handling for memory64 2021-07-08 11:03:08 +00:00
test-run-wasm-module.cc Reland "[wasm] Add --wasm-dynamic-tiering to --future" 2021-12-14 15:06:37 +00:00
test-run-wasm-relaxed-simd.cc [riscv64] Add RISCV64 support for wasm-relaxed-simd 2022-01-10 01:40:22 +00:00
test-run-wasm-sign-extension.cc [test][cleanup] Rename WASM_*_LOCAL to WASM_LOCAL_* 2020-12-17 21:19:14 +00:00
test-run-wasm-simd-liftoff.cc [wasm] Do not enforce LE for globals and WasmValue 2021-06-10 18:08:38 +00:00
test-run-wasm-simd.cc [wasm-relaxed-simd][x64] Prototype relaxed min and max 2021-10-21 00:58:24 +00:00
test-run-wasm-wrappers.cc [ext-code-space] Avoid Code <-> CodeT conversions in runtime, pt.4 2021-12-14 18:42:55 +00:00
test-run-wasm.cc [wasm] Remove --experimental-wasm-reftypes flag 2021-12-13 14:29:15 +00:00
test-streaming-compilation.cc Reland "[wasm] Add --wasm-dynamic-tiering to --future" 2021-12-14 15:06:37 +00:00
test-wasm-breakpoints.cc [debugger] Explicitly encode debugger statements in didPause 2021-12-02 10:41:43 +00:00
test-wasm-codegen.cc [zone] Cleanup zone allocations in src/wasm and tests 2020-07-10 12:11:55 +00:00
test-wasm-import-wrapper-cache.cc [wasm] Pass and store fewer wasm engine pointers 2021-06-21 11:57:45 +00:00
test-wasm-metrics.cc Reland "[wasm] Add --wasm-dynamic-tiering to --future" 2021-12-14 15:06:37 +00:00
test-wasm-serialization.cc Reland "[wasm] Add --wasm-dynamic-tiering to --future" 2021-12-14 15:06:37 +00:00
test-wasm-shared-engine.cc [isolate][cleanup] Remove pointer to WasmEngine 2021-06-21 09:09:25 +00:00
test-wasm-stack.cc [debug] Add new 'CreateMessageFromException' function 2022-01-12 12:49:53 +00:00
test-wasm-trap-position.cc [inspector] Capture stack trace only once for JSError objects. 2022-01-10 14:55:18 +00:00
wasm-atomics-utils.h [wasm][cleanup] Using 'using' instead of 'typedef' 2019-03-29 10:20:30 +00:00
wasm-run-utils.cc [wasm] Only decode most frequent constant expressions once 2022-01-12 07:08:53 +00:00
wasm-run-utils.h [cleanup] Fix -Wshadow warnings in cctest/wasm 2021-09-24 22:39:54 +00:00
wasm-simd-utils.cc [wasm-relaxed-simd][x64] Prototype relaxed min and max 2021-10-21 00:58:24 +00:00
wasm-simd-utils.h [wasm-relaxed-simd][x64] Prototype relaxed min and max 2021-10-21 00:58:24 +00:00