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 176797 - Breakpoints out of sync - editor has a different line than debugger
Summary: Breakpoints out of sync - editor has a different line than debugger
Status: RESOLVED DUPLICATE of bug 225311
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 normal with 1 vote (vote)
Assignee: Martin Entlicher
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2009-11-13 07:39 UTC by Vojtech Sigler
Modified: 2013-02-20 22:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Debugger stopped on a different line than is highlighted (47.38 KB, image/png)
2009-11-13 07:39 UTC, Vojtech Sigler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vojtech Sigler 2009-11-13 07:39:55 UTC
Created attachment 91002 [details]
Debugger stopped on a different line than is highlighted

Product Version: NetBeans IDE Dev (Build 091113-2be4cddf8b9f)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Linux version 2.6.28-16-generic running on i386; UTF-8; en_US (nb)

This will probably end as incomplete, but anyway. While playing around with breakpoints and their validation, disabling, .. I got into a state when debugger somehow adds 2 to line number. Currently I cannot reproduce on demand. Messages log does not contain anything relevant.

I.e. I place a breakpoint on one line, but debugger actually breaks on line + 2. Also, by adding a breakpoin on a last line of a block where next few lines are empty I get a funny message from debugger in the console (notice the numbers): 

Not able to submit breakpoint LineBreakpoint LongArrays.java : 35, reason: No executable location available at line 37 in class tests.LongArrays.
Invalid LineBreakpoint LongArrays.java : 35

Line numbers in editor and those understood by debugger need to be better synced.

Attaching a screenshot, where breakpoint in editor and current PC annotaion are on one line, but according to Variables view (based on available local variables) debugger is actually two lines further.
Comment 1 Vojtech Sigler 2009-11-13 07:45:23 UTC
Hmm, this seems to be related only to single file. When this occurs,  breakpoints in other files still work well.
Comment 2 Martin Entlicher 2009-11-13 09:28:44 UTC
This can be caused by editing the file - adding or removing lines.
For reproduction we would need to know the sequence of editing operations you did and whether you edit the file during a running debugger session or not.

But most probably you've edited the source file during debugger was running. Debugger have an internal map of changed lines so that it submits breakpoint to the correct location if you add/remove lines during debugging session (and when the debugged program does not change - therefore e.g. Apply code changes resets this map).

Did you do any Apply Code Changes before this happened? It should be reproducible if you remember what editing you did.
Comment 3 Martin Entlicher 2009-11-16 02:33:08 UTC
I was not able to reproduce this, though sometimes I get the breakpoints shifted to empty lines. So I'll keep this as P4 so that we know about this problem, can be upgraded back to P3 if someone manage to provide steps to reproduce.
Comment 4 bht 2013-02-20 22:47:52 UTC
Likely duplicate. A similar bug 212735 was resolved later than this bug. Please re-open with a test case if you can reproduce this after resolution of 225311.

*** This bug has been marked as a duplicate of bug 225311 ***