Commit 9937d0c4 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[asm.js] Fix debugger test to check listener exception.

R=clemensh@chromium.org
BUG=v8:6127

Change-Id: Id77e8eef3ad909608a5d32fa7373077540e201c7
Reviewed-on: https://chromium-review.googlesource.com/461824Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44223}
parent da5b745d
...@@ -12,9 +12,6 @@ var break_count; ...@@ -12,9 +12,6 @@ var break_count;
var num_wasm_scripts; var num_wasm_scripts;
var module; var module;
var filename = '(?:[^ ]+/)?test/mjsunit/wasm/asm-debug.js';
filename = filename.replace(/\//g, '[/\\\\]');
var expected_stack_entries = []; var expected_stack_entries = [];
function listener(event, exec_state, event_data, data) { function listener(event, exec_state, event_data, data) {
...@@ -28,16 +25,11 @@ function listener(event, exec_state, event_data, data) { ...@@ -28,16 +25,11 @@ function listener(event, exec_state, event_data, data) {
print('Stack Trace (length ' + num_frames + '):'); print('Stack Trace (length ' + num_frames + '):');
for (var i = 0; i < num_frames; ++i) { for (var i = 0; i < num_frames; ++i) {
var frame = exec_state.frame(i); var frame = exec_state.frame(i);
var script = frame.script(); var line = frame.sourceLine();
assertNotNull(script);
var line = frame.sourceLine() + 1;
var column = frame.sourceColumn() + 1; var column = frame.sourceColumn() + 1;
var funcName = frame.func().name(); var funcName = frame.func().name();
var name = script.name();
print( print(
' [' + i + '] ' + funcName + ' (' + name + ':' + line + ':' + ' [' + i + '] ' + funcName + ' (' + line + ':' + column + ')');
column + ')');
assertMatches(filename, name, 'name');
assertEquals( assertEquals(
expected_stack_entries[i][0], funcName, 'function name at ' + i); expected_stack_entries[i][0], funcName, 'function name at ' + i);
assertEquals(expected_stack_entries[i][1], line, 'line at ' + i); assertEquals(expected_stack_entries[i][1], line, 'line at ' + i);
...@@ -76,14 +68,15 @@ function setup() { ...@@ -76,14 +68,15 @@ function setup() {
var fun = var fun =
generateWasmFromAsmJs(this, {'call_debugger': call_debugger}, undefined); generateWasmFromAsmJs(this, {'call_debugger': call_debugger}, undefined);
expected_stack_entries = [ expected_stack_entries = [
['call_debugger', 66, 3], // -- ['call_debugger', 58, 3], // --
['callDebugger', 57, 5], // -- ['callDebugger', 49, 5], // --
['redirectFun', 60, 5], // -- ['redirectFun', 52, 5], // --
['FrameInspection', 86, 3], // -- ['FrameInspection', 78, 3], // --
['', 89, 3] ['', 82, 3]
]; ];
Debug.setListener(listener); Debug.setListener(listener);
fun(); fun();
Debug.setListener(null); Debug.setListener(null);
assertEquals(1, break_count); assertEquals(1, break_count);
if (exception) throw exception;
})(); })();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment