Skip to content

Commit

Permalink
deps: backport 7c3748a from upstream V8
Browse files Browse the repository at this point in the history
Original commit message:
  [debug] 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}

Signed-off-by: Cristian Cavalli <[email protected]>
  • Loading branch information
cristiancavalli committed Feb 8, 2017
1 parent 8eeccd8 commit 6f5c421
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 103
#define V8_PATCH_LEVEL 45
#define V8_PATCH_LEVEL 46

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/runtime/runtime-debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
// Use the value from the stack.
if (scope_info->LocalIsSynthetic(i)) continue;
locals->set(local * 2, scope_info->LocalName(i));
locals->set(local * 2 + 1, frame_inspector.GetExpression(i));
locals->set(local * 2 + 1,
frame_inspector.GetExpression(scope_info->StackLocalIndex(i)));
local++;
}
if (local < local_count) {
Expand Down
27 changes: 27 additions & 0 deletions deps/v8/test/mjsunit/regress/regress-5071.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Flags: --expose-debug-as debug

'use strict';
var Debug = debug.Debug;

function listener(event, exec_state, event_data, data) {
assertEquals(2, exec_state.frameCount());
assertEquals("a", exec_state.frame(0).localName(0));
assertEquals("1", exec_state.frame(0).localValue(0).value());
assertEquals(1, exec_state.frame(0).localCount());
}

Debug.setListener(listener);

function f() {
var a = 1;
{
let b = 2;
debugger;
}
}

f();

0 comments on commit 6f5c421

Please sign in to comment.