• Ingvar Stepanyan's avatar
    [wasm] Pretend that DWARF section is a fake source map · 1b5f3be0
    Ingvar Stepanyan authored
    Unfortunately, codebase contains lots of places that use one of the two
    formats as an internal representation for Wasm locations:
    1) {line: 0, column: byte offset within entire module}
    2) {line: function index, column: byte offset within function}
    
    These places choose these formats interchangeably and convert from one
    to another depending on the presence of source map URL in Wasm.
    
    This is not very convenient and makes it hard to add support for DWARF
    which should behave just like Wasm with source maps - that is, report a
    raw Wasm script instead of fake scripts per each disassembled function,
    and use representation (1) instead of (2) internally.
    
    I tried to refactor these locations and avoid checking for source map
    URLs in the previous CL - https://crrev.com/c/v8/v8/+/1833688. However,
    it quickly got out of hand, and updating code in one place just kept
    revealing yet another that gets broken by the changes, so I made a
    decision to abandon it and leave to someone who knows the codebase
    better.
    
    Instead, this CL is based on https://crrev.com/c/v8/v8/+/1809375, but,
    rather than trying to integrate DWARF separately and only for supported
    agents, it pretends that encountering DWARF section is the same as
    encountering a `sourceMappingURL` section with fake URL "wasm://dwarf".
    
    This ensures that Wasm with DWARF behaves exactly in the same way as
    Wasm with source maps, just like we want, with minimal changes to the
    codebase. The only downside is that frontends without DWARF support
    won't get even a disassembled version of Wasm that contains DWARF info.
    This is unfortunate, but, as per previous discussions, should be fine
    given current state of Wasm debugging.
    
    Change-Id: Ia7256075e4bfd2f407d001d02b96883d7267436e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1834341
    Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64157}
    1b5f3be0
Name
Last commit
Last update
..
BUILD.gn Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
custom-preview.cc Loading commit data...
custom-preview.h Loading commit data...
injected-script.cc Loading commit data...
injected-script.h Loading commit data...
inspected-context.cc Loading commit data...
inspected-context.h Loading commit data...
inspector_protocol_config.json Loading commit data...
remote-object-id.cc Loading commit data...
remote-object-id.h Loading commit data...
search-util.cc Loading commit data...
search-util.h Loading commit data...
string-16.cc Loading commit data...
string-16.h Loading commit data...
string-util.cc Loading commit data...
string-util.h Loading commit data...
test-interface.cc Loading commit data...
test-interface.h Loading commit data...
v8-console-agent-impl.cc Loading commit data...
v8-console-agent-impl.h Loading commit data...
v8-console-message.cc Loading commit data...
v8-console-message.h Loading commit data...
v8-console.cc Loading commit data...
v8-console.h Loading commit data...
v8-debugger-agent-impl.cc Loading commit data...
v8-debugger-agent-impl.h Loading commit data...
v8-debugger-script.cc Loading commit data...
v8-debugger-script.h Loading commit data...
v8-debugger.cc Loading commit data...
v8-debugger.h Loading commit data...
v8-heap-profiler-agent-impl.cc Loading commit data...
v8-heap-profiler-agent-impl.h Loading commit data...
v8-inspector-impl.cc Loading commit data...
v8-inspector-impl.h Loading commit data...
v8-inspector-protocol-encoding.cc Loading commit data...
v8-inspector-protocol-encoding.h Loading commit data...
v8-inspector-session-impl.cc Loading commit data...
v8-inspector-session-impl.h Loading commit data...
v8-profiler-agent-impl.cc Loading commit data...
v8-profiler-agent-impl.h Loading commit data...
v8-regex.cc Loading commit data...
v8-regex.h Loading commit data...
v8-runtime-agent-impl.cc Loading commit data...
v8-runtime-agent-impl.h Loading commit data...
v8-schema-agent-impl.cc Loading commit data...
v8-schema-agent-impl.h Loading commit data...
v8-stack-trace-impl.cc Loading commit data...
v8-stack-trace-impl.h Loading commit data...
v8-string-conversions.cc Loading commit data...
v8-string-conversions.h Loading commit data...
v8-value-utils.cc Loading commit data...
v8-value-utils.h Loading commit data...
value-mirror.cc Loading commit data...
value-mirror.h Loading commit data...
wasm-translation.cc Loading commit data...
wasm-translation.h Loading commit data...