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

Unified Diff: src/debug/debug.cc

Issue 2626253002: [wasm] Set and store breakpoints in wasm (Closed)
Patch Set: Remove CheckBreakPoints methods Created 3 years, 11 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 | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 5cb9c6f8b2d554fc7e096a915f881bafe42390c7..ac2c99eba1c612cc153d83d91a2b4d51957583c2 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -29,6 +29,7 @@
#include "src/messages.h"
#include "src/snapshot/natives.h"
#include "src/wasm/wasm-module.h"
+#include "src/wasm/wasm-objects.h"
#include "include/v8-debug.h"
@@ -516,30 +517,18 @@ void Debug::Break(JavaScriptFrame* frame) {
// Postpone interrupt during breakpoint processing.
PostponeInterruptsScope postpone(isolate_);
- // Return if we fail to retrieve debug info for javascript frames.
- if (frame->is_java_script()) {
- JavaScriptFrame* js_frame = JavaScriptFrame::cast(frame);
-
- // Get the debug info (create it if it does not exist).
- Handle<JSFunction> function(js_frame->function());
- Handle<SharedFunctionInfo> shared(function->shared());
- if (!EnsureDebugInfo(shared, function)) return;
- }
+ // Return if we fail to retrieve debug info.
+ Handle<JSFunction> function(frame->function());
+ Handle<SharedFunctionInfo> shared(function->shared());
+ if (!EnsureDebugInfo(shared, function)) return;
BreakLocation location = BreakLocation::FromFrame(frame);
// Find actual break points, if any, and trigger debug break event.
MaybeHandle<FixedArray> break_points_hit;
- if (!break_points_active()) {
- // Don't try to find hit breakpoints.
- } else if (frame->is_wasm_interpreter_entry()) {
- // TODO(clemensh): Find hit breakpoints for wasm.
- UNIMPLEMENTED();
- } else {
+ if (break_points_active()) {
// Get the debug info, which must exist if we reach here.
- Handle<DebugInfo> debug_info(
- JavaScriptFrame::cast(frame)->function()->shared()->GetDebugInfo(),
- isolate_);
+ Handle<DebugInfo> debug_info(shared->GetDebugInfo(), isolate_);
break_points_hit = CheckBreakPoints(debug_info, &location);
}
@@ -722,9 +711,12 @@ bool Debug::SetBreakPointForScript(Handle<Script> script,
int* source_position,
BreakPositionAlignment alignment) {
if (script->type() == Script::TYPE_WASM) {
- // TODO(clemensh): set breakpoint for wasm.
- return false;
+ Handle<WasmCompiledModule> compiled_module(
+ WasmCompiledModule::cast(script->wasm_compiled_module()), isolate_);
+ return WasmCompiledModule::SetBreakPoint(compiled_module, source_position,
+ break_point_object);
}
+
HandleScope scope(isolate_);
// Obtain shared function info for the function.
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698