简体   繁体   中英

Eclipse Debugger not following the source code

I have encountered a problem with the Eclipse and I am unsure how to fix it. When I enter the debugger and press the step over button the debugger usually highlights the line of source code that I stepped to. However, for some reason this is not working for me anymore. I enter the debugger and go to the breakpoint but if I hit the step button the source is not highlighted and if I continue to hit the step button I can see that the Debugger is stepping into other files (looking at the Thread) but my view of my code doesn't change. The only way I can find what line my Debugger is on is if I control click on the line from Debug tab and click Lookup Source which then highlights the line the Debug Current Construction pointer is on. If I am debugging I would like to follow this Current Construction pointer line by line. I must have accidentally altered this somehow and I am unsure how to change it back.

Simply stated the problem is this, usually the Eclipse Debugger highlights your source code as you step through it. It is not doing that for me anymore, the debugger is stepping properly but it is not highlighting the line of code that it is on.

This happens when we make Java code change in file, compiler creates a class but running server has a old copy of your class file. Go with JRebel to get rid of such kind of issues.

This can also happen if you have more than one project in you work space, and you create a debug configuration that points at the wrong project base directory.

To resolve this:

  1. Open your debug configuration list (Run -> Debug Configurations)
  2. Select the proper configuration under your Remote Java Application list
  3. Verify that you have the correct project source listed under the Base directory on the Main tab.

If you have the wrong directory selected (say, one that holds a different project), the debugger will start with no issues, but you will not be able to step through your code.

I had the same issue.

There was a workaround for that by right-clicking on associated callstack line in Debug view and selecting "Lookup Source". After that the current instruction line is (green) highlighted as usual. But I needed to do this after every debug step.

Rebuild all projects didn't help.

The solution: Restart Eclipse and all works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM