Question

So i've been using Rascal for a while now, but I was wondering if there is support debugging without using println and the terminal?

So like with c# in Visual Studio, stepping through the code, into functions and so on.

For me this would be a big help and can save time.

Was it helpful?

Solution

Just like visual studio, we have breakpoints and stepping through code. Since Rascal runs in eclipse, it might look slightly differently.

Remember to start your rascal console in debug mode, else it won't work.

You start it in debugging mode:

  1. by selecting a .rsc file and right clicking Debug as > Rascal application.
  2. or, if you select start console from a navigator or editor context-menu, it is a "Debug" console by default.

Adding breakpoints is done by clicking in the margin of an editor. Any function you call from the console will activate the debug mode of Eclipse as soon as it hits the breakpoint.

Structured statements such as if and for act a little different in the debugger than what you might expect from Java or C#. Namely you have to "step into" them, otherwise if you press "step over" you will jump over their bodies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top