Hi. We're using bytecode instrumentation in a native jvmti agent to monitor method entry/exit. I'd like to capture method return values and report them upon method exit. I see how to obtain local variables, and am indeed doing this when a method is entered; however, I'm not sure how to get a method's return value.
You will need to do two things to make this work:
1) Change the method that your return instrumentation calls to accept a parameter (the return value).
2) Modify your bytecode instrumentation to call your new function with the return value.