Debugging processing of slightly different inputs

I am currently working on a Java compiler. In the context of the compiler, slightly different inputs may produce different results (for example, adding final to Java allows the compiler to perform more optimizations). In some other cases, different inputs can lead to the same result (for example, to cancel some constructions for each cycle).

When debugging how the compiler handles these cases, I usually start the compiler and try to figure out where the execution path of the compiler runs diverges (or converges). Needless to say, this is very tiring.

I am wondering if you have any tips that could help me debug these situations.

In addition, is there any tool that can track two executions of a program and provide you with a difference in execution paths.

0
java debugging
Jul 31 '09 at 2:17
source share
1 answer

I am working on CLI bytecode -> native JIT code, which is different, but we face similar hurdles. I put a special ToString method that will pretty much print the current state of the byte code along with a strongly typed evaluation stack, etc. It allows you to visually check the code transformations at each step using the text demarcation tool. In the end, I want to create a debugger visualizer that will be “ ToString ” at every step, and let me go back / forward directly in the debugger with highlighting for changes.

If you print a syntax tree nicely, you can split it in a similar way.

Edit: I wrote an Annotator base class that alternates IL bytecode with a representation of the assembly language of the generated native code. It has a ToHtmlString() method that allows me to use the HTML visualizer built into the Visual Studio debugger. Please do not criticize the ARM code - I just hacked something to focus on Annotator, and now that it works, I will use it to work on the corresponding codegen.

Right click → View Image if you want to see its correct size. :)

alt text http://www.280z28.org/images/vmx/2009-08-23-Annotator.png

+2
Jul 31 '09 at 2:38
source share



All Articles