I'm really not a debugging expert, and lately I have run into a problem which hopefully has a simple solution. When I test and debug the Mathematica plugin for IDEA , I write code, create it, and run it in the IDEA sandbox.
For those who are not familiar with writing plugins for IDEA: The main problem is that all the user interface code already exists, because it comes with IDEA. My plugin implements only certain interfaces necessary for IDEA to understand Mathematica. Therefore, setting a breakpoint or throwing something in onClickListener , as suggested by @Jeroen, is impossible, because I practically did not write a single line of user interface code *.
Now I had a situation that everything works fine, but when I cancel a specific action, something strange happens. I do not know which specific method (this is not mine!) Is called at the moment when I press Esc to cancel this action. The current point is very likely deep inside the IDEA sources that I have and that I can move with the debugger!
Question:. What is the easiest way in Java to make the debugger break, wherever it is, when I press Esc in the user program that I am currently debugging?
* This is not entirely true, but for a general solution, I would like to think about it this way.
source share