Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging Rascal code

Tags:

rascal

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.

like image 466
Richard Bos Avatar asked May 16 '13 11:05

Richard Bos


People also ask

How do I debug a code in terminal?

To view debug information on the monitor terminal, perform the following tasks: Execute the terminal monitor and terminal debugging commands. Enable the information center (enabled by default). Use a debugging command to enable the related debugging.

How do I enable debugging code in Visual Studio?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.

What is debugging in ASP NET?

Advertisements. Debugging allows the developers to see how the code works in a step-by-step manner, how the values of the variables change, how the objects are created and destroyed, etc.


1 Answers

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.

like image 86
Davy Landman Avatar answered Nov 12 '22 08:11

Davy Landman