Many times I am at a line of code in debugger like so:
public in getFoo() { -> return getBar(); }
after having just stepped out of the getBar() method. There is no way to look at the return value. Now, I know that the return value is on top of the stack, but how to inspect it.
Other solution is to change the code to:
public in getFoo() { int bar = getBar(); return bar; }
Which is what I have found myself doing.
Some debuggers let me evaluate the getBar() method again, however it may cause some side effect that I do not want to happen.
I was wondering is anyone has implemented a solution using Java assembly code (using Jasmine assembler for example) such that evaluating that static method gives me the value on top of the operand stack of callers frame. Do I have to resort to JPDA/JVMDI to achieve what I want?