Skip to content

Commit 3516f35

Browse files
cristiancavalliMylesBorins
authored andcommitted
deps: backport 7c3748a from upstream V8
Original commit message: [debug] 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: #10873 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
1 parent 10e3092 commit 3516f35

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

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 4
1212
#define V8_MINOR_VERSION 5
1313
#define V8_BUILD_NUMBER 103
14-
#define V8_PATCH_LEVEL 45
14+
#define V8_PATCH_LEVEL 46
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

+2-1
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
670670
// Use the value from the stack.
671671
if (scope_info->LocalIsSynthetic(i)) continue;
672672
locals->set(local * 2, scope_info->LocalName(i));
673-
locals->set(local * 2 + 1, frame_inspector.GetExpression(i));
673+
locals->set(local * 2 + 1,
674+
frame_inspector.GetExpression(scope_info->StackLocalIndex(i)));
674675
local++;
675676
}
676677
if (local < local_count) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
'use strict';
8+
var Debug = debug.Debug;
9+
10+
function listener(event, exec_state, event_data, data) {
11+
assertEquals(2, exec_state.frameCount());
12+
assertEquals("a", exec_state.frame(0).localName(0));
13+
assertEquals("1", exec_state.frame(0).localValue(0).value());
14+
assertEquals(1, exec_state.frame(0).localCount());
15+
}
16+
17+
Debug.setListener(listener);
18+
19+
function f() {
20+
var a = 1;
21+
{
22+
let b = 2;
23+
debugger;
24+
}
25+
}
26+
27+
f();

0 commit comments

Comments
 (0)