0

I found a good article for how to check the variable value with otSpot Serviceability Agent, however I still have question.

Change Variable Value in JVM with GDB

"The local variable information is reliable for interpreted methods, but not always for compiled methods. However, compiled methods will have an extra line with an address of the code, so you can disassemble and inspect it in gdb"

So why is this way of checking the local variable information not always reliable for compiled methods? And how would I know if the un-reliable situation happens? If this situation happened, how would I disassemble and inspect it in gdb for the Java jitted methods?

As I know GDB can only display native C/C++ methods. It would be a great if there was an example for demoing how to check the local variable information by disassembling and inspect it in gdb for the Java jitted methods when the un-reliable situation happens.

Community
  • 1
  • 1
Jason
  • 31
  • 1
  • 5
  • The linked question contains code, have you tried it/looked at it? If so, how far did you get/where are you stuck? – the8472 Jan 29 '17 at 08:05
  • Sure, However as the linked question mentioned,it is not always reliable for compiled methods, what I want to know is why it is not always reliable for compiled methods? – Jason Jan 29 '17 at 10:56
  • I think that is because the JVM only saves information for deoptimizations at certain instruction points. instructions in between might contain unknown intermediate values – the8472 Jan 29 '17 at 12:11
  • Thank you for your response, so if this un-reliable situation happens, how to disassemble and inspect the variable in Java method by gdb? – Jason Jan 29 '17 at 15:08
  • Don’t. If you have to debug a particular method, try excluding it from compilation. – Holger Jan 30 '17 at 10:26

0 Answers0