Resolve the implicit operand stack concept in Wasm debugging



a year ago
2 months ago


(Reporter: jujjyl, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



a year ago
When stepping through wasm statements in debugger, the statements, even though shown in linear format, they operate on an operand stack. This operand stack is currently implicit/hidden in the debugger, and not explicitly shown.

It would be preferable to display the operations in traditional format, i.e.

i32.store8 $var0, 0

rather than having

get_local $var0
i32.const 0

in which two first statements push values to the operand stack for the third operation to consume. 

The question is then whether we want to remove the notion of an operand stack altogether for the debugger and display i32.store8 $var0, 0, or if we want to keep the second format, we should then explicitly display the effects of these instructions as one steps through instructions, and the user can see them populating the operand stack as a result.

Comment 1

a year ago
Created attachment 8886651 [details]
Screen Shot 2017-07-14 at 8.37.14 PM.png

Here's a screenshot illustrating the current text format compared to the stack format that wasm-dis spits out. (grabbed when pausing on a divide by zero exception)

On the left hand side at the background window is the wasm-dis stack format, on the foreground is the text format.

The text format currently has an unfortunate effect of making the code look a bit less readable. It is somewhat easier to parse from the stack format what is the dividend and divisor in the i32.div_s operation. Both formats have trouble illustrating what are the operands to the subsequent i32.and operation.

Ideally, we would be able to show something like

$1 = i32.div_s $var$3, $var$4
$var$5 = i32.and $1, (i32)-1

or something of the sorts.


2 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.