microsoft / microsoft/pxt-microbit

Snail mode in Debug is misleading

Open
#3,029 1 comment 0 reactions 1 assignee View on GitHub

@riknoll is already working on this.

Since May 12, 2020.

debugger P2
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Describe the bug
when the debugger steps into a function it halts on the return block whilst the calling block executes, but you probably have no idea what the calling block was as it was all the steps of a function or more ago.

To Reproduce
using the following blocks https://makecode.microbit.org/_aCMgs125j7wF imported into the beta MakeCode editor at https://https://makecode.microbit.org/beta

invoke the debugger and click snail mode

the step higlighter highlights the basic.showString built in, it then steps into my function full_name it correctly steps through and pauses on the return statement as the message is scrolled in the simulator micro:bit.

Expected behavior

should it not keep the basic.showString built in high lighted or even pass control back to it
so the highlighted steps are
basic.showString (possibly just the call function block)
function full_name to return block
back to the basic.showString to then scroll the message on the simulator

Desktop (please complete the following information):

  • Linux Mint 19.2 (a ubuntu clone)
  • Browser : Chromium (the opensource version of chrome)
  • Version : 81

Additional context
With a recursive function keeping the calling block highlighted may cause some issues but this could just be either documented or a numerical suffix to the block showing the position in the call stack would handle it. A numberical suffix would quickly show students that although a recursive algorithm may be easier to program that number of stack frames it is eating up memory which could be used for program storage.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.