Skip to content

Add debug primitive providing current source location + enclosing function #2133

Description

@kostmo

While developing a scenario, it would be useful for debugging to be able to see which function a system robot is currently "in" as it executes its program.

Sometimes to achieve this I have placed a say "function_name"; at the top of each function in a robot's program (i.e. "printf debugging") to accomplish this. But it would be nice to have an automatic mechanism.

I imagine it is feasible:

  • At program parse time, annotate each Term with the closest "function definition" that contains it.
  • At runtime, inspect the top frame of the robot's machine and display the function name for the currently focused term in the F2 dialog.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-Moderate EffortShould take a moderate amount of time to address.G-CESK machineThis issue has to do with the CESK machine (the Swarm language interpreter).L-ElaborationElaboration takes typechecked code and manipulates it (inserts extra code, etc.) to be ready to run.S-Nice to haveThe bug fix or feature would be nice but doesn't currently have much negative impact.T-DebuggingInvolves the debugger + related toolsZ-Developer ExperienceThis issue seeks to make life easier for developers writing Scenarios or other Swarm code.Z-FeatureA new feature to be added to the game.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions