You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The names section is intended to be the simplest thing possible to provide a basic source-code callstack. Currently, the names in the names section show up in Error.stack and devtools debugger callstacks. However, Error.stack and the debugger's callstacks also show filename and line number and, for lack of a better option, these are set to the URL of the JS function that compiled the wasm and the bytecode offset of the function in the wasm module. I think there's be a pretty big win, at low impl cost, to extend the names section to additionally specify filename and line number for each function as well.
Since filenames are long and there are far fewer unique filenames than functions, I think the names section should start with a sequence of filenames and then each function could index into that array.
Of course we'd like to avoid feature creep given that there are already tentative plans for something much more general to support first-class source debugger, but I think this fits pretty squarely in the scope of the names section given that it shows up in even the most basic callstack machinery.
The text was updated successfully, but these errors were encountered:
A few problems were pointed out that, to fix, would start down the slippery slope of building a mini DWARF (which I think we should avoid in preference to the vision outlined in #708). One issue is that what a callstack wants is per-callsite line numbers, not per-function. Another is that inlining makes source filenames more nuanced than simple per-function. So I'll keep the names section as-is and close this issue. It'll still be possible to add a "callstacks" section in the future (that was complementary to the names section) if need be.
The names section is intended to be the simplest thing possible to provide a basic source-code callstack. Currently, the names in the names section show up in
Error.stack
and devtools debugger callstacks. However,Error.stack
and the debugger's callstacks also show filename and line number and, for lack of a better option, these are set to the URL of the JS function that compiled the wasm and the bytecode offset of the function in the wasm module. I think there's be a pretty big win, at low impl cost, to extend the names section to additionally specify filename and line number for each function as well.Since filenames are long and there are far fewer unique filenames than functions, I think the names section should start with a sequence of filenames and then each function could index into that array.
Of course we'd like to avoid feature creep given that there are already tentative plans for something much more general to support first-class source debugger, but I think this fits pretty squarely in the scope of the names section given that it shows up in even the most basic callstack machinery.
The text was updated successfully, but these errors were encountered: