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

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

Issue 2069823003: [wasm] Enable wasm frame inspection for debugging (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@split-wasm-debug
Patch Set: Add two DCHECKs 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/debug/debug-scopes.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-scopes.cc
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc
index 68abfd3a98e903406275d70c8c7c7cf51b6f885a..82fd1937ba2afb6b961a887cce32a2e6a4cfb368 100644
--- a/src/debug/debug-scopes.cc
+++ b/src/debug/debug-scopes.cc
@@ -22,14 +22,16 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
nested_scope_chain_(4),
seen_script_scope_(false),
failed_(false) {
- if (!frame_inspector->GetContext()->IsContext() ||
- !frame_inspector->GetFunction()->IsJSFunction()) {
+ if (!frame_inspector->GetContext()->IsContext()) {
// Optimized frame, context or function cannot be materialized. Give up.
return;
}
context_ = Handle<Context>::cast(frame_inspector->GetContext());
+ // We should not instantiate a ScopeIterator for wasm frames.
+ DCHECK(frame_inspector->GetScript()->type() != Script::TYPE_WASM);
+
// Catch the case when the debugger stops in an internal function.
Handle<JSFunction> function = GetFunction();
Handle<SharedFunctionInfo> shared_info(function->shared());
@@ -614,9 +616,9 @@ bool ScopeIterator::SetParameterValue(Handle<ScopeInfo> scope_info,
}
bool ScopeIterator::SetStackVariableValue(Handle<ScopeInfo> scope_info,
- JavaScriptFrame* frame,
Handle<String> variable_name,
Handle<Object> new_value) {
+ JavaScriptFrame* frame = GetFrame();
// Setting stack locals of optimized frames is not supported.
if (frame->is_optimized()) return false;
HandleScope scope(isolate_);
@@ -672,7 +674,7 @@ bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name,
bool result = SetParameterValue(scope_info, frame, variable_name, new_value);
// Stack locals.
- if (SetStackVariableValue(scope_info, frame, variable_name, new_value)) {
+ if (SetStackVariableValue(scope_info, variable_name, new_value)) {
return true;
}
@@ -690,10 +692,9 @@ bool ScopeIterator::SetInnerScopeVariableValue(Handle<String> variable_name,
Handle<ScopeInfo> scope_info = CurrentScopeInfo();
DCHECK(scope_info->scope_type() == BLOCK_SCOPE ||
scope_info->scope_type() == EVAL_SCOPE);
- JavaScriptFrame* frame = GetFrame();
// Setting stack locals of optimized frames is not supported.
- if (SetStackVariableValue(scope_info, frame, variable_name, new_value)) {
+ if (SetStackVariableValue(scope_info, variable_name, new_value)) {
return true;
}
« no previous file with comments | « src/debug/debug-scopes.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698