Skip to content

Debuging with ECD doesn't open the class in ECD on eclipse 2018-09 and later #58

Open

Description

@gayanper

When debugging a class without the source (specially eclipse RCP application), when clicking on a stacktrace the file is not opened with ECD. Instead the file is opened with not source found class editor. As a workaround to get this working, i need to open the class which belongs in the debug stack by OpenType which opens the class in ECD, after closing it if i click the debug stack again, then file is opened in ECD and the debug line is highlighted.

Activity

  1. RobertZenz commented on Dec 26, 2018

    @RobertZenz
    Collaborator

    I believe that this should be a duplicate of #43.

  2. gayanper commented on Dec 28, 2018

    @gayanper
    Author

    @RobertZenz i don't think they are exactly the same, because in this issue, "class without source" is set to ECD it self.

  3. helospark commented on Dec 28, 2018

    @helospark

    I occasionally see this also and it is quite annoying when happens.

    It may have something to do with multiple projects/modules open with different version of the same jar (dependency) attached, but I don't really have a reliable repro for it.
    Usually it helps if I close down other projects and restart the debugging.

  4. added this to the 3.2 milestone on Dec 28, 2018
  5. RobertZenz commented on Dec 28, 2018

    @RobertZenz
    Collaborator

    Mh, okay. Personally I haven't seen this so I'm not sure what to make of it.

  6. gayanper commented on Jan 7, 2019

    @gayanper
    Author

    Will try to dig in if i find some time and post the details or a PR if possible

  7. davidmichaelkarr commented on Jan 22, 2019

    @davidmichaelkarr

    I occasionally see this also and it is quite annoying when happens.

    It may have something to do with multiple projects/modules open with different version of the same jar (dependency) attached, but I don't really have a reliable repro for it.
    Usually it helps if I close down other projects and restart the debugging.

    Personally, the ECD is working fine for me, but I was helping a dev with a problem yesterday, and it was refusing to decompile a particular class for her. In fact, that class was available in two different versions of the artifact, with slightly different FQCNs, and neither was decompiling. When I attempted to open the same class in my Eclipse, it only saw one of the ones that she was seeing, and it had no trouble decompiling it. She has the same version of Eclipse and ECD that I have, and I believe the ECD configs are identical also. The difference here is the factor you allude to, with two different versions of the artifact in scope.

  8. RobertZenz commented on Jan 22, 2019

    @RobertZenz
    Collaborator

    @davidmichaelkarr There is a certain caching mechanism which I have not looked at, so maybe the cache got bad on that one and confused the plugin. But I'm not sure about that.

  9. helospark commented on Jan 22, 2019

    @helospark

    @davidmichaelkarr If this happens next time, please try to set "Search for duplicate source files on the path" option, I have a suspicion that it helps. You can set it like:
    https://stackoverflow.com/a/23054379/8258222
    (I was meaning to try this for a while myself, but lately I'm not working on projects, where this issue occurres)

  10. davidmichaelkarr commented on Jan 22, 2019

    @davidmichaelkarr
  11. jameyg42 commented on Feb 8, 2019

    @jameyg42

    FYI - i had the same apparent behavior (fresh 2018-12 install, fresh workspace), and fixed the issue by simply marking ECD as the default editor for .class without source files

    • Window -> Prefs -> General -> Editors -> File Associations
      .class without source
      click Class Decompiler Viewer; click Default
      (not sure how this relates to the "set default" setting under Java -> Decompiler prefs)
  12. gayanper commented on Jan 30, 2020

    @gayanper
    Author

    I tried this with eclipse 4.14 and 4.15 milestone as well. And debugged the jdt code as well. Seems like jdt doesn’t even try to open the class file. I think thats because how the new source lookup happens.

    I even had tried with a simple java project to see this. It didn’t worked

  13. jmiserez commented on Jan 30, 2020

    @jmiserez

    Unchecking the option Java -> Debug -> "Use advanced source lookup (JRE 1.5 and higher)" checkbox resolves this issue for me.

    Just setting the default editor to the decompiler seems to work too, but I noticed that sometimes the wrong .class files would be decompiled when debugging.

  14. gayanper commented on Jan 31, 2020

    @gayanper
    Author

    Nope it didn't worked for me. I will try to share my project later.

  15. gayanper commented on Feb 1, 2020

    @gayanper
    Author

    Try to step into RMObjectBuilder constructor for example.
    workbench.zip

  16. gayanper commented on Feb 8, 2020

    @gayanper
    Author

    @RobertZenz any update on the issue ? any reasons why the ECD is not even tried when debugging in eclipse 4.14 ?

  17. helospark commented on Mar 29, 2020

    @helospark

    This was caused by this Eclipse JDT change:
    https://github.com/eclipse/eclipse.jdt.debug/commit/6ec6201fa7488a685c25febb778dadaf19d9f0b4
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=534891

    I have reverted this change locally, then class decompiler is working correctly.
    I have not seen any regression from reverting. The example attached to the Eclipse ticket works when I reverted the change, however there may be some other regeression cases (?).
    I guess the best thing would be to raise this on the Eclipse Bugzilla.

  18. gayanper commented on Mar 29, 2020

    @gayanper
    Author

    This was caused by this Eclipse JDT change:
    eclipse/eclipse.jdt.debug@6ec6201
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=534891

    I have reverted this change locally, then class decompiler is working correctly.
    I have not seen any regression from reverting. The example attached to the Eclipse ticket works when I reverted the change, however there may be some other regeression cases (?).
    I guess the best thing would be to raise this on the Eclipse Bugzilla.

    Did you try this on a maven project or none maven project when you were testing ?

  19. helospark commented on Mar 29, 2020

    @helospark

    @gayanper I tried with the project you attached (Maven project with some jars added manually to the classpath in Eclipse), the project attached to the Eclipse ticket (which is just a plain Eclipse project) and a Spring Boot app (which is fully Maven). It was working in all cases as expected.

    In case of Maven with source attachement, it is working because the ECD can delegate to source attachment if there is one, only decompiles class if no source found.

  20. gayanper commented on Mar 29, 2020

    @gayanper
    Author
  21. helospark commented on Mar 29, 2020

    @helospark

    @gayanper The version I tested this change doesn't have your changes yet, and I'm not sure how MavenRuntimeClasspathProvider connected to all of this.
    Did your fix to m2e also resolves the issue? - not entirely clear from the ticket

  22. gayanper commented on Mar 29, 2020

    @gayanper
    Author

    @helospark not entirely, there are some problems when debugging which i'm looking right now. But the this issue here, i manage to fix it from m2e. So its not an issue in ECD plugin.

  23. aakifshamsi commented on Apr 10, 2023

    @aakifshamsi

    Unchecking the option Java -> Debug -> "Use advanced source lookup (JRE 1.5 and higher)" checkbox resolves this issue for me.

    Just setting the default editor to the decompiler seems to work too, but I noticed that sometimes the wrong .class files would be decompiled when debugging.

    Perhaps I followed steps till this point, and the combo worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions