Bug 568469 - [breakpoints] When hitting breakpoint in jar dependency, things get a bit flaky
Summary: [breakpoints] When hitting breakpoint in jar dependency, things get a bit flaky
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.17   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-02 18:40 EST by Kris De Volder CLA
Modified: 2022-12-19 17:34 EST (History)
1 user (show)

See Also:


Attachments
sample project (61.40 KB, application/zip)
2020-11-02 18:40 EST, Kris De Volder CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kris De Volder CLA 2020-11-02 18:40:17 EST
Created attachment 284636 [details]
sample project

I put a breakpoint inside of a jar that has source attachement (provided from m2e, not sure it matters or not).

Then when the breakpoint gets hit, execution stops as expected at that line. I can see variables etc, but something isn't quite right. The debug ui behaves a bit flaky. 

Some symptoms of this flakyness:

- putting other breakpoints in that file doesn't seem to work... or well it does, somehow, but the breakpoints do not actually show up in the gutter. They do however show up in the 'breakpoints' view. And they do seem to work in the sense that execution will stop there.
- The debugger highlights current line of execution in the source in Java editor (this is good), but... the icon on the editor is unusual (I'm used to seeing a 'bytecode/binary' icon but with source in the editor. What I'm seeing instead is a 'J' icon like a Java file, but in 'outline font'. I think this probably means Eclipse thinks that 'this source code is not on the classpath'. But I'm not really sure.
- Selecting a method name in a declaration and then 'Copy Qualified Name' shows a popup 'No element to qualify found in selection'.
- JavaDoc hovering over bits of source such as method calls and types provides no info (again, maybe Eclipse thingks this file is not on a classpath?).
- sometimes stepping over a method makes incomprehensible jumps to completely (seems to me) unrelated place.

The debugging experience is very terrible and I find the debugger pretty much impossible to use effectively. 

To reproduce this you can try the following:

- import my sample project as a 'existing maven project'.
- Find method org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(HttpServletRequest, HttpServletResponse)
- place a breakpoint in it
- Close all editors (not sure this matters, but ...)
- Debug As >> Java Application
- Access url http://localhost:8080 in browser or curl or whatever.
=> breakpoint hit.

Now try doing some of this:

- place more breakpoints, notice how they are 'invisible'. 
- step out of the method, a very strange jump happens after the 3rd 'step out'.
  It seems to just skip over a whole bunch of code for no reason that I can determine.
Comment 1 Kris De Volder CLA 2020-11-02 18:48:55 EST
Reproducible with eclipse-jee-2020-09-R-linux-gtk-x86_64.tar.gz
Comment 2 Sarika Sinha CLA 2020-11-05 13:15:50 EST
(In reply to Kris De Volder from comment #1)
> Reproducible with eclipse-jee-2020-09-R-linux-gtk-x86_64.tar.gz

can you provide a sample scenario for Eclipse Platform SDK ?
Comment 3 Kris De Volder CLA 2020-11-05 13:30:06 EST
> can you provide a sample scenario for Eclipse Platform SDK ?

Didn't I already? I described how to import a project put a breakpoint in a specific location and reproduce the problem. 

If that's not a scenario, I'm not sure what is you want exactly.
Comment 4 Sarika Sinha CLA 2020-11-05 14:11:53 EST
(In reply to Kris De Volder from comment #3)
> > can you provide a sample scenario for Eclipse Platform SDK ?
> 
> Didn't I already? I described how to import a project put a breakpoint in a
> specific location and reproduce the problem. 
> 
> If that's not a scenario, I'm not sure what is you want exactly.

Not with eclipse-jee and spring framework. 
But if we can get a reproducible simple java project with jar dependency then it is easier for us to isolate the problem.
Comment 5 Kris De Volder CLA 2020-11-05 17:56:04 EST
> But if we can get a reproducible simple java project with jar dependency then it is easier for us to isolate the problem.

Okay I see what you mean. The thing is, I am not sure this problem is reproducible with simple java projects and setting up a project like that with source attachements etc is really quite involved. I don't really want to do this, because:
 
- it is quite a bit of work I think
- and I'm not even sure the bug will still be reproducible if we remove m2e from the mix. (It may or may not be part of the problem.)

I actually already put quite a bit of effort into filing this bug and documenting the reproduction steps in detail so someone else could follow them to the letter and get the same behavior. I was hoping that this would be sufficient for someone with knowledge of the Eclipse / JDT / M2E internals to debug it further.
Comment 6 Eclipse Genie CLA 2022-12-19 17:34:32 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.