úterý 5. července 2011

Java has debugging support for other languages

I am trying to figure out how to do mappings of DSL statements to Java (or generally any GPL) statements. At the moment, Acceleo can provide mapping of input file regions to output file regions, even though it turned out that it has its problems as well. But this is not what I want to discuss about now.

To test the mapping, I started with the elementary debugging task - a breakpoint. The aim is to automatically create corresponding Java breakpoint for a DSL breakpoint and this is where I got stuck. I can only create line Java breakpoints in Eclipse, so if there are more statements on the same line, I can't tell which one should trigger the breakpoint. To understand the problem I started to study some Java papers and specifications and I've found the com.sun.jdi.Location interface. After reading the documentation of that interface I found out that Java class files can contain source information related to more source files than just Java sources. This is used for instance in JSP which are translated to a Java source files and these are compiled. It could be as well used for any DSL.

For more about the feature read JSR-45.

Žádné komentáře:

Okomentovat