The call tree counts global variables as local variables

Issue #525 resolved
Russell Owen created an issue

John and I were trying to debug code that was running out of stack space, and he said to look at the call tree to look for deep calls and large numbers of local variables. We noticed that the number of local variables shown was large even for routines that set many global variables but no local variables. This is at least a cosmetic bug, and if setting global variables does not use stack space, then it makes the call tree less diagnostic.

Comments (3)

  1. John Maloney repo owner

    Update: Call tree works for most cases. This bug appears to specific to the way the XRP and Encoded DC Motors are structured. I need to dig into it more deeply, but it looks like the fact that _edcmotors_initSystemVariables is called from the Encoded DC Motors library but defined in the XRP library is confusing the callTree function.

    We may want to change the architecture so that the client of Encoded DC Motors is responsible for calling a function in the Encoded DC Motors library to configure the desired number of motors instead of being responsible for implementing the _edcmotors_initSystemVariables, an unsual pattern in MicroBlocks.

  2. Log in to comment