Language debugging
I've seen different posts about debugging, but most are pretty old.
Is there something that describes the current state of debugging possibilities in MPS? I'm wondering about inspecting values of nodes and variables that are changed by behavior, editor or other kind of code (usually written in baseLanguage).
Note: I've also seen this link https://confluence.jetbrains.com/display/MPSD32/Using+MPS+Debugger, but I think this is more about creating a debugger for your language itself (like the mbeddr people did for C).
Please sign in to leave a comment.
Creating a debugger for a projectional editor is quite tricky, What we see in the editor is not necessarily the same it executes in the generated code, The debugger of mbeddr is good but not efficient. I will be really happy if jetbrain's team or anyone come up with a better debugger for MPS.
Few thing that might help you as per my experience with MPS:
- You need to find a good debugging solution for the type of code you are generation from MPS.
- You need to learn MPS code lifting functionality using which you can point to editor from your generate code.
- You can try Eclipse CDT, it is widely used for debugging purpose.
Note: AFAIK only executable part of the editor can be tracked.
Hey Eugen!
So far I've used it for debugging a editor plugin. In my opinion it works well. It also has advanced debugging capabilities. (for instance watches).
Hi m sch95, Sanjit,
Thanks for your quick respones!
@m sch95: thanks! I tried it now and it worked exactly only once. The first time when I made a run configuration for MPS instance, it worked nicely. When I closed it and I wanted to run it again, it keeps telling me this:
If I close all MPS instances and then restart MPS, I still keep getting it when I try to debug a run configuration for MPS Instance. Do you have any tips on which kind of newbie mistake I am making?
@Sanjit: I don't want to debug C code but the actual language definitions, so (as I understood from m sch95, the link in the MPS debug howto is the way to go). Thanks for thinking along though.
Hey Eugen!
I just took the configuration for MPS 3.3 from here:
https://confluence.jetbrains.com/download/attachments/59935272/Debug4.png?version=1&modificationDate=1423468831000&api=v2
Normally, it opens up a new MPS instance/window, where I tried my use case and examined it through the other MPS instance debug window.
I haven't had that error so far. It would help, if you can post your configuration.
Regards,
m sch95
Hi m sch95,
Thanks for your very quick reply!
I tried first my own:
Then I tried the one from Vaclav's example that you posted, it complains about the 4096m (and even 2048m) being too big (which is weird for a 64-bit PC with 16 GiB of RAM) and then I set it to 1024.
Then it would complain again with "too many instances".
I looked in the console tab and there it tells me:
WARN: C:\Users\eug\.MPSDebug33\system\token (The system cannot find the file specified)
java.io.FileNotFoundException: C:\Users\eug\.MPSDebug33\system\token (The system cannot find the file specified)
So I decided to just add an empty file that is called like the one it's complaining about and then I get:
Unauthorized Operation: The command line launcher is outdated. Please refresh it (via Tools | Create Command-line Launcher).
There is no "Create Command-line Launcher" in the Tools menu however :/
I'm using MPS 3.3.5 (the latest stable for now) with JDK1.8.0.20.
So that just got quite weird :/
Do you have any ideas? Or anyone else, for that matter?
I also ticked "open current project". Maybe that will help..
Hi m sch95,
Thanks again for your answer! Sorry that I didn't answer immediately, but there was a lot of other stuff that came in between.
So I tried (now with a new version: 3.4.3) to run the debugger (and now with the "open current project" checkbox enabled) and I get this the first time around when I run:
For any consecutive run, it will give me this:
Until I reboot MPS, then I get the first NoClassDefFound exception again.
What's your experience with 3.4.3? Does it work?
Alright, I found the problem: if you use the generic distribution (zip), then the debugging doesn't work. For Windows at least, I have to use the exe-installer. Then the debugger works.
I reported this issue in YouTrack.
By the way: the mbeddr people have a nice video (made by Tamasz) on how to do debugging of an MPS intention from IDEA: https://github.com/mbeddr/mbeddr.core/wiki/Misc-Topics#how-to-debug-mps-with-intellij
@Eugen
Glad that I could help. I haven't updated to 3.4.x yet.