Repository navigation
Commit 45a6cff
authored
Map code without a DWARF line to no location in wasm source maps (#28033)
`wasm-sourcemap.py` drops DWARF rows with line 0, which LLVM uses for
code that does not come from a single source line, for example when it
merges several calls to `abort()` into one. The previous mapping then
covers that code too, so it is reported at an unrelated line.
This writes an entry with only the wasm offset at these rows instead. An
entry without a source location ends the previous mapping, so the code
gets no location. Binaryen does the same when it writes source maps
(WebAssembly/binaryen#5906): one such entry for each run of code without
a location, and none before the first mapping. Binaryen and emsymbolizer
already read these entries. When this tool was written, Binaryen could
not, which is likely why the rows were dropped.
Each entry adds about two bytes. The new test checks that code at line 0
maps to no location and that consecutive line 0 rows share one entry.1 parent 1c31a61 commit 45a6cff
3 files changed
Lines changed: 47 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10112 | 10112 | | |
10113 | 10113 | | |
10114 | 10114 | | |
| 10115 | + | |
| 10116 | + | |
| 10117 | + | |
| 10118 | + | |
| 10119 | + | |
| 10120 | + | |
| 10121 | + | |
| 10122 | + | |
| 10123 | + | |
| 10124 | + | |
| 10125 | + | |
| 10126 | + | |
| 10127 | + | |
| 10128 | + | |
| 10129 | + | |
| 10130 | + | |
| 10131 | + | |
| 10132 | + | |
| 10133 | + | |
| 10134 | + | |
| 10135 | + | |
| 10136 | + | |
| 10137 | + | |
| 10138 | + | |
| 10139 | + | |
| 10140 | + | |
| 10141 | + | |
| 10142 | + | |
| 10143 | + | |
| 10144 | + | |
| 10145 | + | |
| 10146 | + | |
| 10147 | + | |
| 10148 | + | |
| 10149 | + | |
10115 | 10150 | | |
10116 | 10151 | | |
10117 | 10152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
| |||
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
553 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
554 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
555 | 563 | | |
| 564 | + | |
556 | 565 | | |
557 | 566 | | |
558 | 567 | | |
| |||
0 commit comments