v8/test/inspector/debugger/breakpoints-expected.txt
Benedikt Meurer d821a6a373 [inspector] Fix mapping between location and offset.
We weren't really translating between location (line and column number)
and source position (character offset) consistently, especially when it
came to inline <script>s. There were also inconsistencies between what
Debugger.getPossibleBreakpoints and Debugger.setBreakpointByUrl would
do.

With this CL, we are now consistently operating under the following
assumptions:

(1) For inline <scripts>s with a //@ sourceURL annotation, we assume
    that the line and column number that comes in via the protocol is
    in terms of the source text of the script.
(2) For inline <script>s without said annotation, we assume that the
    line and column numbers are in terms of the surrounding document.

This is finally aligned with how the DevTools front-end operates.

Fixed: chromium:1319828
Change-Id: I98c4ef04b34a97caf060ff4f32690b135edb6ee6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3610622
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80292}
2022-05-02 06:33:54 +00:00

67 lines
1.2 KiB
Plaintext

Checks breakpoints.
Running test: testRemoveBreakpoint
Debugger.removeBreakpoint when agent is disabled:
{
error : {
code : -32000
message : Debugger agent is not enabled
}
id : <messageId>
}
Remove breakpoint with invalid breakpoint id:
{
id : <messageId>
result : {
}
}
{
id : <messageId>
result : {
}
}
Running test: testSetBreakpointByUrl
Adding conditional (arg === 1) breakpoint
evaluating foo1(0):
not paused
evaluating foo1(1):
hit expected breakpoint
Evaluating another script with the same url
evaluating foo2(0):
not paused
evaluating foo2(1):
hit expected breakpoint
Removing breakpoint
evaluating foo1(1):
not paused
evaluating foo2(1):
not paused
Adding breakpoint back
evaluating foo1(0):
not paused
evaluating foo1(1):
hit expected breakpoint
Disabling debugger agent
evaluating foo1(1):
not paused
evaluating foo2(1):
not paused
Enabling debugger agent
evaluating foo1(1):
not paused
evaluating foo2(1):
not paused
Running test: testSetBreakpointInScriptsWithDifferentOffsets
Adding breakpoint
evaluating foo1(0):
hit expected breakpoint
evaluating foo2(0):
hit expected breakpoint