This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 72827 - Debugger doesn't highlight current position
Summary: Debugger doesn't highlight current position
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 5.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-20 02:50 UTC by kpturvey
Modified: 2007-06-26 14:17 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kpturvey 2006-02-20 02:50:34 UTC
When I run the debugger on one of my projects it doesn't display my current
position in the source code.  When it leaves the current method the display does
not move to the new method to which it has gone. 

When I create a new project, without sources, this problem disappears.  I just
noticed that when I put a breakpoint in the main method of the project that I
was having difficulty with, the problem disappears, temporarily.  As soon as the
main method calls another method in the class, I lose my position and the
debugger starts executing code ignoring breakpoints and the fact that I only hit
the single step button.  

In trying to solve this problem I have removed my .netbeans directory and the
problem remained.  I just tested the debugger in another project and it works
fine.  I've also tried exporting the sources and deleting the nbproject
directory, and then importing it back into NetBeans and the problem doesn't go
away. 

I think I may have just figured this out.  The sources that I am using with
NetBeans are not of my own creation.  The way they are laid out is a bit
strange.  In particular they are in a directory src/xcs, but they are in the
default package.  When I added a package statement to each of the source files
the debugger seems to be able to find its place.  

I also had to export the sources and reimport them without the nbproject
directory.  

This is still a bug NetBeans should do something to say that it doesn't
understand where the sources are and it is looking for them in package "xcs" or
something similar.
Comment 1 Martin Entlicher 2006-02-24 13:21:21 UTC
Well, I'm not able to reproduce this. Can you please specify how do you have the
project configured? Or attach the affected project (or some sample project with
the same structure) so that we can explore the problem.

If I create a simple Java file under src/xcs and remove the package statement,
I'm not able even run the file. And when I add the "src/xcs" to the "Sources" in
the properties of the project, both Run and Debug work fine...
Comment 2 Martin Entlicher 2006-03-01 16:16:49 UTC
O.K. I've reproduced it. Thanks for the project. The problem is that the project
is set up incorrectly. The XCS.java file is in "xcs" folder relative to source
root, but it has a default (empty) package.

When you invoke the project properties, add "src/xcs" folder in "Sources" and
remove "src" from there, everything starts to work fine. Debugging works fine
then. Therefore this is a setup issue.

However, it looks like you're not the only one having a problem with this (see
e.g. issue #70748). Therefore I think that debugger should warn users that there
is some problem with the sources. Some warning dialog should be present and
instruct the user what can be done to fix this.
So I'm leaving this open to implement the warning mechanism...
Comment 3 Roman Ondruska 2007-06-26 14:17:54 UTC
This is not a NB defect. On the other hand, from the usability point of view, this issue should be addressed -> Changing
to RFE P3 -- should be considered for the next release, where sources management will be improved.