microsoft / pxt-arcade

Arcade game editor based on Microsoft MakeCode
https://arcade.makecode.com
MIT License
486 stars 209 forks source link

More information on the error page for physical hardware devices #1474

Open kevinjwalters opened 5 years ago

kevinjwalters commented 5 years ago

Is your feature request related to a problem? Please describe. The current hardware errors are fun on a MakeCode Arcade device (unhappy face with a three digit number) but not very informative when it comes to the underlying source of the error. This can make it hard or near impossible to debug non-trivial MakeCode Arcade code particularly for errors that occur more frequently or only on hardware target.

This approach might be inherited from the limitations of MakeCode on the the BBC micro:bit with its humble 5x5 pixel display.

Describe the solution you'd like

It would be useful to provide more information on the screen about where the error has occurred. I'm thinking of more complex applications here where it may not be obvious where in the code it happened but for the rare non-application issues more information would also be useful to report the problem to Microsoft.

For comparison, CircuitPython displays a stack trace to both the the console (serial over USB) and the 160x128 screen. Even a single line number would be a good start here.

For block code there also needs to be a mechanism to let users stay in block code and jump the viewport to a line number to let turn a reported error on a physical device into a particular highlighted block.

Describe alternatives you've considered

  1. Status quo - not good.
  2. Line number only.
  3. Function / outer block name and line number.
  4. Full stack trace (taking care to avoid the most useful information scrolling off the screen).

Additional context Originally raised and discussed with @riknoll in MakeCode Forum: Pinpointing errors on the device like a 980 where a real game had blown up and it wasn't at all obvious where it had happened in code and this had never appeared during extensive testing in the simulator.

kevinjwalters commented 5 years ago

Memory issues are one area that will only occur on a device but I think better analysis tools in simulator would help there, this was raised in MakeCode Forum: Memory Tools in MakeCode Arcade and @mmoskal commented upon this.

mmoskal commented 5 years ago

There is some low-level support documented here: https://makecode.com/js/profiling#profiling-memory It logs on JS console.