• jgruber's avatar
    [coverage] Improve source range precision · 63a7fa5a
    jgruber authored
    This CL improves reported source range precision in a couple of ways:
    
    Source ranges are now standardized to consist of an inclusive start
    index and an exclusive end index (similar to what's reported for
    functions). For example:
    
    0123456789  // Offset.
    { f(); }    // Block represented as range {0,8}.
    
    Duplicate singleton ranges (i.e. same start and end offsets) are now
    merged (this only becomes relevant once jump statement coverage is
    added). For example:
    
    for (.) break;  // Break- and loop continuation have same positions.
    
    SourceRangeScope incorrectly collected starting position
    (unconditionally) and end position (when no semi-colon was present).
    
    01234567890123  // Offset.
    for (.) break   // Loop body range is {8,13}, was {6,9}.
    
    Bug: v8:6000
    Change-Id: I62e7c70cc894a20f318330a2fbbcedc47da2b5db
    Reviewed-on: https://chromium-review.googlesource.com/541358
    Commit-Queue: Jakob Gruber <jgruber@chromium.org>
    Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#46095}
    63a7fa5a
debug-coverage.cc 12.1 KB