Search code examples
javajmockit

jmockit debug binary source mismatch


I was debugging an unit test case which used the Jmockit(v1.1), one weird scenario I am encountering is that : one the class was mocked to replace one method implementation. and then when debugging, that class source code become unaligned with its corresponding binary. I confirmed this by debugging step into a non exist method (looking from source code ).

I tried byte code outline tool on eclipse, but the byte code is basically aligning itself with the source code instead of the real executing byte code.

Tools Used( MVN, eclipse ) and when the error began, there is an error on the debug panel com.sun.jdi.InternalException: Got error code in reply:35 occurred retrieving this from stack frame

how to investigate this kind of source/binary mismatch problems ?


Solution

  • You dont mention the tools/IDE you are using, but from experience, its possible that the library used by the debbugging IDE mismatchs the runtime one, in my case its was Eclipse+Maven(M2E) using a provided scope dependency(ie: you say version 2.1 will be provided but its actually 2.2 at runtime). So the lines from the runtime stack trace would not match the source being displayed by Eclipse.