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

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 1500933002: [debugger] fix debug-evaluate wrt shadowed context var. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add TODO Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/debug/debug-evaluate.h" 9 #include "src/debug/debug-evaluate.h"
10 #include "src/debug/debug-frames.h" 10 #include "src/debug/debug-frames.h"
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // 1: Scope object 835 // 1: Scope object
836 RUNTIME_FUNCTION(Runtime_GetAllScopesDetails) { 836 RUNTIME_FUNCTION(Runtime_GetAllScopesDetails) {
837 HandleScope scope(isolate); 837 HandleScope scope(isolate);
838 DCHECK(args.length() == 3 || args.length() == 4); 838 DCHECK(args.length() == 3 || args.length() == 4);
839 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]); 839 CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
840 RUNTIME_ASSERT(isolate->debug()->CheckExecutionState(break_id)); 840 RUNTIME_ASSERT(isolate->debug()->CheckExecutionState(break_id));
841 841
842 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1); 842 CONVERT_SMI_ARG_CHECKED(wrapped_id, 1);
843 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]); 843 CONVERT_NUMBER_CHECKED(int, inlined_jsframe_index, Int32, args[2]);
844 844
845 bool ignore_nested_scopes = false; 845 ScopeIterator::Option option = ScopeIterator::DEFAULT;
846 if (args.length() == 4) { 846 if (args.length() == 4) {
847 CONVERT_BOOLEAN_ARG_CHECKED(flag, 3); 847 CONVERT_BOOLEAN_ARG_CHECKED(flag, 3);
848 ignore_nested_scopes = flag; 848 if (flag) option = ScopeIterator::IGNORE_NESTED_SCOPES;
849 } 849 }
850 850
851 // Get the frame where the debugging is performed. 851 // Get the frame where the debugging is performed.
852 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id); 852 StackFrame::Id id = DebugFrameHelper::UnwrapFrameId(wrapped_id);
853 JavaScriptFrameIterator frame_it(isolate, id); 853 JavaScriptFrameIterator frame_it(isolate, id);
854 JavaScriptFrame* frame = frame_it.frame(); 854 JavaScriptFrame* frame = frame_it.frame();
855 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate); 855 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
856 856
857 List<Handle<JSObject> > result(4); 857 List<Handle<JSObject> > result(4);
858 ScopeIterator it(isolate, &frame_inspector, ignore_nested_scopes); 858 ScopeIterator it(isolate, &frame_inspector, option);
859 for (; !it.Done(); it.Next()) { 859 for (; !it.Done(); it.Next()) {
860 Handle<JSObject> details; 860 Handle<JSObject> details;
861 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, details, 861 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, details,
862 it.MaterializeScopeDetails()); 862 it.MaterializeScopeDetails());
863 result.Add(details); 863 result.Add(details);
864 } 864 }
865 865
866 Handle<FixedArray> array = isolate->factory()->NewFixedArray(result.length()); 866 Handle<FixedArray> array = isolate->factory()->NewFixedArray(result.length());
867 for (int i = 0; i < result.length(); ++i) { 867 for (int i = 0; i < result.length(); ++i) {
868 array->set(i, *result[i]); 868 array->set(i, *result[i]);
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 return Smi::FromInt(isolate->debug()->is_active()); 1701 return Smi::FromInt(isolate->debug()->is_active());
1702 } 1702 }
1703 1703
1704 1704
1705 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1705 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1706 UNIMPLEMENTED(); 1706 UNIMPLEMENTED();
1707 return NULL; 1707 return NULL;
1708 } 1708 }
1709 } // namespace internal 1709 } // namespace internal
1710 } // namespace v8 1710 } // namespace v8
OLDNEW
« src/ast/scopes.h ('K') | « src/debug/debug-scopes.cc ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698