Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompiler does not work with JARs within Eclipse Debugger #16

Open
kwin opened this issue Dec 10, 2012 · 8 comments
Open

Decompiler does not work with JARs within Eclipse Debugger #16

kwin opened this issue Dec 10, 2012 · 8 comments

Comments

@kwin
Copy link

kwin commented Dec 10, 2012

When I set a breakpoint within a JAR of a Maven dependency of a project and afterwards debug that project, the debugger will not show the decompiled source of the Maven dependency when stepping through the code. Also I cannot I cannot evaluate new expressions.
I don't know though, whether this problem can be fixed in jdeclipse-realign, or whether it is the problem in m2e described here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=384065.

@mchr3k
Copy link
Owner

mchr3k commented Dec 11, 2012

It sounds like there are two issues here:

  1. You don't get decompiled source when you expect to.

  2. You can't evaluate new expressions.


General: What version of JD-Eclipse realign are you using? What version of Eclipse?

  1. Have you tried explicitly attaching/detaching decompiled source using the toolbar menus?

  2. What do you mean by "evaluate new expressions"?

On 10 Dec 2012, at 22:13, kwin notifications@github.com wrote:

When I set a breakpoint within a JAR of a Maven dependency of a project and afterwards debug that project, the debugger will not show the decompiled source of the Maven dependency when stepping through the code. Also I cannot I cannot evaluate new expressions.


Reply to this email directly or view it on GitHub.

@digital-wonderland
Copy link

You can see an example at https://github.com/digital-wonderland/jdeclipse-issue-16

(note that the cq-mailer jar has to be downloaded manually from the adobe repository (or that one added as repo).

After that please set a breakpoint within the CqMailingService constructor and start debugging the App class. When the breakpoint is reached neither the source is shown nor does the 'Expressions' view work within the 'Debug' perspective.

Now use JD-Gui to decompile the jar (open jar and select File->'Save all Sources'), associate the created src.zip manually with the cq-mailer .jar within Eclipse and restart debugging the App class. Now the source is correctly shown and also the 'Expressions' view works.

Our expectation / hope is that jdeclipse would automatically decompile the class so everything 'magically' works and one doesn't have to attach the source manually.

@kwin
Copy link
Author

kwin commented Dec 11, 2012

Just as an addition: We use the latest version of JD-Eclipse Realign (1.1.1) in Eclipse 4.2 SR1 under Mac OS 10.8.

Another remark about the demo application attached above: It works fine, if you rely on a maven dependency where the source is available as well (JAR with source attachment), so I assume, this really is a problem with JD-Eclipse and not with m2e.

@wangchgiboz
Copy link

I also hava the problem;
stat tomcat in debug in eclipse server plugin , using external web module ;

source not found , I add external archive class jar in source ; source will flash but finally " source not found " again , jd eclipse can not decomile the class in this situation

@tiann
Copy link

tiann commented Sep 11, 2013

do you notice that the 'source not found' problem is because the class file not associated with a jar file!juset because this jar file is loaded dynamic(e.g. Maven) so:
Source not found might be legitimate for dynamically loaded code (e.g. Maven).
There are three workarounds known to me (after months of search):
Connect to a running JVM with the debugger and you will see the code.
Use Dynamic Source Lookup plugin for Eclipse from here:https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup

Use run-jetty-run Maven plugin
http://code.google.com/p/run-jetty-run/

if you are working with J2EE,it is recommend to use the run-jetty-run and the DECVM technique,enjoy it

@jcotsell
Copy link

jcotsell commented Dec 7, 2016

Did anyone get this resolved.. I can get it to work on a straight java app.. but as soon as I run via jboss and put in a breakpoint.. the debugger flashes the decompiled code and then closes going back to Source not found

@mortalis13
Copy link

mortalis13 commented Sep 29, 2017

As a temporary solution what I did was copying decompiled source of classes from Eclipse, saving them in a folder (with complete package paths), then added that folder in the Source Lookup. If there are not too many classes to save it works for now. It shows the source code during the debugging and sets active green line when stepping through.

Evaluating expressions as well as Inspecting variables doesn't work. It's Eclipse restriction. Suppose it's because decompiled source doesn't match the original source code for a class (at least all theese decompiler comments makes the whole code text different). What works is hovering over a variable to see its content, though for expressions or method chains it fails).

@asamant2
Copy link

asamant2 commented Nov 21, 2017

Hi All,

While working on any version of eclipse, add the required jars directly to your build path, not through any libraries....for me I have tried this on Eclipse Galileo as well as Eclipse Neon. I have deployed my application in tomcat, and added all the jars from WEB-INF/lib and .properties files from WEB-INF/classes directly to build path and removed the existing Web App library that takes the contents of lib/classes to the build path. If you work like this you will be able to debug inside jar files. Inside Jar files, you will not be able to check values of any local method variable or evaluate any expression manually, but you will be able to check any global variable (both class as well as member) value as well as arguments passed to the current method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants