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

Any way to mitigate issues with base classes and child classes? #108

Open
davidmichaelkarr opened this issue May 24, 2024 · 1 comment
Open

Comments

@davidmichaelkarr
Copy link

Using Eclipse 2024-03 and the latest ECD.

The title is vague because it's impossible to put this concisely. I'll describe it with a basic example.

I'm debugging a problem with embedded Tomcat startup. I've set breakpoints in "org.apache.catalina.core.StandardContext" using the decompiler view of that class.

When I run the service using embedded Tomcat, it hits the breakpoints, but with the use of the "org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext" class, which is a subclass of StandardContext. As a result, it shows an editor buffer for "TomcatEmbeddedContext(StandardContext)" and shows "Source not found" and "Edit Source Lookup Path...".

This is not fatal, just really tedious. I can see the stacktrace, and it shows the line number in the class, so in the Decompiled view, I can go to that line, and if I do "Step Over", I can see the line number in the stacktrace change, but of course nothing changes in the Decompiler view, because the debugger doesn't think we're in that class. The Variables pane is all correct, I just have to go back and forth from the stacktrace to the Decompiled view to see where I am.

It seems pretty likely the problem is due to the use of the subclass.

Is there any way to mitigate this?

@jpstotz
Copy link
Collaborator

jpstotz commented Jun 1, 2024

Another possibility would be that the source code wasn't properly aligned to the expected line properties. And when you created the breakpoint the actual breakpoint was set somewhere else because the displayed code does not correspond to the code Eclipse internally expected to be.

Which decompiler have you used? Make sure not to use FernFlower or CFR when you want to set breakpoints (these two don't properly output the code for debugging). I would also recommend enabling the ECD setting "Align code for debugging" (this property is automatically active if you are in Debugging perspective).

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

2 participants