forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: We are currently very strict about breakpoint location matching. This diff allows some fuzz in the column, but not in the line. Changelog: [Internal] Setting Hermes breakpoints no longer requires exact column match Reviewed By: avp Differential Revision: D21343198 fbshipit-source-id: a59786a9d63f9fe1ed576835ed660ba3343affe1
- Loading branch information
1 parent
292a2b1
commit 4e1a14b
Showing
5 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: %hdb --break-at-start %s < %s.debug | %FileCheck --match-full-lines %s | ||
// REQUIRES: debugger | ||
|
||
function foo() { | ||
print('first'); | ||
print('second'); print('third'); print("fourth"); | ||
print('fifth'); print('sixth'); | ||
} | ||
|
||
function bar() { | ||
foo(); | ||
} | ||
|
||
bar(); | ||
// CHECK-LABEL: Break on script load {{.+}} | ||
|
||
// column=1 is before all statements. Match the first. | ||
// CHECK-NEXT: Set breakpoint 1 at {{.+}}:12:3 | ||
|
||
// column=22 is the middle of the 'third' print. Match that. | ||
// CHECK-NEXT: Set breakpoint 2 at {{.+}}:13:20 | ||
|
||
// column=200 is after all statements. Match the last. | ||
// CHECK-NEXT: Set breakpoint 3 at {{.+}}:14:24 | ||
|
||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: Break on breakpoint 1 in foo: {{.+}}:12:3 | ||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: first | ||
// CHECK-NEXT: second | ||
// CHECK-NEXT: Break on breakpoint 2 in foo: {{.+}}:13:20 | ||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: third | ||
// CHECK-NEXT: fourth | ||
// CHECK-NEXT: fifth | ||
// CHECK-NEXT: Break on breakpoint 3 in foo: {{.+}}:14:24 | ||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: sixth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
break 12 1 | ||
break 13 22 | ||
break 14 200 | ||
continue | ||
continue | ||
continue | ||
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: %hdb --lazy %s < %s.debug | %FileCheck --match-full-lines %s | ||
// REQUIRES: debugger | ||
|
||
// @nolint | ||
function foo() { print('foo called'); /** * Some text to pad out the function so that it won't be eagerly compiled * for being too short. Lorem ipsum dolor sit amet, consectetur adipiscing * elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. */ function bar() { print('bar called'); /** * Some text to pad out the function so that it won't be eagerly compiled * for being too short. Lorem ipsum dolor sit amet, consectetur adipiscing * elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. */ } function baz() { print('baz called'); /** * Some text to pad out the function so that it won't be eagerly compiled * for being too short. Lorem ipsum dolor sit amet, consectetur adipiscing * elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. */ }; bar(); baz(); } | ||
|
||
debugger; | ||
foo(); | ||
|
||
/* This test verifies that you can set breakpoints in uncompiled | ||
* functions, without fuzzy column matching accidentally resolving the | ||
* breakpoint to the closest already-compiled instruction it can find. | ||
* This comes up when debugging minified source with source maps. | ||
*/ | ||
|
||
// CHECK: Break on 'debugger' statement in global: {{.*}}:14:1 | ||
|
||
// Breakpoint is in the middle of the 'print' for 'bar called' | ||
// CHECK-NEXT: Set breakpoint 1 at {{.*}}:12:286 | ||
// Breakpoint is in the middle of the 'print' for 'baz called' | ||
// CHECK-NEXT: Set breakpoint 2 at {{.*}}:12:556 | ||
|
||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: foo called | ||
// CHECK-NEXT: Break on breakpoint 1 in bar: {{.*}}:12:286 | ||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: bar called | ||
// CHECK-NEXT: Break on breakpoint 2 in baz: {{.*}}:12:556 | ||
// CHECK-NEXT: Continuing execution | ||
// CHECK-NEXT: baz called |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
break 12 290 | ||
break 12 560 | ||
continue | ||
continue | ||
continue |