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!
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With