Search code examples
eclipsedebuggingbreakpoints

Make Eclipse let me set a breakpoint in my custom language code


I've written a compiler that produces JVM bytecode for a custom language. The compiler emits line numbers and SMAP debug information as per JSR-45. When I use the generated class files inside Eclipse, I'm able to step into the source code and Eclipse displays it correctly. However, I'm unable to set breakpoints in it.

If I open the source files in Eclipse with the default text editor, all breakpoint menu options are disabled. If I open them using Java editor, they are enabled but simply don't work.

How can I convince Eclipse to let me set breakpoints in the code?


Solution

  • The addition of Java breakpoints is sadly connected to the JDT Java editor (using .java files with the built-in text editor disallows creating breakpoints).

    However, if you know your compiler, you can create the required markers for breakpoints. See Section Breakpoints in the Eclipse Corner Article How to Write an Eclipse Debugger? for details.