• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging code without sources

 
Anatoly Chervyakov
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys!

I've got third party jars (compiled for production environment) that I need to debug. I don't have the source files. A clever colleague gave me a suggestion that I followed. Here it is:

1. I send remote debug flags to jvm when I start the application to be debugged. Something like -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

2. In Eclipse I created a dummy project and added all the jars to be debugged to this project. I've installed "JD decompiler" plugin to be able to view the sources (through decompiling of the class files).

3. I set a break point via "toggle breakpoint" in one of the jars

4. Then I start this dummy project in Eclipse with a debug launch I've created for it.

Up to this point everything goes well. The application pops up, I press a button, and execution hits my breakpoint but then... Eclipce shows a message saying that (in my own words) the breakpoint cannot be installed as the source file does not contain line number information.

Question: is that it? Or can I "fix" this problem somehow to be able to debug these jars?

Thanks in advance,
Anatoly
 
Siddhesh Deodhar
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Forum. Did you tried adding break point's at more places ? because code generated by De-compiler may not be in exact sync with original code.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am just curious- Why would you want to debug the Third Party Jars? If there's any issue you think is due to the 3rd party jars- You can intimate them and ask them debug/fix them. Otherwise De-compiling the jar would not be ideal.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Source code created by a decompiler in useless in this context, as the line numbers would be guaranteed to be different from the original ones. In your case it wouldn't even work if you had the actual sources, as the library has apparently been compiled without the debug flag being set - which results in the class files not having line number information to begin with.

I agree with Mohamed that you should not need to debug the library, but instead contact its vendor/author to either a) obtain the source code, or b) have them investigate any aberrant behavior.

By the way, make sure that the license of the library allows decompiling; that's not a given.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic