Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Debug perspective source code window(Source code window initially disconnected)
Debug perspective source code window [message #1814384] Tue, 10 September 2019 16:41 Go to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
I apologize if this is the wrong place to post this.

I'm using Eclipse 2019-06 Eclipse IDE for a Java project. It works perfectly for development and I've become a quick avid Eclipse fan (having used other tools previously).

I do have one issue.

When I put an Ctrl+Shift+B breakpoint on a line, it breaks like it should and shows up in the debug perspective as it should, but the source code window won't respond to F6 step, F5 step into, or any other debugging keys until I expand the thread in the Debug pane, click on another function in the call stack, click on the source code that pops up, then click back to the current function in the call stack, then click on the source code window. Then it works like normal.

This happens about 85% of the time. Every now and again it will work. And typically after I go through this call stack cycling effort that first time, it works thereafter for the remainder of the debugging session (for that running process).

I can't figure out what I'm doing wrong. Any help is appreciated.
Re: Debug perspective source code window [message #1814430 is a reply to message #1814384] Wed, 11 September 2019 11:07 Go to previous messageGo to next message
Sarika Sinha is currently offline Sarika SinhaFriend
Messages: 132
Registered: February 2010
Location: Bangalore, India
Senior Member
Looks similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=540243
Can you please add a reproducible step in the bug.


Sarika Sinha
JDT Programmer
Re: Debug perspective source code window [message #1814432 is a reply to message #1814430] Wed, 11 September 2019 11:25 Go to previous messageGo to next message
Simeon Andreev is currently offline Simeon AndreevFriend
Messages: 4
Registered: September 2019
Junior Member
Hi Rick,

are you able to share the code you are debugging? Ideally with a screenshot of your Eclipse IDE before you did any debugging and then at this part of your description:

Quote:
but the source code window won't respond to F6 step, F5 step into, or any other debugging keys


What you describe definitely sounds like a bug, so we will need some information to fix it.

Best regards and thanks,
Simeon
Re: Debug perspective source code window [message #1814458 is a reply to message #1814430] Wed, 11 September 2019 16:57 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Sarika Sinha wrote on Wed, 11 September 2019 11:07
Looks similar to https://bugs.eclipse.org/bugs/show_bug.cgi?id=540243
Can you please add a reproducible step in the bug.


It's reproducible almost every time in my current project on my home computer. Here are some details of my project:

A 2007 HP Pavillion computer with a quad-core Intel CPU at 2.4 GHz. 8 GB RAM. Windows 7 64-bit. No anti-virus. Direct Ethernet network. A 500 GB SSD. Eclipse build id: 20190614-1200. (Note: I mention all this because it's a slower computer, and it may be a timing issue.)

I have a project called "te.....". It has to packages, "fi....." and "te.....". fi has two .java files. te has 31 java files.

The project initializes a single JFrame with a single JPanel with a single JLabel, all equal to the size of the window it creates. It has the following threads running:
Main(1) [Java Application
te.....Main at localhost:65159
Thread [main]
Thread [Thread-1]
Thread [AWT-EventQueue-0]
Daemon Thread [Java Sound Event Dispatcher]
Daemon Thread [Direct Clip]
(it has 22 of these Direct Clip threads)
Thread [Te.....Thread]

I have Eclipse set to suspend all threads on breakpoint. I set a breakpoint at some point in code after the environment has instantiated and the application is running. I'm in the Debug Perspective.

It suspends and in the Debug pane, all threads are collapsed. I have to find the thread that was suspended, which I usually know anyway, expand the thread, click on the call stack item associated with the source code file + line the breakpoint was on, then click on something higher up on the call stack to bring up that file, then back to the original source file, then click on the source code window.

If I don't do those steps, I can navigate, edit, switch tabs to edit other files, etc. Everything editor-wise works, but it's like the keystrokes for the debug environment are not connected to the editor window until you click away and click back.

The short list:
1) Set a breakpoint, right-click properties set to Suspend VM.
2) Run app and wait for it to hit breakpoint.
3) Try to use F5 or F6. They fail.
4) Find the thread (if all threads are collapsed) and open it.
5) Click on another call stack entry line to bring up a different source file.
6) Click back on the call stack entry associated with the breakpoint.
7) Click on the source file itself in the editor window.
8) Now F5, F6, F7, F8, other keys work.
Re: Debug perspective source code window [message #1814466 is a reply to message #1814432] Wed, 11 September 2019 20:49 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Simeon Andreev wrote on Wed, 11 September 2019 11:25
Hi Rick,

are you able to share the code you are debugging? Ideally with a screenshot of your Eclipse IDE before you did any debugging and then at this part of your description:

Quote:
but the source code window won't respond to F6 step, F5 step into, or any other debugging keys


What you describe definitely sounds like a bug, so we will need some information to fix it.

Best regards and thanks,
Simeon


It's proprietary code so I cannot. However, would it be possible for me to get the source code for Eclipse and inject code which allows me to hit a special Function Key when it enters that incorrect mode where it's not working (it can snapshot variables of interest, whatever), and then after I hook it back up by going through the several steps to get it working again, then press the key again to do a second snapshot so they can be compared with a diff utility?

[Updated on: Wed, 11 September 2019 20:51]

Report message to a moderator

Re: Debug perspective source code window [message #1814521 is a reply to message #1814466] Thu, 12 September 2019 15:13 Go to previous messageGo to next message
Simeon Andreev is currently offline Simeon AndreevFriend
Messages: 4
Registered: September 2019
Junior Member
Could you try debugging your application with breakpoints that suspend only the thread and not the entire JVM? So far I've not worked on bugs that involve VM suspend on breakpoint hit, so it would be a start to know whether this preference is related to the problem.

It would also greatly help if you can try the same steps on a smaller scale and see if you still see the problem. I.e. the following:

Quote:
The project initializes a single JFrame with a single JPanel with a single JLabel,


Do you set your breakpoint somewhere in your AWT code?

Unfortunately there is no snapshot option that you can use in this case. The Eclipse debug framework is highly asynchronous, which is usually the cause for not displaying/expanding suspended threads correctly (i.e. the type of problem you are describing). So its important to know which event was processed when; for that, debugging a minimal snippet is usually the best way to find out what the problem is.

It would of course be possible for you to debug the problem yourself, but that would probably be a huge time investment for you. There are some resources on the Debug view here:

https://wiki.eclipse.org/index.php?title=Debug/Developers/Debug_View&modqueued=1

Let me know if you wish to try this yourself.

[Updated on: Thu, 12 September 2019 15:21]

Report message to a moderator

Re: Debug perspective source code window [message #1814579 is a reply to message #1814521] Fri, 13 September 2019 14:13 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Simeon Andreev wrote on Thu, 12 September 2019 15:13
Could you try debugging your application with breakpoints that suspend only the thread and not the entire JVM? So far I've not worked on bugs that involve VM suspend on breakpoint hit, so it would be a start to know whether this preference is related to the problem.


I can. If you have access to TeamViewer, you could get on my machine and witness the effect.

Quote:
Do you set your breakpoint somewhere in your AWT code?


At various places. There's nothing specific. At various times it would break when trying to access a null member, or other such bugs. Mostly it's when I hit breakpoints to single-step through code, make changes, drop to frame, and restart the function.

Quote:
Unfortunately there is no snapshot option that you can use in this case. The Eclipse debug framework is highly asynchronous, which is usually the cause for not displaying/expanding suspended threads correctly (i.e. the type of problem you are describing). So its important to know which event was processed when; for that, debugging a minimal snippet is usually the best way to find out what the problem is.


I can try to pare it down to something smaller that reproduces the effect. Even right now, it doesn't do it all the time. It's about 85%. And ironically, last night when I was debugging, I had a second project open in Eclipse and it didn't do it at all, even after I closed the second project. It's really sporadic and kind of freaky.

Quote:
It would of course be possible for you to debug the problem yourself, but that would probably be a huge time investment for you. There are some resources on the Debug view here:

https://wiki.eclipse.org/index.php?title=Debug/Developers/Debug_View&modqueued=1

Let me know if you wish to try this yourself.


I wouldn't mind doing that, but I'll try other avenues first. TeamViewer works on Linux, Windows, Mac, so if it continues and you want to examine my running instance on my machine, see my settings, etc., we can hook that up if I can't get it to fail reliably on a smaller redacted subset of my code.

I appreciate your help.
Re: Debug perspective source code window [message #1814610 is a reply to message #1814579] Fri, 13 September 2019 20:25 Go to previous messageGo to next message
Simeon Andreev is currently offline Simeon AndreevFriend
Messages: 4
Registered: September 2019
Junior Member
I've reported: https://bugs.eclipse.org/bugs/show_bug.cgi?id=551065

Here is a recording of the problem: https://bugs.eclipse.org/bugs/attachment.cgi?id=279862

Rick, please check whether using breakpoints that don't suspend the debuggee JVM helps and let me know. It was relatively easy to reproduce, using AWT and such breakpoints, but when I use ones that only suspend the respective thread I don't see a problem. We'll have to know whether there is more to fix.
Re: Debug perspective source code window [message #1814613 is a reply to message #1814610] Fri, 13 September 2019 20:40 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Simeon Andreev wrote on Fri, 13 September 2019 20:25
I've reported: https://bugs.eclipse.org/bugs/show_bug.cgi?id=551065

Here is a recording of the problem: https://bugs.eclipse.org/bugs/attachment.cgi?id=279862

Rick, please check whether using breakpoints that don't suspend the debuggee JVM helps and let me know. It was relatively easy to reproduce, using AWT and such breakpoints, but when I use ones that only suspend the respective thread I don't see a problem. We'll have to know whether there is more to fix.


Will do. Thank you.
Re: Debug perspective source code window [message #1814695 is a reply to message #1814384] Mon, 16 September 2019 16:42 Go to previous messageGo to next message
Simeon Andreev is currently offline Simeon AndreevFriend
Messages: 4
Registered: September 2019
Junior Member
Rick, if possible please also try working with the setting "Show System Threads" in the Debug view.

You can enable this from the Debug view menu -> Java, see below:

index.php/fa/36314/0/

You will see more threads due to this, but at least in the snippet I've created I no longer see the problem with this setting (with about 50 repetitions anyway). So the setting maybe helps in the short run; knowing whether the setting helps will also narrow the potential causes down.

Note that fixing this might take some time, since right now I have no priority for it at work.
Re: Debug perspective source code window [message #1814697 is a reply to message #1814695] Mon, 16 September 2019 17:03 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Simeon Andreev wrote on Mon, 16 September 2019 16:42
Rick, if possible please also try working with the setting "Show System Threads" in the Debug view.

You can enable this from the Debug view menu -> Java, see below:

[snip image]

You will see more threads due to this, but at least in the snippet I've created I no longer see the problem with this setting (with about 50 repetitions anyway). So the setting maybe helps in the short run; knowing whether the setting helps will also narrow the potential causes down.

Note that fixing this might take some time, since right now I have no priority for it at work.


I will do so. I'm not at that computer right now.

I tried to affirm what you said about causing a break in the AWT by doing something like passing an invalid value into new Color(). I cannot tell if that's an issue though because I can't do anything there because I don't have the source code.

In addition, I did notice that in many of the cases where it was failing it's being dispatched from a dedicated timer thread which looks at a list of timer events and processes them based on the nanosecond delays for each one. I have a 1x per second timer, 2x timer, 10x timer, 30x timer, and a continuous one used for variable length delays based on various system events.

It seems that the disconnect happens more often there when something is triggered from the timer event rather than from an I/O event-driven block of code like mouse move or keyboard input.

I will try to check on it tonight. If not, it will be tomorrow evening.

[Updated on: Mon, 16 September 2019 17:03]

Report message to a moderator

Re: Debug perspective source code window [message #1814984 is a reply to message #1814697] Mon, 23 September 2019 16:50 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
I've been doing development for several days, and it seems to be completely random. I cannot find anything that explicitly ties it down. It happens sometimes, not always, sometimes on breakpoints, other times when it encounters a null value, etc. Sometimes it is able to keep going with keys like F5-F8, other times not. The only thing I can say is that when it's disconnected, the thread is not open in the debug pane on the left. I have to find the thread, and then click on two source files in the call hierarchy to get it to work, some other file than where it stopped, then the one where it stopped.

I wish I had more information to give you. If anyone devs would like to Team Viewer into my computer and see it in action I can set that up. I'm on EDT and I typically am on that computer on the weekends and weekday evenings.

[Updated on: Mon, 23 September 2019 17:13]

Report message to a moderator

Re: Debug perspective source code window [message #1815029 is a reply to message #1814984] Tue, 24 September 2019 12:30 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
As a developer, as a workaround, I would code the engine to re-connect to the source file being debugged in whatever way it does when I click on another source file, then back to the original. I would remove the logic which prevents it from re-connecting when it's already the selected source file. And I would add logic to make sure the currently suspended thread is expanded on the left.

These would be things added after everything should be connected. A workaround to whatever this bug is. It might even be an option enabled under "experimental features" or something similar.
Re: Debug perspective source code window [message #1815036 is a reply to message #1815029] Tue, 24 September 2019 15:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
As a developer you could actually contribute such a thing starting with a development environment with the source code:

https://wiki.eclipse.org/Eclipse_Platform_SDK_Provisioning

But if you hope someone else will fix the problem, there must be a Bugzilla report with a reproducible test case/scenario...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Debug perspective source code window [message #1815037 is a reply to message #1815036] Tue, 24 September 2019 16:01 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Ed Merks wrote on Tue, 24 September 2019 15:57
As a developer you could actually contribute such a thing starting with a development environment with the source code:

https://wiki.eclipse.org/Eclipse_Platform_SDK_Provisioning

But if you hope someone else will fix the problem, there must be a Bugzilla report with a reproducible test case/scenario...


I have considered it.

I wouldn't mind spending some time trying to get in the ball park. And I would really be happy to contribute something positive to Eclipse.

Is there a developer IRC channel or email list I could ask questions on when I get things setup?
Re: Debug perspective source code window [message #1815039 is a reply to message #1815037] Tue, 24 September 2019 16:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
There's this forum and https://accounts.eclipse.org/mailing-list/platform-dev

The instructions in the wiki will setup things up automatically. Way more things than you actually needed, but you can pick and choose which "project" setups to include. I would include all of JDT and Platform Debug for sure for what you'd be trying to do, so that way you'd at least have the source for those.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Debug perspective source code window [message #1815041 is a reply to message #1815039] Tue, 24 September 2019 16:17 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Ed Merks wrote on Tue, 24 September 2019 16:08
There's this forum and https://accounts.eclipse.org/mailing-list/platform-dev

The instructions in the wiki will setup things up automatically. Way more things than you actually needed, but you can pick and choose which "project" setups to include. I would include all of JDT and Platform Debug for sure for what you'd be trying to do, so that way you'd at least have the source for those.


It's installing. We'll see.

I remember the first time I contributed to an open source project. A wonderful feeling of supporting the community. It was Erin Efrah's CodeLite C/C++ IDE. All very exciting. The features I added back in the late 2000s are still there. :-)
Re: Debug perspective source code window [message #1815048 is a reply to message #1815041] Tue, 24 September 2019 18:01 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
It installed. I was able to run All Runtime Tests. Stalled on 158 "testJoinInterruptUIThread" for a long time (100.526 seconds). Had me worried as that was the longest test thus far. Some other ones went 40-60 secodns. :-) It finally completed all 296 tests in 364.080s with 0 errors, 0 failures.

I was able to run Runtime Workplace and debug Runtime Workplace. Very slick how easy it was to setup and get ready.

Now, if someone will just point me to the correct place in source code I'll begin working. Am looking for when it hits a breakpoint, or the JVM signals for null pointer, how it traps to the debugger context showing threads, source code, and any info / messages.
Re: Debug perspective source code window [message #1815049 is a reply to message #1815048] Tue, 24 September 2019 18:14 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Is it common to use an IDE version like 2019-12 to debug 2019-12, for example? I would think 2019-09, or even 2019-06 maybe. Just sayin'. :-)
Re: Debug perspective source code window [message #1815054 is a reply to message #1815049] Wed, 25 September 2019 03:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33216
Registered: July 2009
Senior Member
Yes, this is how the platform team prefers to develop. They use their own latest tools as the development IDE, i.e., the setup installs from the latest 4.14 integration builds. The target platform is also populated from the latest 4.14 Integration builds as well. The API baseline tools are enabled with an API baseline populated from the 4.13 release. All the repos are on the latest master branch. It's easy to pull multiple repositories from the Git Repositories view via multiple selection, so you can update those anytime easily. And via Help -> Perform Setup Tasks... you can update both the installation and target platform to the latest update, i.e., to the most current 4.14 integration build; there's a new at least once per day.

As for finding code, the plug-in spy can be quite helpful to tell you which classes implement what you see in the UI, i.e., Alt-Shift-F1 and Alt-Shift-F2 for menu spy. Also, because you have all the source code, you can use Search -> File... to search for the labels that you see in the UI; these are typically defined in a *.properties file because they are translatable. From that you can determine the property name, and searching for that will find where that thing is used. Also the Call Hierarchy works well, even on static final constants to find where those are used. Then it's useful to set breakpoints in the source of interest, and debug launch the "Runtime Workspace" to see the code in action. It's often useful as well to pause the main thread to see what its doing.

I've not worked on the debug framework itself, so I don't know where specifically to point you at for that. But I always use the above approach when I'm trying to discover how something currently works in some part of the framework that's new to me... And I generally assume that helpful answers will be hard to come by. :-P


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Debug perspective source code window [message #1815095 is a reply to message #1815054] Wed, 25 September 2019 12:09 Go to previous messageGo to next message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
Ed Merks wrote on Wed, 25 September 2019 03:43
As for finding code, the plug-in spy can be quite helpful to tell you which classes implement what you see in the UI, i.e., Alt-Shift-F1 and Alt-Shift-F2 for menu spy. Also, because you have all the source code, you can use Search -> File... to search for the labels that you see in the UI; these are typically defined in a *.properties file because they are translatable. From that you can determine the property name, and searching for that will find where that thing is used. Also the Call Hierarchy works well, even on static final constants to find where those are used. Then it's useful to set breakpoints in the source of interest, and debug launch the "Runtime Workspace" to see the code in action. It's often useful as well to pause the main thread to see what its doing.

I've not worked on the debug framework itself, so I don't know where specifically to point you at for that. But I always use the above approach when I'm trying to discover how something currently works in some part of the framework that's new to me... And I generally assume that helpful answers will be hard to come by. :-P


Understood. And I do appreciate your actually helpful replies. :-)
Re: Debug perspective source code window [message #1815653 is a reply to message #1815095] Mon, 07 October 2019 21:59 Go to previous message
Rick Hodgin is currently offline Rick HodginFriend
Messages: 25
Registered: September 2019
Junior Member
I have observed in 2019-09 I no longer have this issue. In many days of development of upgrading to 2019-09 I have not encountered that bug I had previously in 2019-06 one time.

I don't know what changed, but it's no longer an issue.
Previous Topic:Kudos on Eclipse IDE
Next Topic:Import a Custom Project
Goto Forum:
  


Current Time: Sat Sep 21 14:17:46 GMT 2024

Powered by FUDForum. Page generated in 0.07039 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top