Skip to content

Commit 8b82ed0

Browse files
cristiancavalliMylesBorins
authored andcommitted
deps: backport 7c3748a from upstream V8
Original commit message: load correct stack slot for frame details. [email protected] BUG=v8:5071 Review URL: https://codereview.chromium.org/2045863002 . Cr-Commit-Position: refs/heads/master@{#36769} PR-URL: #10881 Reviewed-By: Myles Borins <[email protected]>
1 parent 51d62f7 commit 8b82ed0

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 1
1313
#define V8_BUILD_NUMBER 281
14-
#define V8_PATCH_LEVEL 92
14+
#define V8_PATCH_LEVEL 93
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/runtime/runtime-debug.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
584584
// Use the value from the stack.
585585
if (scope_info->LocalIsSynthetic(i)) continue;
586586
locals->set(local * 2, scope_info->LocalName(i));
587-
Handle<Object> value = frame_inspector.GetExpression(i);
587+
Handle<Object> value =
588+
frame_inspector.GetExpression(scope_info->StackLocalIndex(i));
588589
// TODO(yangguo): We convert optimized out values to {undefined} when they
589590
// are passed to the debugger. Eventually we should handle them somehow.
590591
if (value->IsOptimizedOut()) value = isolate->factory()->undefined_value();
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2016 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --expose-debug-as debug
6+
7+
var Debug = debug.Debug;
8+
9+
function listener(event, exec_state, event_data, data) {
10+
assertEquals(2, exec_state.frameCount());
11+
assertEquals("a", exec_state.frame(0).localName(0));
12+
assertEquals("1", exec_state.frame(0).localValue(0).value());
13+
assertEquals(1, exec_state.frame(0).localCount());
14+
}
15+
16+
Debug.setListener(listener);
17+
18+
function f() {
19+
var a = 1;
20+
{
21+
let b = 2;
22+
debugger;
23+
}
24+
}
25+
26+
f();

0 commit comments

Comments
 (0)