JDI StackFrame.Location.lineNumber is missing. Is this due to missing debug information?

35 views Asked by At

I'm debugging a Java program within which a thread is suspended. When examining the stack trace of this thread, there is a JDI StackFrame whose method is sleep for the JDK class java.lang.Thread. I want to examine the JDI Location of this StackFrame, particularly the lineNumber of this method. However, the lineNumber is missing and I wonder why. Is this because the JDK class I'm using was not compiled with debug information?

I see that methods defined by myself, compiled with debug information, have lineNumbers available which leads me to think that the presence of the debug information is the difference. However, I'm wondering if any other factors may be the issues. Are lineNumbers derived from debug information?

Many thanks.

1

There are 1 answers

0
gcworker44 On

Turns out I was trying to get a line number for a native method which has no function body (hence no line number).