Skip to content

Commit f3b7408

Browse files
cristiancavalliMylesBorins
authored andcommitted
deps: backport 7c3748a from upstream V8
Original commit message: load correct stack slot for frame details. R=bmeurer@chromium.org BUG=v8:5071 Review URL: https://codereview.chromium.org/2045863002 . Cr-Commit-Position: refs/heads/master@{#36769} PR-URL: #10881 Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent 6d3f82c commit f3b7408

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

Diff for: deps/v8/include/v8-version.h

+1-1
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.)

Diff for: deps/v8/src/runtime/runtime-debug.cc

+2-1
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();

Diff for: deps/v8/test/mjsunit/regress/regress-5071.js

+26
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)