Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1264)

Unified Diff: src/wasm/wasm-debug.cc

Issue 2063013004: [wasm] Disassemble wasm code from script (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-frame-inspection
Patch Set: remove unimplemented wasm SetBreakPoint method Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | test/mjsunit/wasm/debug-disassembly.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-debug.cc
diff --git a/src/wasm/wasm-debug.cc b/src/wasm/wasm-debug.cc
index bbdf985219022ce4f9c0a7d9854e3041b7b14e26..f1b01593cf437415f2d4143af5e03734149a2851 100644
--- a/src/wasm/wasm-debug.cc
+++ b/src/wasm/wasm-debug.cc
@@ -120,11 +120,6 @@ JSObject *WasmDebugInfo::wasm_object() {
return JSObject::cast(get(kWasmDebugInfoWasmObj));
}
-bool WasmDebugInfo::SetBreakPoint(int byte_offset) {
- // TODO(clemensh): Implement this.
- return false;
-}
-
Script *WasmDebugInfo::GetFunctionScript(Handle<WasmDebugInfo> debug_info,
int func_index) {
Isolate *isolate = debug_info->GetIsolate();
@@ -149,6 +144,16 @@ Script *WasmDebugInfo::GetFunctionScript(Handle<WasmDebugInfo> debug_info,
scripts->set(func_index, *script);
script->set_type(Script::TYPE_WASM);
+ script->set_wasm_object(debug_info->wasm_object());
+ script->set_wasm_function_index(func_index);
+
+ int hash = 0;
+ debug_info->get(kWasmDebugInfoWasmBytesHash)->ToInt32(&hash);
+ char buffer[32];
+ SNPrintF(ArrayVector(buffer), "wasm://%08x/%d", hash, func_index);
+ Handle<String> source_url =
+ isolate->factory()->NewStringFromAsciiChecked(buffer, TENURED);
+ script->set_source_url(*source_url);
int func_bytes_len =
GetFunctionOffsetAndLength(debug_info, func_index).second;
@@ -157,7 +162,7 @@ Script *WasmDebugInfo::GetFunctionScript(Handle<WasmDebugInfo> debug_info,
line_ends->set_map(isolate->heap()->fixed_cow_array_map());
script->set_line_ends(*line_ends);
- // TODO(clemensh): Register this new script at the debugger.
+ isolate->debug()->OnAfterCompile(script);
return *script;
}
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | test/mjsunit/wasm/debug-disassembly.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698