I am writing a Java debugger which needs to access operand stack.
Basically, I am trying to record execution trace of a Java program with JPDA (https://docs.oracle.com/javase/7/docs/technotes/guides/jpda/index.html). For each trace step, I would like to retrieve the read/written variables. For the application code, I can analyze the variable expression (e.g., a[i]) to get its runtime value. Nevertheless, when the Java program runs into the library bytecode (without source code), I can only know what Java bytecode is running (e.g., aaload), which makes it hard to get its running value with JPDA.
Does anyone know to retrieve the value in Java operand stack? Thanks!