hojusaram February 2016

Instruction address to symbol for Java

Let's say I have a particular instruction address for a Java program (for whatever reason) and I want to know which function it belongs to.

If this was from a C++ program for example, I could use binutils (addr2line etc) to get this.

Is this even possible for a Java program as there's no ELF file as the bytecode is JIT-ted?

Answers


user43968 February 2016

Have you heard about javap ??

With javap -c MyClass.class you can have look at bytecode instructions.

Check https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javap.html if it helps


hojusaram February 2016

perf-map-agent solves this problem:

perf-map-agent is an agent that will generate such a mapping file for Java applications. It consists of a Java agent written C and a small Java bootstrap application which attaches the agent to a running Java process.

Post Status

Asked in February 2016
Viewed 2,334 times
Voted 9
Answered 2 times

Search




Leave an answer