Hi, I am trying to intercept the Android API calls made by both, the Android application and the underlying Android system. I am doing this by instrumenting the Dalvik VM so as to insert print statements at two places: - when an "invoke" opcode is executed by VM - when "return" opcode is executed by VM
As per the documentation and also the source code, Dalvik VM doesn't seem to have a switch statement (as is common in many interpreters) for the opcode handling. Instead, it uses a computed goto, where at the end of each opcode handler, it fetches the next opcode, multiplies it by a suitable value to get the address of the opcode handler and then directly jumps to the address of the handler. This seems to suggest that there is no way that the opcode handler (written in assembly code) returns back to the 'C' code before executing next instruction. This is making it harder to insert a print statement to catch the point where the interpreter executes the "return" opcode. I can only find one possible place : assembly code handler for "return" opcode. But I am trying to avoid writing print statement in assembly code. (I will have to do that, if there is no other option.) Can anyone who is familiar with the code give any other suggestions? Am I missing something? Thanks for any inputs. Regards, Amruta -- You received this message because you are subscribed to the Google Groups "Android Discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/android-discuss?hl=en.
