0

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?

hojusaram
  • 497
  • 1
  • 6
  • 13

2 Answers2

2

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

user43968
  • 2,049
  • 20
  • 37
0

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.

hojusaram
  • 497
  • 1
  • 6
  • 13