How to debug S1TBX code

I set up IntelliJ IDEA for SNAP development as suggested on the developer documentation. Since I am interested in S1TBX, this means that I have three repositories and three configured projects on IDEA (snap-engine, snap-desktop and s1tbx). As suggested by the documentation, the application is launched from the snap-desktop project, with the appropriate command line to load S1TBX modules. This work as expected.

Now I would like to enter debugging mode and play with S1TBX code. However, since I have to launch the application from snap-desktop, I don’t have access to S1TBX classes there. How can I open S1TBX code and, for example, set breakpoints or inspect variable values from snap-desktop?

Thanks for the help!

I assume you have seen this wiki page already: https://senbox.atlassian.net/wiki/spaces/SNAP/pages/24051775/IntelliJ+IDEA
There it is explained how IDEA should be configured.
This way debugging should work too.
Important is to set –clusters and –patches.

Hi, thanks for your help!

Yes, I have used the instructions in that page, and SNAP starts correctly. I can also debug it, but, for example, I can only set breakpoints in classes belonging to snap-desktop. Classes belonging to s1tbx are not listed in the snap-desktop, so I cannot open them and set breakpoints. At least, I don’t understand how to do that: the class list on the right does not have them.

What would you suggest to do?

Thanks again.

Does your project look like this?
image

If not then try to include s1tbx as a new module.
You can do this in the menu File \ New \ Module from Existing Source...

1 Like

Oh, I got it: I was using “Project from existing source” instead of “Module”. Thanks for the patience! I made it work now.

1 Like