Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse debug - line: not available

I can't seem to find anything on google telling me why this might be and what the resolution is. I'm Stepping through third party code (that I have the source for) and would really like to see the current line being executed...

Looking at javac compile flags, I see the -g:none flag. If this flag is set, would this be enough to explain why I'm not able to see line numbers? If so, why would someone do this, are there performance implications? Do I need to recompile the jar myself to attach the missing debug info (if possible)?

Thanks!

like image 488
Mike Avatar asked May 21 '10 20:05

Mike


2 Answers

Looking at javac compile flags, I see the -g:none flag. If this flag is set, would this be enough to explain why I'm not able to see line numbers?

Yes, that's the reason.

If so, why would someone do this?

Perhaps the author of the library wanted to make his jar as small as possible. The performance won't be very different if you compile without the -g:none switch.

like image 105
tangens Avatar answered Nov 08 '22 17:11

tangens


I would imagine there would be performance implications, but debug information will definitely make your class files larger. So that's another motivation.

Also, companies that want to protect their source often won't compile in debug information to make disassembly (reverse engineering) less valuable to someone so motivated (this is the same reason some companies obfuscate their bytecode).

Clearly if the source is available to you the above point is irrelevant. If the code is open source, you shouldn't have too much trouble compiling yourself the library (after all, every other contributor would need to be able to do that!). And yes, that is your best option at this point.

like image 38
Mark Peters Avatar answered Nov 08 '22 15:11

Mark Peters