| Index: test/cctest/wasm/test-wasm-stack.cc
|
| diff --git a/test/cctest/wasm/test-wasm-stack.cc b/test/cctest/wasm/test-wasm-stack.cc
|
| index 88ca03dd93eb703258ff9c8936f5d42b73117ce3..b36b2c309acd8b9f984615a52ea3858d670ae49e 100644
|
| --- a/test/cctest/wasm/test-wasm-stack.cc
|
| +++ b/test/cctest/wasm/test-wasm-stack.cc
|
| @@ -23,10 +23,11 @@ namespace {
|
| do { \
|
| const char* exp_ = (exp); \
|
| const char* found_ = (found); \
|
| - if (V8_UNLIKELY(strcmp(exp_, found_) != 0)) { \
|
| + DCHECK_NOT_NULL(exp); \
|
| + if (V8_UNLIKELY(found_ == nullptr || strcmp(exp_, found_) != 0)) { \
|
| V8_Fatal(__FILE__, __LINE__, \
|
| "Check failed: (%s) != (%s) ('%s' vs '%s').", #exp, #found, \
|
| - exp_, found_); \
|
| + exp_, found_ ? found_ : "<null>"); \
|
| } \
|
| } while (0)
|
|
|
| @@ -34,12 +35,18 @@ void PrintStackTrace(v8::Local<v8::StackTrace> stack) {
|
| printf("Stack Trace (length %d):\n", stack->GetFrameCount());
|
| for (int i = 0, e = stack->GetFrameCount(); i != e; ++i) {
|
| v8::Local<v8::StackFrame> frame = stack->GetFrame(i);
|
| - v8::Local<v8::String> script = frame->GetScriptName();
|
| v8::Local<v8::String> func = frame->GetFunctionName();
|
| - printf("[%d] (%s) %s:%d:%d\n", i,
|
| - script.IsEmpty() ? "<null>" : *v8::String::Utf8Value(script),
|
| - func.IsEmpty() ? "<null>" : *v8::String::Utf8Value(func),
|
| - frame->GetLineNumber(), frame->GetColumn());
|
| + if (frame->IsWasm()) {
|
| + printf("[%d] (<WASM>) %s:%d\n", i,
|
| + func.IsEmpty() ? "<null>" : *v8::String::Utf8Value(func),
|
| + frame->GetWasmByteOffset());
|
| + } else {
|
| + v8::Local<v8::String> script = frame->GetScriptName();
|
| + printf("[%d] (%s) %s:%d:%d\n", i,
|
| + script.IsEmpty() ? "<null>" : *v8::String::Utf8Value(script),
|
| + func.IsEmpty() ? "<null>" : *v8::String::Utf8Value(func),
|
| + frame->GetLineNumber(), frame->GetColumn());
|
| + }
|
| }
|
| }
|
|
|
| @@ -108,10 +115,10 @@ TEST(CollectDetailedWasmStack_ExplicitThrowFromJs) {
|
|
|
| // Line number is 1-based, with 0 == kNoLineNumberInfo.
|
| ExceptionInfo expected_exceptions[] = {
|
| - {"a", 3}, // Comment to prevent clang-format complaints
|
| - {"js", 4}, // -
|
| - {"<WASM>", 0}, // -
|
| - {"<WASM>", 0}, // -
|
| + {"a", 3}, // Prevent clang-format changes.
|
| + {"js", 4}, // -
|
| + {"<WASM UNNAMED>", 0}, // -
|
| + {"<WASM UNNAMED>", 0}, // -
|
| {"callFn", 1}};
|
| CheckExceptionInfos(isolate, maybe_exc.ToHandleChecked(),
|
| expected_exceptions);
|
| @@ -152,8 +159,8 @@ TEST(CollectDetailedWasmStack_WasmError) {
|
|
|
| // Line number is 1-based, with 0 == kNoLineNumberInfo.
|
| ExceptionInfo expected_exceptions[] = {
|
| - {"<WASM>", 0}, // Comment to prevent clang-format complaints.
|
| - {"<WASM>", 0},
|
| + {"exec_unreachable", 0}, // Prevent clang-format changes.
|
| + {"call_exec_unreachable", 0}, // -
|
| {"callFn", 1}};
|
| CheckExceptionInfos(isolate, maybe_exc.ToHandleChecked(),
|
| expected_exceptions);
|
|
|